Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Nice. So how many manufacturers create those XML files which describe all the registers? Is that common in the Arduino community, for example?


For the xpcc.io library, that I was involved with when I was in college, we ended up defining our own XML format and write importers for the custom formats that ST uses. For the LPC controllers from NXP we had to transcribe the information manually from the data sheet (our attempts to automatically parse the pdfs and extract the info never worked out).

Checkout the latest version (now called modm). A description of our device file format can be found here: https://github.com/modm-io/modm/blob/develop/devices/Readme.... If you are interested in the data for STMs, checkout: https://github.com/modm-io/modm-devices/tree/develop/devices...


Related note: the author created a rust CMSIS-SVD file parser [1].

[1] https://github.com/japaric/svd


Unfortunately many manufacturers create buggy and/or incomplete SVD files (e.g. NXP LPC11Uxx) that need to be fixed by hand :(


But now that you can vend them through Cargo, only one person needs to find the bug and fix it! :)


My hope is, that if enough people start to rely on the svd files and report errors in them, venders will start to ship them with higher quality!


AFAIK SVD files are an ARM thing.


Yeah, they are ARM specific, at least according to https://siliconlabs.github.io/Gecko_SDK_Doc/CMSIS/SVD/html/i....

"The CMSIS System View Description format(CMSIS-SVD) formalizes the description of the system contained in ARM Cortex-M processor-based microcontrollers, in particular, the memory mapped registers of peripherals."


Is it that it would be impossible to write an SVD file for another architecture, or just that vendors don't do it?

If it's possible, and this tooling makes SVDs a really powerful tool for porting, then perhaps it would be easier for the community to write SVDs for non-ARM chips than code.


Probably, but companies wouldn’t do it since they have their own tooling. And I don’t think the community would like to write it neither. Look at a SVD file for a single MCU.

https://github.com/posborne/cmsis-svd/blob/master/data/STMic...

It’s a more than 10k loc XML file. It is too much effort for the community to do that and verify it. And as an embedded system engineer, I wouldn’t trust the community-driven register definition because even vendors have some bug on it and it is almost impossible for the community to write a better register definitions than the vendors themselves. This is a vendors’ job, not the community's.


DeviceTree is the standard / tooling you'll see outside ARM micro-controllers. Started on Power, then found a place in Linux's ARM tree, and is now spreading further.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: