Device XML files - Validation
Device xml files are setup xml files that contain device specific information. This can include router information, multiple CPUs, GEL startup files, define memory mapped registers, etc. Many target configuration ccxml files and board xml files reference device xml files. It is also an easy way to create custom target configurations by using device xml files. Users can also create their own custom device xml files.
The device xml file is parsed when a debug session is launched. If there are errors in the file, it can cause issues when starting a debug session, often popping up messages stating that an error was detected during the parsing of the device xml file. Debugging such errors can be difficult since device xml files have the potential to be very complex, and often include a variety of other related setup xml files. To assist users validate their device xml file, a device xml validation tool is available. This tool is simply a script that will parse all device xml files in a folder and report any errors detected.
- The device xml validation script is a tcl script. Hence a tcl installation is needed. ActiveTcl version 8.4 is recommended. ActiveTcl downloads are available at ActiveState's ActiveTcl download site. Make sure the path to 'tclsh.exe' is on the system PATH. The ActiveTcl installer should do this automatically
- Download the device xml validation script package
- CCSv4: SetupParser_2009_03_16.zip
- Extract the zip file (location does not matter).
The extracted folder contains various files. The user will only need to be concerned about the two batch files.
To run the main validation script:
- Open a command window to the location of scripts
test.bat <INSTALL DIR>\ccsv4\common\targetdb
'<INSTALL DIR>\ccsv4\common\targetdb' is the default location where CCSv4 looks for setup xml files. Device xml files are located in a subfolder called 'devices'. The script automatically looks for this subfolder.
NOTE: There is an issue with the script where it does not handle spaces in the path. Wrapping the path in quotes does not resolve the issue. The workaround is to use the short name form of the path. For example, if CCSv4 is installed in 'C:\Program Files\Texas Instruments', then pass in the following path to the batch file:
This will run the validation script on every device xml file in the 'devices' folder. Any errors detected will be logged. A text file (results.txt) and html file (results.html) will be generated that highlights all detected errors. The html file can be opened in a web browser:
- Severe errors are reported in RED and less severe errors are GREY
- Auto-generated files (cache files, ccxml files and tcl test files) are located in ./test
- The validation script is intended to test device xml files. The generated .ccxml files contain just enough data to generate the .cache file and can’t be used to launch a debug session
- Schema failures list the line # in the .cache file. Some detective work will be needed to find the corresponding module XML file
- Only failures are reported. A summary on the number of tests generated/run can be found in the last 4 lines of 'results.txt'
NOTE: Depending on the number device xml files and the complexity of them, parsing of all the scripts can potentially take a very long time and consume a lot of system resources (memory)
After the tests are completed, the 'clean.bat' file can be run to delete all auto-generated files with the exception of the 'results.html' file.