Skip to content

Conversation

kossnikita
Copy link

fix !19

@PhilippHaefele
Copy link

After a quick look into SVD specifications (https://www.keil.com/pack/doc/CMSIS/SVD/html/elem_registers.html & https://www.keil.com/pack/doc/CMSIS/SVD/html/elem_special.html#registerPropertiesGroup_gr), I suspect that access rights are not writable by default and there's only an inheritance model.

So changing the default here mist likely will not fix it in an appropriate way.

I didn't look into code to be precise on this, so not really sure

@kossnikita
Copy link
Author

kossnikita commented Mar 28, 2024

UPD: Good catch! Please give me feedback on the new solution

@kossnikita
Copy link
Author

I suspect that access rights are not writable by default

I can't find any informtion about this. Therefore, I believe that it should have read-write based on my reading of svd files, in which often access is not specified at all, although read-write is supposed

@haneefdm
Copy link
Contributor

I don't believe this is correct. The SVD spec is not clear -- this is why specifications should not be written by example. This would not pass any IEEE committee. But, here we are. Access is said to be inherited from a parent when missing. However, when not specified at all, the convention is to use the first enumeration in the spec as the default. 'read-write' is the third enum.

  <xs:simpleType name="accessType">
    <xs:restriction base="xs:token">
      <xs:enumeration value="read-only"/>
      <xs:enumeration value="write-only"/>
      <xs:enumeration value="read-write"/>
      <xs:enumeration value="writeOnce"/>
      <xs:enumeration value="read-writeOnce"/>
    </xs:restriction>
  </xs:simpleType>

Now the XML schema rules does address this but even from that, I cannot figure out if the schema itself is valid. Access is marked as optional (minOccurance=0) and no default is ever mentioned.

https://arm-software.github.io/CMSIS_5/SVD/html/schema_1_2_gr.html

So, for now we are not changing the XML parser. You could present this question to ARM/Keil themselves and have them update/clarify the spec.

PS: Sorry for the late response

@kossnikita
Copy link
Author

Don't worry about the delay. I'm sure you had your reasons.

Honestly, I've already forgotten what exactly it's about. I'll try to find more complete information about it. Please, don't close the pr, so that I don't forget about it. If I don't find any information, I'll close it myself.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Incorrect indication of read-write access
3 participants