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
I noticed after a long session of debugging that the default value of every fieldset is set to 0. My assumption and expectation was that a fieldset's default value would be the reset value defined in the SVD.
Was this a conscious decision or simply something not implemented? I wanted to check before putting in work to implement it.
The text was updated successfully, but these errors were encountered:
yodaldevoid
changed the title
Register default value is always 0
Fieldset default value is always 0
Nov 4, 2023
This is intentional, reset values cause a variety of issues that were contrary to the goals of chiptool. For example, in STM32, different GPIO pins might have different reset values (for example the pins used for SWD). We want the pin registers to be an array, so HALs can index them instead of having to use macros to duplicate the code for each pin (causing unreadable code and slow compile times). However, the reset values of all the registers in an array must be the same. This means we're either forced to lie (have wrong reset values) or have ugly macros (not create the array), or simply not play the game at all (ignore reset values, default to 0). Chiptool chooses the latter.
My assumption and expectation was that a fieldset's default value would be the reset value defined in the SVD.
This is because you're used to svd2rust, I'll point out that this is not the case if you use e.g. C-style bit manipulation :)
I noticed after a long session of debugging that the default value of every fieldset is set to 0. My assumption and expectation was that a fieldset's default value would be the reset value defined in the SVD.
Was this a conscious decision or simply something not implemented? I wanted to check before putting in work to implement it.
The text was updated successfully, but these errors were encountered: