Skip to content
This repository has been archived by the owner on Aug 7, 2021. It is now read-only.

Patch SVD file #19

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open

Patch SVD file #19

wants to merge 6 commits into from

Conversation

dvdsk
Copy link

@dvdsk dvdsk commented Apr 23, 2021

I need PWM support in nrf52832-hal, the code is there but cannot be enabled as it needs various task_ writers that (are present for other nrf528xx chips) are missing. This is caused by #12. I checked if this was fixed in the latest release (8.38.0) of svd files by nordic1

Therefore I have tried my hand at patching the SVD file for the task_ and event_ registers. I am way out of my depth here, someone should really check my work, I did the following:

  • Wrote a python script (fix_svd.py) to confirm that every task and event register has a field with the same name2 in nrf52840.svd
  • Modified that script to add a fields section to each task_ and event_ register:
  <fields>
    <field>
     <name>{field_name}</name>
      <lsb>0</lsb>
      <msb>0</msb>
    </field>
  </fields>
  • ran the python script which generated nrf52832_fixed.svd
  • deleted src/, build.rs and device.x
  • used update.sh to regenerate the Peripheral API

1: in that release nrf52.svd seems to be the nrf52832's svd file
2: the names for some events registers end on [%s] these then have a field missing the [%s]

@dvdsk
Copy link
Author

dvdsk commented Apr 23, 2021

The split into nrf52832.svd and nrf52832_fixed.svd causes the large amount of lines added in this PR. I should probably do away with that because of that and as it makes a diff more work.. I wonder if I should keep the python script. I included it because it could be useful if Nordic updates the svd without fixing this issue and because checking the scripts logic seemed easier then comparing the svd's.

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

Successfully merging this pull request may close these issues.

1 participant