raspberrypi / pico-sdk

BSD 3-Clause "New" or "Revised" License
3.71k stars 919 forks source link

rp2040.svd file device's description is missing #1073

Closed juju2013 closed 2 years ago

juju2013 commented 2 years ago

It looks like there's an error in the rp2040.svd file.

Per specification of CMSIS-SVD (near the text "description is a string describing the device features (e.g. memory size, peripherals, etc.)"), the field "description" of element "device" is mandatory.

In the actual rp2040.svd, this field is missing.

lurch commented 2 years ago

https://www.keil.com/pack/doc/CMSIS/SVD/html/elem_device.html doesn't describe the description as required. Or does "Occurrence: 1..1" actually mean the same thing as "Use: required"? :thinking:

Actually, looking at the file that you linked to:

        <!-- version specifies the version of the device description -->
        <xs:element name="version" type="stringType"/>
        <!-- description is a string describing the device features (e.g. memory size, peripherals, etc.) -->
        <xs:element name="description" type="stringType"/>
        <!-- V1.1: licenseText specifies the file header section to be included in any derived file -->
        <xs:element name="licenseText" type="stringType" minOccurs="0"/>

where does it say that description is mandatory? (I'm not being antagonistic, I'm just trying to work out what I've missed)

juju2013 commented 2 years ago

Not a big fan of XML, so maybe I'm in the wrong, but according to this specification, use is for attributes and min/maxOccurs are for elements, and in the latter case, the default value is 1.

Where things become complicated: register name is declared alike while peripheral name explicitly says minOccurs="1" - both of them are obviously mandatory ... what's the author's exact intent is not clear for me here. My bad, I was looking at peripherals, which is the parent of peripheral (without s) and the latter is coherent with other type definition.

juju2013 commented 2 years ago

BTW, it would be nice to have a nice description of this nice device ;)

juju2013 commented 2 years ago

When passing rp2040.svd w3c's validator, it appears that not only the description field of device is mandatory, but there's also other issues.

So I'll close this issue and open a more generic one.