Skip to content
This repository has been archived by the owner on Nov 5, 2019. It is now read-only.

Commit

Permalink
devices/support: update scripts to use xsvd
Browse files Browse the repository at this point in the history
  • Loading branch information
ilg-ul committed Apr 17, 2017
1 parent 56365b3 commit b1c74a7
Show file tree
Hide file tree
Showing 4 changed files with 117 additions and 118 deletions.
125 changes: 61 additions & 64 deletions gnuarmeclipse/devices/support/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,104 +48,107 @@ This property is added to peripherals that have multiple instances, like GPIOA,

It is used to correctly generate the support code.

## xsvd

The external tool used to process the SVD files is [`xsvd`](https://www.npmjs.com/package/xsvd).

## Devices

The commands used to generate the specifc xsvd files are:

### STM32F0x1

```
xcdl \
svd-convert \
xsvd convert \
--file "/Users/ilg/Library/xPacks/Keil/STM32F0xx_DFP/1.5.0/SVD/STM32F0x1.svd" \
--output "STM32F0x1-xsvd.json"
--output "STM32F0x1-xsvd.json" \
--verbose
xcdl \
svd-patch \
xsvd patch \
--file "STM32F0x1-xsvd.json" \
--patch "STM32F0x1-patch.json" \
--output "../STM32F0x1-qemu.json" \
--remove "NVIC"
--remove "NVIC" \
--verbose
xcdl \
svd-code \
--file "../STM32F0x1-qemu.json"
xsvd code \
--file "../STM32F0x1-qemu.json" \
--verbose
```

### STM32F0x2

```
xcdl \
svd-convert \
xsvd convert \
--file "/Users/ilg/Library/xPacks/Keil/STM32F0xx_DFP/1.5.0/SVD/STM32F0x2.svd" \
--output "STM32F0x2-xsvd.json"
--output "STM32F0x2-xsvd.json" \
--verbose
xcdl \
svd-patch \
xsvd patch \
--file "STM32F0x2-xsvd.json" \
--patch "STM32F0x2-patch.json" \
--output "../STM32F0x2-qemu.json" \
--remove "NVIC"
--remove "NVIC" \
--verbose
xcdl \
svd-code \
--file "../STM32F0x2-qemu.json"
xsvd code \
--file "../STM32F0x2-qemu.json" \
--verbose
```

### STM32F103xx

```
xcdl \
svd-convert \
xsvd convert \
--file "/Users/ilg/Library/xPacks/Keil/STM32F1xx_DFP/2.1.0/SVD/STM32F103xx.svd" \
--output "STM32F103xx-xsvd.json"
--output "STM32F103xx-xsvd.json" \
--verbose
xcdl \
svd-patch \
xsvd patch \
--file "STM32F103xx-xsvd.json" \
--patch "STM32F103xx-patch.json" \
--output "../STM32F103xx-qemu.json" \
--remove "NVIC"
--remove "NVIC" \
--verbose
xcdl \
svd-code \
--file "../STM32F103xx-qemu.json"
xsvd code \
--file "../STM32F103xx-qemu.json" \
--verbose
```

### STM32F107xx

```
xcdl \
svd-convert \
xsvd convert \
--file "/Users/ilg/Library/xPacks/Keil/STM32F1xx_DFP/2.1.0/SVD/STM32F107xx.svd" \
--output "STM32F107xx-xsvd.json"
--output "STM32F107xx-xsvd.json" \
--verbose
xcdl \
svd-patch \
xsvd patch \
--file "STM32F107xx-xsvd.json" \
--patch "STM32F107xx-patch.json" \
--output "../STM32F107xx-qemu.json" \
--remove "NVIC"
--remove "NVIC" \
--verbose
xcdl \
svd-code \
--file "../STM32F107xx-qemu.json"
xsvd code \
--file "../STM32F107xx-qemu.json" \
--verbose
```

### STM32F40x

```
xcdl \
svd-convert \
xsvd convert \
--file "/Users/ilg/Library/xPacks/Keil/STM32F4xx_DFP/2.9.0/CMSIS/SVD/STM32F40x.svd" \
--output "STM32F40x-xsvd.json"
--output "STM32F40x-xsvd.json" \
--verbose
xcdl \
svd-patch \
xsvd patch \
--file "STM32F40x-xsvd.json" \
--patch "STM32F40x-patch.json" \
--output "../STM32F40x-qemu.json" \
Expand All @@ -156,24 +159,24 @@ svd-patch \
--group-bitfield "RCC/PLLCFGR/PLLM" \
--group-bitfield "RCC/CFGR/SWS" \
--group-bitfield "RCC/CFGR/SW" \
--group-bitfield "RCC/BDCR/RTCSEL"
--group-bitfield "RCC/BDCR/RTCSEL" \
--verbose
xcdl \
svd-code \
--file "../STM32F40x-qemu.json"
xsvd code \
--file "../STM32F40x-qemu.json" \
--verbose
```

### STM32F411xx

```
xcdl \
svd-convert \
xsvd convert \
--file "/Users/ilg/Library/xPacks/Keil/STM32F4xx_DFP/2.9.0/CMSIS/SVD/STM32F411xx.svd" \
--output "STM32F411xx-xsvd.json"
--output "STM32F411xx-xsvd.json" \
--verbose
xcdl \
svd-patch \
xsvd patch \
--file "STM32F411xx-xsvd.json" \
--patch "STM32F411xx-patch.json" \
--output "../STM32F411xx-qemu.json" \
Expand All @@ -184,23 +187,24 @@ svd-patch \
--group-bitfield "RCC/PLLCFGR/PLLM" \
--group-bitfield "RCC/CFGR/SWS" \
--group-bitfield "RCC/CFGR/SW" \
--group-bitfield "RCC/BDCR/RTCSEL"
--group-bitfield "RCC/BDCR/RTCSEL" \
--verbose
xcdl \
svd-code \
--file "../STM32F411xx-qemu.json"
xsvd code \
--file "../STM32F411xx-qemu.json" \
--verbose
```

### STM32F429x

```
xcdl \
xsvd \
svd-convert \
--file "/Users/ilg/Library/xPacks/Keil/STM32F4xx_DFP/2.9.0/CMSIS/SVD/STM32F429x.svd" \
--output "STM32F429x-xsvd.json"
xcdl \
xsvd \
svd-patch \
--file "STM32F429x-xsvd.json" \
--patch "STM32F429x-patch.json" \
Expand All @@ -213,7 +217,7 @@ svd-patch \
--group-bitfield "RCC/CFGR/SW" \
--group-bitfield "RCC/BDCR/RTCSEL"
xcdl \
xsvd \
svd-code \
--file "../STM32F429x-qemu.json"
Expand All @@ -236,10 +240,3 @@ The location of the folder:
cd /Users/ilg/Work/qemu/gnuarmeclipse-qemu.git/gnuarmeclipse/devices/support
cd /Users/ilg/My\ Files/MacBookPro\ Projects/GNU\ ARM\ Eclipse/gnuarmeclipse-qemu.git/gnuarmeclipse/devices/support
```

Before installing a new `xcdl` version, run the development version with:

```
/Users/ilg/My\ Files/MacBookPro\ Projects/XCDL/xcdl-js.git/bin/xcdl \
```

37 changes: 19 additions & 18 deletions gnuarmeclipse/devices/support/code.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,33 +22,34 @@ IFS=$'\n\t'
cd "$(dirname "$0")"

echo
xcdl \
svd-code \
--file "../STM32F0x1-qemu.json"
xsvd code \
--file "../STM32F0x1-qemu.json" \
--verbose

echo
xcdl \
svd-code \
--file "../STM32F0x2-qemu.json"
xsvd code \
--file "../STM32F0x2-qemu.json" \
--verbose

echo
xcdl \
svd-code \
--file "../STM32F103xx-qemu.json"
xsvd code \
--file "../STM32F103xx-qemu.json" \
--verbose

xcdl \
svd-code \
--file "../STM32F107xx-qemu.json"
echo
xsvd code \
--file "../STM32F107xx-qemu.json" \
--verbose

echo
xcdl \
svd-code \
--file "../STM32F40x-qemu.json"
xsvd code \
--file "../STM32F40x-qemu.json" \
--verbose

echo
xcdl \
svd-code \
--file "../STM32F429x-qemu.json"
xsvd code \
--file "../STM32F429x-qemu.json" \
--verbose

echo

Expand Down
36 changes: 18 additions & 18 deletions gnuarmeclipse/devices/support/convert.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,39 +24,39 @@ cd "$(dirname "$0")"
XPACKS_FOLDER=${XPACKS_FOLDER:-"$HOME/Library/xPacks"}

echo
xcdl \
svd-convert \
xsvd convert \
--file "${XPACKS_FOLDER}/Keil/STM32F0xx_DFP/1.5.0/SVD/STM32F0x1.svd" \
--output "STM32F0x1-xsvd.json"
--output "STM32F0x1-xsvd.json" \
--verbose

echo
xcdl \
svd-convert \
xsvd convert \
--file "${XPACKS_FOLDER}/Keil/STM32F0xx_DFP/1.5.0/SVD/STM32F0x2.svd" \
--output "STM32F0x2-xsvd.json"
--output "STM32F0x2-xsvd.json" \
--verbose

echo
xcdl \
svd-convert \
xsvd convert \
--file "${XPACKS_FOLDER}/Keil/STM32F1xx_DFP/2.1.0/SVD/STM32F103xx.svd" \
--output "STM32F103xx-xsvd.json"
--output "STM32F103xx-xsvd.json" \
--verbose

echo
xcdl \
svd-convert \
xsvd convert \
--file "${XPACKS_FOLDER}/Keil/STM32F1xx_DFP/2.1.0/SVD/STM32F107xx.svd" \
--output "STM32F107xx-xsvd.json"
--output "STM32F107xx-xsvd.json" \
--verbose

echo
xcdl \
svd-convert \
xsvd convert \
--file "${XPACKS_FOLDER}/Keil/STM32F4xx_DFP/2.9.0/CMSIS/SVD/STM32F40x.svd" \
--output "STM32F40x-xsvd.json"
--output "STM32F40x-xsvd.json" \
--verbose

echo
xcdl \
svd-convert \
xsvd convert \
--file "${XPACKS_FOLDER}/Keil/STM32F4xx_DFP/2.9.0/CMSIS/SVD/STM32F429x.svd" \
--output "STM32F429x-xsvd.json"
--output "STM32F429x-xsvd.json" \
--verbose

echo
Loading

0 comments on commit b1c74a7

Please sign in to comment.