Cortex-M SVD files (NVIC etc) - Page 1
Forum section: electronics / general

author: twiddle
author_rank: Contributor
timestamp: January 03, 2019, 09:25:33 pm
content: Does anybody either have redistributable SVD files, or can point me at some software that includes, SVD files, for ARMv6/7/8-M or M0/M0+/M3 etc?SVD files are great and a number of projects use them for code generation, including my own framework, but STMicro seem to be the only manufacturer who are including the core peripherals in their SVD files. Everybody else only includes the chip-specific peripherals in their files, which makes code generation rather useless as the NVIC etc are missing.Seems to be nothing but a tug of war between other manufacturers and ARM, each of which seem to expect the other to make them available. ARM/KEIL say 'its common knowledge so we won't publish the SVDs' and the manufacturers say 'those are core registers so we shouldn't have to tell you about them'.The only candidates I could find, the SVD files provided by SEGGER in Ozone - are a) not redistributable and b) not compliant with the SVD schema, so they aren't any use.If I could find another manufacturer who includes those core registers in their SVDs I could compare them off against the STM files and pull out the common elements, in a pinch, but it really does look like STMicro are unique in this regard.Does anybody have any suggestions?

author: ataradov
author_rank: Super Contributor
timestamp: January 03, 2019, 10:00:03 pm
content: Microchip/Atmel relies on *.ATDF files, which also contain Cortex-M registers. And public SVD files are generated based on ATDF files, but Cortex-M registers are excluded from it.So there are no Cortex-M SVD files anywhere in Atmel ecosystem.It may be the case that it would be easier to convert ATDFs into SVDs. Some programming will be required, of course.

author: richardman
author_rank: Frequent Contributor
timestamp: January 03, 2019, 10:06:53 pm
content: NVIC etc. are architected in the Cortex-M definitions, so they should not change regardless of silicon vendors? Can you not just grab them off from the ST files and use them everywhere?

author: ataradov
author_rank: Super Contributor
timestamp: January 03, 2019, 10:09:03 pm
content: Quote from: richardman on January 03, 2019, 10:06:53 pmIf ST authored them, then they can restrict their use and distribution.It is actually surprising to me that ARM does not publish them. What do the use in Keil? For Atmel parts, SVD files will not include core definitions, so they must have some default files.

author: ataradov
author_rank: Super Contributor
timestamp: January 03, 2019, 10:15:19 pm
content: Actually, it looks like ATSAML10 and ATSAML11 packs contain Cortex-M23 registers, so for that core you cal have a look at those. They are licensed under Apache-2.0.And In my IAR installation packs for ATSAMS70 (Cortex-M7) have core registers too. But more up to date packs in Atmel Studio dropped them. EDIT: Actually more recent packs in AS don't include SVD files at all.

author: twiddle
author_rank: Contributor
timestamp: January 03, 2019, 10:32:50 pm
content: Quote from: ataradov on January 03, 2019, 10:09:03 pmARM has files up on Github herehttps://github.com/ARM-software/CMSIS_5/tree/develop/Device/ARM/SVDbut they have no peripherals defined, and the files in the legacy version of the CMSIS repo are almost identical with a single peripheral.I'd heard that KEIL had some form of internal definition, but I've not yet gotten to install an evaluation version to see what format they are. I'm not counting on them being straight readable SVDs though.As an example, NXP's MCUxpresso uses blowfish to encrypt their internal definitions which makes no sense to me seeing as the information is all in the reference manual.. I could do some code injection into their IDE, its just java after all, to dump the files from memory when they are decrypted by the IDE, but that would be incredibly tedious and still result in files I couldn't redistribute or use as the basis for derivative works anyway.In a pinch I could use the ATDF files and generate something that would let me pull out the core registers, looks like theres both Python and Rust parsers for them floating around, but I would like to see if there's any other options first.

author: ataradov
author_rank: Super Contributor
timestamp: January 03, 2019, 11:08:35 pm
content: The files in your link are very abridged. Atmel does distribute those files in the CMSIS pack, which you can download it herehttp://packs.download.atmel.com/But they are useless, since they actually don't describe registers.

author: richardman
author_rank: Frequent Contributor
timestamp: January 04, 2019, 08:22:20 am
content: Quote from: twiddle on January 03, 2019, 10:32:50 pmThat's... eff'ing insane. If that's what they think is their crown jewel of IP. We (ImageCraft) do have some SVD files for some SAM3 devices (we have a full set for the STM of course). We use them for I/O register display in the debugger. I believe the ones for the SAM are converted from the XML files.I haven't checked, but there aren't that many ARM core registers, are there? Besides SCB, NVIC, maybe some for the debug trace etc., what else are there? The point is, it couldn't be that difficult to convert the header file definitions (back) into a usable SVD file.

