cmsis-svd / cmsis-svd

Aggegration of ARM Cortex-M (and other) CMSIS SVDs and related tools
Apache License 2.0
1.08k stars 270 forks source link

Usage / Wiki #190

Open dadede opened 5 months ago

dadede commented 5 months ago

Hello,

I am trying to convert an SVD from STMicroelectronics, the stm32f303vc in particular. i have looked at the example but have a few questions to get a hang of this package to generate structs for bitfields and how to make the most of it.

1 - The example shows usage for Freescale and a specified MK20D7.svd. All I have is a file named STM32F303.svd. Do I assume I have to find a folder for a specific (or MCU group) package, download one or create one manually?

2 - SVD_ROOT - do i need to set a path variable to SVD_ROOT that points to my project directory?

3 - So far, i ran parser.py and passed the location of the SVD file I want to convert

❯ ./parser.py /home/dbox/STM32Cube/Repository/STM32Cube_FW_F3_v1.11.4/Drivers/CMSIS
./parser.py: 1: #: not found
import-im6.q16: attempt to perform an operation not allowed by the security policy `PS' @ error/constitute.c/IsCoderAuthorized/421.
import-im6.q16: attempt to perform an operation not allowed by the security policy `PS' @ error/constitute.c/IsCoderAuthorized/421.
./parser.py: 18: from: not found
./parser.py: 20: from: not found
./parser.py: 21: from: not found
./parser.py: 22: from: not found
./parser.py: 23: from: not found
./parser.py: 24: from: not found
./parser.py: 25: from: not found
./parser.py: 26: from: not found
./parser.py: 27: from: not found
./parser.py: 28: from: not found
^C

Something is amiss... I'd appreciate any pointers to get this working or any article I can use as refrence. Thank you!

VincentDary commented 3 weeks ago

Sorry, but I don't understand what do you want to do, what is your goal ? why do you execute parser.py in your shell, if you read the source code you can see parser.py is not a command, and the python package do not provide any entry point for a command.

Do you have read the little doc ?

cmsis-svd allows to parse a SVD file in XML format and generate the equivalent Python data structure.