bl602-pac
bl602-pac copied to clipboard
The SVD needs improvements
I would recommend, before developing HAL further, we should concentrate on improving the SVD and PAC so we have a better foundation. I generated the docs for the PAC, and I can see there are:
- No/useless documentation for what the peripherals are
- Duplications of blocks that are identical (ie timer2 and timer3 have the same fields but are totally duplicated)
- No field accessors / enumeratedValues beyond
.bits() - No/useless field documentation
So I think we should start by going through the reference manual and updating the SVD.
I asked them if they had an updated SVD, but the one I got unfortunately only has a single change (cks base address changed from 0x4000A000 to 0x4000A700.)
So we might indeed have to update the SVD ourselves.
We should see if we can't combine the work with https://github.com/pine64/bl602-docs/tree/main/hardware_notes somehow.. Maybe we could write a script that generates those tables from the SVD, and then everyone works on the SVD instead.
We've started maintaining our own version of the SVD.
There's already been some great improvements, but there's still a lot that could be better, and there's still details in the above-mentioned hardware notes that haven't made it in yet.
Contributions are welcome!
I started making some changes on my fork, but I also converted all the tabs to spaces, so I'm afraid the diff isn't very clean/mergable.
I encourage you to use enumeratedValues where possible, I see you did the glb register, have a look at what I did here: https://github.com/sajattack/bl602-pac/blob/svd-improvements-glb/soc602_reg.svd#L86