author: westfw
author_rank: Super Contributor
timestamp: January 04, 2019, 09:45:11 am
content: So, just to be clear, you're looking for things like "core_cm3.svd" that is theoretically used to generate the core_cm3.h file that shows up from multiple vendors containing an ARM copyright, correct?Yes, it seems really strange that ARM doesn't publish those!

author: emece67
author_rank: Frequent Contributor
timestamp: January 04, 2019, 10:40:52 am
content: .

author: techman-001
author_rank: Frequent Contributor
timestamp: January 04, 2019, 11:20:18 am
content: Quote from: twiddle on January 03, 2019, 09:25:33 pmhttps://github.com/posborne/cmsis-svd/archive/master.zipI make a number of GPL svd2forth XML processors using xlst:http://hightechdoc.net/mecrisp-stellaris/_build/html/register-generator.html#svd2forth

author: ehughes
author_rank: Frequent Contributor
timestamp: January 04, 2019, 01:59:21 pm
content: You can generally get them if you install Keil (the eval) and install support for your device. They have SVD for most of the Cortex buried in the support packagesNXP will generally provide them if you ask.

author: dgtl
author_rank: Regular Contributor
timestamp: January 04, 2019, 06:17:33 pm
content: Install Eclipse and Gnu MCU Eclipse stuff. It has "packages" feature, that downloads from various locations the mcu-specific stuff, that contain SVDs as well (some are named xml, though). Install needed packs and then find the files in filesystem.

author: twiddle
author_rank: Contributor
timestamp: January 04, 2019, 08:13:18 pm
content: Quote from: westfw on January 04, 2019, 09:45:11 amBasically, yes.Quote from: emece67 on January 04, 2019, 10:40:52 amMy initial tests were with STM32L0x3.svd and it *does* contain SCB and Systick and MPU, and I've verified my SVD files for F042 and F030 also have them. If others are missing that data, that is frustrating, though those three models are the chips in their range that I use the most commonly.Quote from: techman-001 on January 04, 2019, 11:20:18 amUnfortunately many of the files in the cmsis-svd repository are missing these core registers (My project uses the Python parser in that repository to generate CPPReg-based headers, and the LPC8xx svd in there was the one that I first encountered the missing core registers in, actually). There's been a ticket raised on the repo about contributing the core registers by somebody, but I am presuming they couldn't find any under a suitable license for inclusion.Quote from: ehughes on January 04, 2019, 01:59:21 pmGood to know that KEIL just has straight SVDs - as I mentioned earlier I was initially reluctant to jump through hoops to install the IDE to simply find they'd done something ridiculous to obfuscate them. I'll definitely have a look at what they provide. NXP didn't seem that cooperative to be honest - I saw posts on their forums asking for the core register portions of the SVDs and it didn't look like they were inclined to provide them.Quote from: dgtl on January 04, 2019, 06:17:33 pmI will try this before I take a look at what KEIL provide on the off-chance the license is more permissive. Thanks for the reminder - I've seen so many vendor specific eclipse solutions recently that I only investigated those for SVDs, not the vendor-neutral option.

author: ehughes
author_rank: Frequent Contributor
timestamp: January 04, 2019, 08:18:21 pm
content: Actually, segger's Ozone debugger has the core registers as well in"C:\Program Files\SEGGER\Ozone V2.60i\Config\CPU"

author: ataradov
author_rank: Super Contributor
timestamp: January 04, 2019, 08:20:08 pm
content: I just checked Keil and it looks like it contains the same CMSIS-SVD pack with half the stuff missing.

author: twiddle
author_rank: Contributor
timestamp: January 04, 2019, 08:23:07 pm
content: Quote from: ehughes on January 04, 2019, 08:18:21 pmThe files are not compliant to the CMSIS-SVD schema as they are intended for internal use in the debugger only and never for code generation. I'd have to edit them extensively by hand in order to make them usable :/

author: andersm
author_rank: Super Contributor
timestamp: January 04, 2019, 08:55:43 pm
content: Quote from: twiddle on January 04, 2019, 08:13:18 pmIIRC, most of the packs are downloaded from Keil's servers.

author: twiddle
author_rank: Contributor
timestamp: January 04, 2019, 09:59:32 pm
content: Yeah having tested it, the GNU Eclipse stuff is basically just the same CMSIS-Pack files downloadable in the IDE that you can pull from ARM/KEIL servers already, it seems.KEIL has to have something internally for the core registers so I'll have to see if I can sift through their files.Worst case scenario I can reverse-engineer the headers in CMSIS to produce the SVDs, but it just seems a large amount of effort to get information that *should* be freely available somewhere. I'm not the first to use SVDs for viewing registers in a debugger, or for code generation, I'm kinda shocked I don't see more people asking for these files.