You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It causes compile error: Error: invalid order in enum 'TOOHIGH'.
It seems above code was generated from following code:
<peripheral>
<name>ROSC</name>
<baseAddress>0x40060000</baseAddress>
<addressBlock>
<offset>0</offset>
<size>36</size>
<usage>registers</usage>
</addressBlock>
<registers>
<register>
<name>CTRL</name>
<addressOffset>0x00000000</addressOffset>
<description>Ring Oscillator control</description>
<resetValue>0x00000aa0</resetValue>
<fields>
<field>
<name>ENABLE</name>
<description>On power-up this field is initialised to ENABLE
The system clock must be switched to another source before setting this field to DISABLE otherwise the chip will lock up
The 12-bit code is intended to give some protection against accidental writes. An invalid setting will enable the oscillator.</description>
<bitRange>[23:12]</bitRange>
<access>read-write</access>
<enumeratedValues>
<enumeratedValue>
<name>DISABLE</name>
<value>3358</value>
</enumeratedValue>
<enumeratedValue>
<name>ENABLE</name>
<value>4011</value>
</enumeratedValue>
</enumeratedValues>
</field>
<field>
<name>FREQ_RANGE</name>
<description>Controls the number of delay stages in the ROSC ring
LOW uses stages 0 to 7
MEDIUM uses stages 2 to 7
HIGH uses stages 4 to 7
TOOHIGH uses stages 6 to 7 and should not be used because its frequency exceeds design specifications
The clock output will not glitch when changing the range up one step at a time
The clock output will glitch when changing the range down
Note: the values here are gray coded which is why HIGH comes before TOOHIGH</description>
<bitRange>[11:0]</bitRange>
<access>read-write</access>
<enumeratedValues>
<enumeratedValue>
<name>LOW</name>
<value>4004</value>
</enumeratedValue>
<enumeratedValue>
<name>MEDIUM</name>
<value>4005</value>
</enumeratedValue>
<enumeratedValue>
<name>HIGH</name>
<value>4007</value>
</enumeratedValue>
<enumeratedValue>
<name>TOOHIGH</name>
<value>4006</value>
</enumeratedValue>
</enumeratedValues>
</field>
</fields>
</register>
TOOHIGH has value lower value than HIGH.
svd2nim need to sort enumerated Value when generating code.
The text was updated successfully, but these errors were encountered:
I tried svd2nim for SVD file for RP2040 in https://github.com/raspberrypi/pico-sdk/blob/master/src/rp2040/hardware_regs/RP2040.svd
It generated
RP2040.nim
with following code:It causes compile error:
Error: invalid order in enum 'TOOHIGH'
.It seems above code was generated from following code:
TOOHIGH
has value lower value thanHIGH
.svd2nim need to sort enumerated Value when generating code.
The text was updated successfully, but these errors were encountered: