Convert CMSIS-SVD (.svd / XML) files into readable JSON with a clear hierarchical structure:
- Device metadata
- Peripheral list
- Register list under each peripheral
- Field list under each register
- Summary counts (peripherals/registers/fields)
Dump into many grouped JSON files:
python main.py cmsis-svd-stm32/stm32f1/STM32F103.svd --split-dir output/jsonGenerate grouped JSON and split headers together:
python main.py cmsis-svd-stm32/stm32f1/STM32F103.svd --split-dir output --split-header-dir output/headersGenerate split peripheral headers (multiple files):
python main.py cmsis-svd-stm32/stm32f1/STM32F103.svd --split-header-dir output/headersThis creates files like:
output/headers/adc.houtput/headers/gpio.houtput/headers/tim.houtput/headers/peripherals.h(index header)
This creates files like:
output/adc.json(includesADC1,ADC2,ADC3)output/gpio.jsonoutput/tim.jsonoutput/usart.jsonoutput/chip_summary.json
input: input.svdor.xmlfile--indent N: pretty indent size (default2)--compact: compact one-line JSON output--keep-empty: keep empty/null fields--no-sort: keep original peripheral order (default is sorted by peripheral name)--split-dir DIR: dump peripheral-group JSON files to directoryDIR--header-common-include NAME: include used by generated header (defaultcommon.h)--split-header-dir DIR: generate split header files intoDIR--split-header-index NAME: index header file name in split-header mode (defaultperipherals.h)
The converter keeps both numeric and readable forms for key values.
Example register fields include:
addressOffsetandaddressOffsetHexabsoluteAddressandabsoluteAddressHexresetValueandresetValueHexbitOffset,bitWidth, and derivedbitRange
This makes output easier to inspect in tools while preserving numeric utility.