-
Notifications
You must be signed in to change notification settings - Fork 46
Description
I have been working with LPC55S16. You can find the version of the SVD I am look at here.
If you search the SVD for "SECCHANNEL", you will find a cluster with three registers in it. The addressOffset of the cluster is 0 and the dimIncrement is 0x20. It has three contained registers with addressOffsets of 0xc20, 0xc24, and 0xc28 defined as children.
0xc20 as an offset makes that register fall outside of size the first entry of the array.
The fix for the SVD is to make the offsets correct. The cluster itself should have an offset of 0xc20, and the registers should have offsets of 0, 0x4, and 0x8.
Chiptool will gladly generate incorrect code for the SVD before the fix. Svd2rust bombs out. I think the right thing would be to produce an error when the cluster size exceeds the dimIncrement size.