Author Topic: Cortex-M SVD files (NVIC etc)  (Read 8773 times)

0 Members and 1 Guest are viewing this topic.

Offline twiddleTopic starter

  • Contributor
  • Posts: 19
  • Country: au
Cortex-M SVD files (NVIC etc)
« on: January 03, 2019, 09:25:33 pm »
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?
 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 12383
  • Country: us
    • Personal site
Re: Cortex-M SVD files (NVIC etc)
« Reply #1 on: January 03, 2019, 10:00:03 pm »
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.
« Last Edit: January 03, 2019, 10:04:41 pm by ataradov »
Alex
 

Offline richardman

  • Frequent Contributor
  • **
  • Posts: 427
  • Country: us
Re: Cortex-M SVD files (NVIC etc)
« Reply #2 on: January 03, 2019, 10:06:53 pm »
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?
// richard http://imagecraft.com/
JumpStart C++ for Cortex (compiler/IDE/debugger): the fastest easiest way to get productive on Cortex-M.
Smart.IO: phone App for embedded systems with no app or wireless coding
 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 12383
  • Country: us
    • Personal site
Re: Cortex-M SVD files (NVIC etc)
« Reply #3 on: January 03, 2019, 10:09:03 pm »
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?
If 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.
Alex
 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 12383
  • Country: us
    • Personal site
Re: Cortex-M SVD files (NVIC etc)
« Reply #4 on: January 03, 2019, 10:15:19 pm »
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.
« Last Edit: January 03, 2019, 10:18:03 pm by ataradov »
Alex
 

Offline twiddleTopic starter

  • Contributor
  • Posts: 19
  • Country: au
Re: Cortex-M SVD files (NVIC etc)
« Reply #5 on: January 03, 2019, 10:32:50 pm »
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?
If 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.
ARM has files up on Github here https://github.com/ARM-software/CMSIS_5/tree/develop/Device/ARM/SVD but 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.
 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 12383
  • Country: us
    • Personal site
Re: Cortex-M SVD files (NVIC etc)
« Reply #6 on: January 03, 2019, 11:08:35 pm »
The files in your link are very abridged. Atmel does distribute those files in the CMSIS pack, which you can download it here http://packs.download.atmel.com/  But they are useless, since they actually don't describe registers.
Alex
 

Offline richardman

  • Frequent Contributor
  • **
  • Posts: 427
  • Country: us
Re: Cortex-M SVD files (NVIC etc)
« Reply #7 on: January 04, 2019, 08:22:20 am »
...
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.. ...

That'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.


// richard http://imagecraft.com/
JumpStart C++ for Cortex (compiler/IDE/debugger): the fastest easiest way to get productive on Cortex-M.
Smart.IO: phone App for embedded systems with no app or wireless coding
 

Offline westfw

  • Super Contributor
  • ***
  • Posts: 4549
  • Country: us
Re: Cortex-M SVD files (NVIC etc)
« Reply #8 on: January 04, 2019, 09:45:11 am »
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!
 

Offline emece67

  • Frequent Contributor
  • **
  • !
  • Posts: 614
  • Country: 00
Re: Cortex-M SVD files (NVIC etc)
« Reply #9 on: January 04, 2019, 10:40:52 am »
.
« Last Edit: August 19, 2022, 02:07:01 pm by emece67 »
 

Offline techman-001

  • Frequent Contributor
  • **
  • !
  • Posts: 748
  • Country: au
  • Electronics technician for the last 50 years
    • Mecrisp Stellaris Unofficial UserDoc
Re: Cortex-M SVD files (NVIC etc)
« Reply #10 on: January 04, 2019, 11:20:18 am »
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.

Does anybody have any suggestions?

https://github.com/posborne/cmsis-svd/archive/master.zip

I make a number of GPL svd2forth XML processors using xlst: http://hightechdoc.net/mecrisp-stellaris/_build/html/register-generator.html#svd2forth
 

Offline ehughes

  • Frequent Contributor
  • **
  • Posts: 410
  • Country: us
Re: Cortex-M SVD files (NVIC etc)
« Reply #11 on: January 04, 2019, 01:59:21 pm »
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 packages

NXP will generally provide them if you ask.
 

Offline dgtl

  • Regular Contributor
  • *
  • Posts: 183
  • Country: ee
Re: Cortex-M SVD files (NVIC etc)
« Reply #12 on: January 04, 2019, 06:17:33 pm »
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.
 

Offline twiddleTopic starter

  • Contributor
  • Posts: 19
  • Country: au
Re: Cortex-M SVD files (NVIC etc)
« Reply #13 on: January 04, 2019, 08:13:18 pm »
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!
Basically, yes.
In any case, I have just checked the ST supplied files and they are not complete. The NVIC is inside the .svd file, but other peripherals are missing. For example, the STM32L0xx files only list the NVIC, but not any other (no SysTick, no SCB and no MPU).
My 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.
https://github.com/posborne/cmsis-svd/archive/master.zip
Unfortunately 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.
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 packages

NXP will generally provide them if you ask.
Good 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.
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.
I 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. :)
 

Offline ehughes

  • Frequent Contributor
  • **
  • Posts: 410
  • Country: us
Re: Cortex-M SVD files (NVIC etc)
« Reply #14 on: January 04, 2019, 08:18:21 pm »
Actually,  segger's Ozone debugger has the core registers as well in

"C:\Program Files\SEGGER\Ozone V2.60i\Config\CPU"

 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 12383
  • Country: us
    • Personal site
Re: Cortex-M SVD files (NVIC etc)
« Reply #15 on: January 04, 2019, 08:20:08 pm »
I just checked Keil and it looks like it contains the same CMSIS-SVD pack with half the stuff missing.
Alex
 

Offline twiddleTopic starter

  • Contributor
  • Posts: 19
  • Country: au
Re: Cortex-M SVD files (NVIC etc)
« Reply #16 on: January 04, 2019, 08:23:07 pm »
Actually,  segger's Ozone debugger has the core registers as well in

"C:\Program Files\SEGGER\Ozone V2.60i\Config\CPU"
The 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 :/
 

Offline andersm

  • Super Contributor
  • ***
  • Posts: 1198
  • Country: fi
Re: Cortex-M SVD files (NVIC etc)
« Reply #17 on: January 04, 2019, 08:55:43 pm »
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.
I 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.
IIRC, most of the packs are downloaded from Keil's servers.

Offline twiddleTopic starter

  • Contributor
  • Posts: 19
  • Country: au
Re: Cortex-M SVD files (NVIC etc)
« Reply #18 on: January 04, 2019, 09:59:32 pm »
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.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf