EmbeddedNim / svd2nim

Convert CMSIS ARM SVD files to nim register memory mappings
MIT License
19 stars 2 forks source link

Add support for Cortex-M4 core header #9

Open BostonBoston opened 2 months ago

BostonBoston commented 2 months ago

Looking for support of the STM32F429x

I'd potentially be interested in doing this if you have any guidance on how.

auxym commented 2 months ago

Hi, thanks for the interest. Note that if you don't specifically need the functions defined in core_cm4.h, you don't need to do this work, and you can already use svd2nim with your STM32 SVD file, which will produce a fully standalone nim module for register access.

Unfortunately I don't have much time to put into this at the moment. Maybe a bit later.

If you want to have a try, it's not too hard, just manually writing {.importc.} definitions for all the functions defined in core_cmh4.h. You can probably find a guide online on C FFI in nim.

You can also have a look at how I wrapped core_cm0plus:

https://github.com/EmbeddedNim/svd2nim/blob/master/core/core_cm0plus.nim

https://github.com/ARM-software/CMSIS_4/blob/master/CMSIS/Include/core_cm0plus.h