As outlined in “How to Add Register Details View in Eclipse“, I have a nice register detail level viewer for Eclipse and GDB. But one problem showed up: there were entries showing with %s:
The reason is that the parser is not handling the dimElementGroup of CMSIS-SVD.
The details of the dimElementGroup are described in http://www.keil.com/pack/doc/cmsis/SVD/html/group__dim_element_group__gr.html. This allows to repeat similar registers in the SVD XML file without increasing its size.
For example the SVD file has something like this:
<registers> <register> <dim>32</dim> <dimIncrement>0x4</dimIncrement> <dimIndex>0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31</dimIndex> <name>PCR%s</name> <description>Pin Control Register n</description> <addressOffset>0</addressOffset> <size>32</size> <access>read-write</access> <resetValue>0</resetValue> <resetMask>0xFFFFF8A8</resetMask>
The important thing is this:
<dim>32</dim> <dimIncrement>0x4</dimIncrement> <dimIndex>0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31</dimIndex> <name>PCR%s</name>
It says that there are 32 registers (), each address incremented by 0x4 (), and the register names () are PCR0, PRC1, … etc (%s replaced with the items in ).
Unfortunately, that SVD syntax is not supported by EmbSys Registers View (http://sourceforge.net/projects/embsysregview/) in Eclipse. First I thought that this is not a big deal. But the Freescale SVD files are heavily using the dimElementGroup feature, and with this the EmbSys Register viewer was not that useful. My hope was that maybe someone could volunteer and extend the plugin.
At the end, I needed that extension myself so badly to debug Freescale microcontroller. As a side effect, it was a good excercise to practice some Java coding again. And after a few sleepless night hours spending with understanding the existing plugin and code, I was able to get it working after some iterations.
With this, the dimElementGroups are working :-):
Actually I have not (yet?) implemented the full specification. For now I’m only handling comma separated lists like
but not the range notation as in
But I have not seen this yet in all the files I have used. So I’m good with this :-).
The updated patched plugin (patch v0.2) is available on GitHub here:
❗ make sure you download the .zip in ‘raw’ mode!
Happy Viewing 🙂