Merge pull request #70 from bobmcwhirter/memoryx
Include base addresses for flash and ram.
This commit is contained in:
commit
f8e3e7b5de
5
d
5
d
@ -18,6 +18,7 @@ case "$CMD" in
|
|||||||
./d download-svd
|
./d download-svd
|
||||||
./d download-headers
|
./d download-headers
|
||||||
./d download-cubedb
|
./d download-cubedb
|
||||||
|
./d download-cubeprogdb
|
||||||
;;
|
;;
|
||||||
download-mcufinder)
|
download-mcufinder)
|
||||||
mkdir -p sources/mcufinder
|
mkdir -p sources/mcufinder
|
||||||
@ -53,6 +54,10 @@ case "$CMD" in
|
|||||||
rm -rf sources/cubedb
|
rm -rf sources/cubedb
|
||||||
git clone --depth 1 https://github.com/embassy-rs/stm32cube-database.git sources/cubedb
|
git clone --depth 1 https://github.com/embassy-rs/stm32cube-database.git sources/cubedb
|
||||||
;;
|
;;
|
||||||
|
download-cubeprogdb)
|
||||||
|
rm -rf sources/cubeprogdb
|
||||||
|
git clone --depth 1 https://github.com/embassy-rs/stm32cubeprog-database.git sources/cubeprogdb
|
||||||
|
;;
|
||||||
install-chiptool)
|
install-chiptool)
|
||||||
cargo install --git https://github.com/embassy-rs/chiptool
|
cargo install --git https://github.com/embassy-rs/chiptool
|
||||||
;;
|
;;
|
||||||
|
702
data/memories.yaml
Normal file
702
data/memories.yaml
Normal file
@ -0,0 +1,702 @@
|
|||||||
|
- device-id: 0x410
|
||||||
|
names:
|
||||||
|
- STM32F101
|
||||||
|
- STM32F102
|
||||||
|
- STM32F103
|
||||||
|
ram:
|
||||||
|
address: 0x20000000
|
||||||
|
bytes: 0x5000
|
||||||
|
flash:
|
||||||
|
address: 0x8000000
|
||||||
|
bytes: 0x20000
|
||||||
|
- device-id: 0x411
|
||||||
|
names:
|
||||||
|
- STM32F2xx
|
||||||
|
ram:
|
||||||
|
address: 0x20000000
|
||||||
|
bytes: 0x20000
|
||||||
|
flash:
|
||||||
|
address: 0x8000000
|
||||||
|
bytes: 0x100000
|
||||||
|
- device-id: 0x412
|
||||||
|
names:
|
||||||
|
- STM32F101
|
||||||
|
- STM32F102
|
||||||
|
- STM32F103
|
||||||
|
ram:
|
||||||
|
address: 0x20000000
|
||||||
|
bytes: 0x2800
|
||||||
|
flash:
|
||||||
|
address: 0x8000000
|
||||||
|
bytes: 0x8000
|
||||||
|
- device-id: 0x413
|
||||||
|
names:
|
||||||
|
- STM32F405xx
|
||||||
|
- STM32F407xx
|
||||||
|
- STM32F415xx
|
||||||
|
- STM32F417xx
|
||||||
|
ram:
|
||||||
|
address: 0x20000000
|
||||||
|
bytes: 0x20000
|
||||||
|
flash:
|
||||||
|
address: 0x8000000
|
||||||
|
bytes: 0x100000
|
||||||
|
- device-id: 0x414
|
||||||
|
names:
|
||||||
|
- STM32F101
|
||||||
|
- STM32F103
|
||||||
|
ram:
|
||||||
|
address: 0x20000000
|
||||||
|
bytes: 0x10000
|
||||||
|
flash:
|
||||||
|
address: 0x8000000
|
||||||
|
bytes: 0x80000
|
||||||
|
- device-id: 0x415
|
||||||
|
names:
|
||||||
|
- STM32L4x1
|
||||||
|
- STM32L475xx
|
||||||
|
- STM32L476xx
|
||||||
|
- STM32L486xx
|
||||||
|
ram:
|
||||||
|
address: 0x20000000
|
||||||
|
bytes: 0x18000
|
||||||
|
flash:
|
||||||
|
address: 0x8000000
|
||||||
|
bytes: 0x100000
|
||||||
|
- device-id: 0x416
|
||||||
|
names:
|
||||||
|
- STM32L100x8
|
||||||
|
- STM32L100xB
|
||||||
|
- STM32L15xx6
|
||||||
|
- STM32L15xx8
|
||||||
|
- STM32L15xxB
|
||||||
|
ram:
|
||||||
|
address: 0x20000000
|
||||||
|
bytes: 0x2800
|
||||||
|
flash:
|
||||||
|
address: 0x8000000
|
||||||
|
bytes: 0x20000
|
||||||
|
- device-id: 0x417
|
||||||
|
names:
|
||||||
|
- STM32L05x
|
||||||
|
- STM32L06x
|
||||||
|
- STM32L010
|
||||||
|
ram:
|
||||||
|
address: 0x20000000
|
||||||
|
bytes: 0x2000
|
||||||
|
flash:
|
||||||
|
address: 0x8000000
|
||||||
|
bytes: 0x10000
|
||||||
|
- device-id: 0x418
|
||||||
|
names:
|
||||||
|
- STM32F105
|
||||||
|
- STM32F107
|
||||||
|
ram:
|
||||||
|
address: 0x20000000
|
||||||
|
bytes: 0x10000
|
||||||
|
flash:
|
||||||
|
address: 0x8000000
|
||||||
|
bytes: 0x40000
|
||||||
|
- device-id: 0x419
|
||||||
|
names:
|
||||||
|
- STM32F42xxx
|
||||||
|
- STM32F43xxx
|
||||||
|
ram:
|
||||||
|
address: 0x20000000
|
||||||
|
bytes: 0x30000
|
||||||
|
flash:
|
||||||
|
address: 0x8000000
|
||||||
|
bytes: 0x200000
|
||||||
|
- device-id: 0x420
|
||||||
|
names:
|
||||||
|
- STM32F100
|
||||||
|
- STMMedium
|
||||||
|
ram:
|
||||||
|
address: 0x20000000
|
||||||
|
bytes: 0x2000
|
||||||
|
flash:
|
||||||
|
address: 0x8000000
|
||||||
|
bytes: 0x20000
|
||||||
|
- device-id: 0x421
|
||||||
|
names:
|
||||||
|
- STM32F446xx
|
||||||
|
ram:
|
||||||
|
address: 0x20000000
|
||||||
|
bytes: 0x20000
|
||||||
|
flash:
|
||||||
|
address: 0x8000000
|
||||||
|
bytes: 0x80000
|
||||||
|
- device-id: 0x422
|
||||||
|
names:
|
||||||
|
- STM32F302xB
|
||||||
|
- STM32F302xC
|
||||||
|
- STM32F303xB
|
||||||
|
- STM32F303xC
|
||||||
|
- STM32F358xx
|
||||||
|
ram:
|
||||||
|
address: 0x20000000
|
||||||
|
bytes: 0xa000
|
||||||
|
flash:
|
||||||
|
address: 0x8000000
|
||||||
|
bytes: 0x40000
|
||||||
|
- device-id: 0x423
|
||||||
|
names:
|
||||||
|
- STM32F401xB
|
||||||
|
- STM32F401xC
|
||||||
|
ram:
|
||||||
|
address: 0x20000000
|
||||||
|
bytes: 0x10000
|
||||||
|
flash:
|
||||||
|
address: 0x8000000
|
||||||
|
bytes: 0x40000
|
||||||
|
- device-id: 0x425
|
||||||
|
names:
|
||||||
|
- STM32L03x
|
||||||
|
- STM32L04x
|
||||||
|
- STM32L010
|
||||||
|
ram:
|
||||||
|
address: 0x20000000
|
||||||
|
bytes: 0x2000
|
||||||
|
flash:
|
||||||
|
address: 0x8000000
|
||||||
|
bytes: 0x8000
|
||||||
|
- device-id: 0x427
|
||||||
|
names:
|
||||||
|
- STM32L100xC
|
||||||
|
- STM32L15xxC
|
||||||
|
- STM32L162xC
|
||||||
|
ram:
|
||||||
|
address: 0x20000000
|
||||||
|
bytes: 0x8000
|
||||||
|
flash:
|
||||||
|
address: 0x8000000
|
||||||
|
bytes: 0x40000
|
||||||
|
- device-id: 0x428
|
||||||
|
names:
|
||||||
|
- STM32F100
|
||||||
|
ram:
|
||||||
|
address: 0x20000000
|
||||||
|
bytes: 0x8000
|
||||||
|
flash:
|
||||||
|
address: 0x8000000
|
||||||
|
bytes: 0x80000
|
||||||
|
- device-id: 0x429
|
||||||
|
names:
|
||||||
|
- STM32L100x6xxA
|
||||||
|
- STM32L100x8xxA
|
||||||
|
- STM32L100xBxxA
|
||||||
|
- STM32L15xx6xxA
|
||||||
|
- STM32L15xx8xxA
|
||||||
|
- STM32L15xxBxxA
|
||||||
|
ram:
|
||||||
|
address: 0x20000000
|
||||||
|
bytes: 0x4000
|
||||||
|
flash:
|
||||||
|
address: 0x8000000
|
||||||
|
bytes: 0x20000
|
||||||
|
- device-id: 0x430
|
||||||
|
names:
|
||||||
|
- STM32F101
|
||||||
|
- STM32F103
|
||||||
|
ram:
|
||||||
|
address: 0x20000000
|
||||||
|
bytes: 0x18000
|
||||||
|
flash:
|
||||||
|
address: 0x8000000
|
||||||
|
bytes: 0x100000
|
||||||
|
- device-id: 0x431
|
||||||
|
names:
|
||||||
|
- STM32F411xC
|
||||||
|
- STM32F411xE
|
||||||
|
ram:
|
||||||
|
address: 0x20000000
|
||||||
|
bytes: 0x10000
|
||||||
|
flash:
|
||||||
|
address: 0x8000000
|
||||||
|
bytes: 0x80000
|
||||||
|
- device-id: 0x432
|
||||||
|
names:
|
||||||
|
- STM32F37xx
|
||||||
|
ram:
|
||||||
|
address: 0x20000000
|
||||||
|
bytes: 0x8000
|
||||||
|
flash:
|
||||||
|
address: 0x8000000
|
||||||
|
bytes: 0x40000
|
||||||
|
- device-id: 0x433
|
||||||
|
names:
|
||||||
|
- STM32F401xD
|
||||||
|
- STM32F401xE
|
||||||
|
ram:
|
||||||
|
address: 0x20000000
|
||||||
|
bytes: 0x10000
|
||||||
|
flash:
|
||||||
|
address: 0x8000000
|
||||||
|
bytes: 0x800000
|
||||||
|
- device-id: 0x434
|
||||||
|
names:
|
||||||
|
- STM32F469xx
|
||||||
|
- STM32F467xx
|
||||||
|
ram:
|
||||||
|
address: 0x20000000
|
||||||
|
bytes: 0x50000
|
||||||
|
flash:
|
||||||
|
address: 0x8000000
|
||||||
|
bytes: 0x200000
|
||||||
|
- device-id: 0x435
|
||||||
|
names:
|
||||||
|
- STM32L43xxx
|
||||||
|
- STM32L44xxx
|
||||||
|
ram:
|
||||||
|
address: 0x20000000
|
||||||
|
bytes: 0xc000
|
||||||
|
flash:
|
||||||
|
address: 0x8000000
|
||||||
|
bytes: 0x80000
|
||||||
|
- device-id: 0x436
|
||||||
|
names:
|
||||||
|
- STM32L15xxD
|
||||||
|
- STM32L162xD
|
||||||
|
ram:
|
||||||
|
address: 0x20000000
|
||||||
|
bytes: 0xc000
|
||||||
|
flash:
|
||||||
|
address: 0x8000000
|
||||||
|
bytes: 0x20000
|
||||||
|
- device-id: 0x437
|
||||||
|
names:
|
||||||
|
- STM32L15xxE
|
||||||
|
- STM32L162xE
|
||||||
|
ram:
|
||||||
|
address: 0x20000000
|
||||||
|
bytes: 0x14000
|
||||||
|
flash:
|
||||||
|
address: 0x8000000
|
||||||
|
bytes: 0x80000
|
||||||
|
- device-id: 0x438
|
||||||
|
names:
|
||||||
|
- STM32F303x4
|
||||||
|
- STM32F303x6
|
||||||
|
- STM32F303x8
|
||||||
|
- STM32F328xx
|
||||||
|
- STM32F334xx
|
||||||
|
ram:
|
||||||
|
address: 0x20000000
|
||||||
|
bytes: 0x3000
|
||||||
|
flash:
|
||||||
|
address: 0x8000000
|
||||||
|
bytes: 0x10000
|
||||||
|
- device-id: 0x439
|
||||||
|
names:
|
||||||
|
- STM32F301x4
|
||||||
|
- STM32F301x6
|
||||||
|
- STM32F301x8
|
||||||
|
- STM32F302x4
|
||||||
|
- STM32F302x6
|
||||||
|
- STM32F302x8
|
||||||
|
- STM32F318xx
|
||||||
|
ram:
|
||||||
|
address: 0x20000000
|
||||||
|
bytes: 0x4000
|
||||||
|
flash:
|
||||||
|
address: 0x8000000
|
||||||
|
bytes: 0x10000
|
||||||
|
- device-id: 0x440
|
||||||
|
names:
|
||||||
|
- STM32F05x
|
||||||
|
- STM32F030x8
|
||||||
|
ram:
|
||||||
|
address: 0x20000000
|
||||||
|
bytes: 0x1ff8
|
||||||
|
flash:
|
||||||
|
address: 0x8000000
|
||||||
|
bytes: 0x10000
|
||||||
|
- device-id: 0x441
|
||||||
|
names:
|
||||||
|
- STM32F412
|
||||||
|
ram:
|
||||||
|
address: 0x20000000
|
||||||
|
bytes: 0x40000
|
||||||
|
flash:
|
||||||
|
address: 0x8000000
|
||||||
|
bytes: 0x100000
|
||||||
|
- device-id: 0x442
|
||||||
|
names:
|
||||||
|
- STM32F09x
|
||||||
|
- STM32F030xC
|
||||||
|
ram:
|
||||||
|
address: 0x20000000
|
||||||
|
bytes: 0x8000
|
||||||
|
flash:
|
||||||
|
address: 0x8000000
|
||||||
|
bytes: 0x40000
|
||||||
|
- device-id: 0x443
|
||||||
|
names:
|
||||||
|
- STM32C01x
|
||||||
|
ram:
|
||||||
|
address: 0x20000000
|
||||||
|
bytes: 0x1800
|
||||||
|
flash:
|
||||||
|
address: 0x8000000
|
||||||
|
bytes: 0x8000
|
||||||
|
- device-id: 0x444
|
||||||
|
names:
|
||||||
|
- STM32F03x
|
||||||
|
ram:
|
||||||
|
address: 0x20000000
|
||||||
|
bytes: 0x1000
|
||||||
|
flash:
|
||||||
|
address: 0x8000000
|
||||||
|
bytes: 0x8000
|
||||||
|
- device-id: 0x445
|
||||||
|
names:
|
||||||
|
- STM32F04x
|
||||||
|
- STM32F070x6
|
||||||
|
ram:
|
||||||
|
address: 0x20000000
|
||||||
|
bytes: 0x1800
|
||||||
|
flash:
|
||||||
|
address: 0x8000000
|
||||||
|
bytes: 0x8000
|
||||||
|
- device-id: 0x446
|
||||||
|
names:
|
||||||
|
- STM32F302xE
|
||||||
|
- STM32F303xE
|
||||||
|
- STM32F398xx
|
||||||
|
ram:
|
||||||
|
address: 0x20000000
|
||||||
|
bytes: 0x10000
|
||||||
|
flash:
|
||||||
|
address: 0x8000000
|
||||||
|
bytes: 0x80000
|
||||||
|
- device-id: 0x447
|
||||||
|
names:
|
||||||
|
- STM32L07x
|
||||||
|
- STM32L08x
|
||||||
|
- STM32L010
|
||||||
|
ram:
|
||||||
|
address: 0x20000000
|
||||||
|
bytes: 0x5000
|
||||||
|
flash:
|
||||||
|
address: 0x8000000
|
||||||
|
bytes: 0x20000
|
||||||
|
- device-id: 0x448
|
||||||
|
names:
|
||||||
|
- STM32F07x
|
||||||
|
ram:
|
||||||
|
address: 0x20000000
|
||||||
|
bytes: 0x4000
|
||||||
|
flash:
|
||||||
|
address: 0x8000000
|
||||||
|
bytes: 0x20000
|
||||||
|
- device-id: 0x449
|
||||||
|
names:
|
||||||
|
- STM32F74x
|
||||||
|
- STM32F75x
|
||||||
|
ram:
|
||||||
|
address: 0x20000000
|
||||||
|
bytes: 0x50000
|
||||||
|
flash:
|
||||||
|
address: 0x8000000
|
||||||
|
bytes: 0x100000
|
||||||
|
- device-id: 0x450
|
||||||
|
names:
|
||||||
|
- STM32H7xx
|
||||||
|
ram:
|
||||||
|
address: 0x24000000
|
||||||
|
bytes: 0x80000
|
||||||
|
flash:
|
||||||
|
address: 0x8000000
|
||||||
|
bytes: 0x200000
|
||||||
|
- device-id: 0x451
|
||||||
|
names:
|
||||||
|
- STM32F76x
|
||||||
|
- STM32F77x
|
||||||
|
ram:
|
||||||
|
address: 0x20000000
|
||||||
|
bytes: 0x80000
|
||||||
|
flash:
|
||||||
|
address: 0x8000000
|
||||||
|
bytes: 0x200000
|
||||||
|
- device-id: 0x452
|
||||||
|
names:
|
||||||
|
- STM32F72x
|
||||||
|
- STM32F73x
|
||||||
|
ram:
|
||||||
|
address: 0x20000000
|
||||||
|
bytes: 0x40000
|
||||||
|
flash:
|
||||||
|
address: 0x8000000
|
||||||
|
bytes: 0x80000
|
||||||
|
- device-id: 0x453
|
||||||
|
names:
|
||||||
|
- STM32C0
|
||||||
|
ram:
|
||||||
|
address: 0x20000000
|
||||||
|
bytes: 0x1800
|
||||||
|
flash:
|
||||||
|
address: 0x8000000
|
||||||
|
bytes: 0x8000
|
||||||
|
- device-id: 0x456
|
||||||
|
names:
|
||||||
|
- STM32G051
|
||||||
|
- STM32G061
|
||||||
|
ram:
|
||||||
|
address: 0x20000000
|
||||||
|
bytes: 0x4000
|
||||||
|
flash:
|
||||||
|
address: 0x8000000
|
||||||
|
bytes: 0x10000
|
||||||
|
- device-id: 0x457
|
||||||
|
names:
|
||||||
|
- STM32L01x
|
||||||
|
- STM32L02x
|
||||||
|
ram:
|
||||||
|
address: 0x20000000
|
||||||
|
bytes: 0x800
|
||||||
|
flash:
|
||||||
|
address: 0x8000000
|
||||||
|
bytes: 0x4000
|
||||||
|
- device-id: 0x458
|
||||||
|
names:
|
||||||
|
- STM32F410
|
||||||
|
ram:
|
||||||
|
address: 0x20000000
|
||||||
|
bytes: 0x8000
|
||||||
|
flash:
|
||||||
|
address: 0x8000000
|
||||||
|
bytes: 0x20000
|
||||||
|
- device-id: 0x460
|
||||||
|
names:
|
||||||
|
- STM32G07x
|
||||||
|
- STM32G08x
|
||||||
|
ram:
|
||||||
|
address: 0x20000000
|
||||||
|
bytes: 0x8000
|
||||||
|
flash:
|
||||||
|
address: 0x8000000
|
||||||
|
bytes: 0x20000
|
||||||
|
- device-id: 0x461
|
||||||
|
names:
|
||||||
|
- STM32L496xx
|
||||||
|
- STM32L4A6xx
|
||||||
|
ram:
|
||||||
|
address: 0x20000000
|
||||||
|
bytes: 0x40000
|
||||||
|
flash:
|
||||||
|
address: 0x8000000
|
||||||
|
bytes: 0x100000
|
||||||
|
- device-id: 0x462
|
||||||
|
names:
|
||||||
|
- STM32L45x
|
||||||
|
- STM32L46x
|
||||||
|
ram:
|
||||||
|
address: 0x20000000
|
||||||
|
bytes: 0x20000
|
||||||
|
flash:
|
||||||
|
address: 0x8000000
|
||||||
|
bytes: 0x80000
|
||||||
|
- device-id: 0x463
|
||||||
|
names:
|
||||||
|
- STM32F413
|
||||||
|
- STM32F423
|
||||||
|
ram:
|
||||||
|
address: 0x20000000
|
||||||
|
bytes: 0x50000
|
||||||
|
flash:
|
||||||
|
address: 0x8000000
|
||||||
|
bytes: 0x180000
|
||||||
|
- device-id: 0x464
|
||||||
|
names:
|
||||||
|
- STM32L41x
|
||||||
|
ram:
|
||||||
|
address: 0x20000000
|
||||||
|
bytes: 0xa000
|
||||||
|
flash:
|
||||||
|
address: 0x8000000
|
||||||
|
bytes: 0x20000
|
||||||
|
- device-id: 0x466
|
||||||
|
names:
|
||||||
|
- STM32G03x
|
||||||
|
- STM32G04x
|
||||||
|
ram:
|
||||||
|
address: 0x20000000
|
||||||
|
bytes: 0x2000
|
||||||
|
flash:
|
||||||
|
address: 0x8000000
|
||||||
|
bytes: 0x10000
|
||||||
|
- device-id: 0x467
|
||||||
|
names:
|
||||||
|
- STM32G0B1xx
|
||||||
|
- STM32G0C1xx
|
||||||
|
ram:
|
||||||
|
address: 0x20000000
|
||||||
|
bytes: 0x20000
|
||||||
|
flash:
|
||||||
|
address: 0x8000000
|
||||||
|
bytes: 0x80000
|
||||||
|
- device-id: 0x468
|
||||||
|
names:
|
||||||
|
- STM32G43x
|
||||||
|
- STM32G44x
|
||||||
|
ram:
|
||||||
|
address: 0x20000000
|
||||||
|
bytes: 0x5000
|
||||||
|
flash:
|
||||||
|
address: 0x8000000
|
||||||
|
bytes: 0x20000
|
||||||
|
- device-id: 0x469
|
||||||
|
names:
|
||||||
|
- STM32G47x
|
||||||
|
- STM32G48x
|
||||||
|
ram:
|
||||||
|
address: 0x20000000
|
||||||
|
bytes: 0x18000
|
||||||
|
flash:
|
||||||
|
address: 0x8000000
|
||||||
|
bytes: 0x80000
|
||||||
|
- device-id: 0x470
|
||||||
|
names:
|
||||||
|
- STM32L4Rxxx
|
||||||
|
- STM32L4Sxxx
|
||||||
|
ram:
|
||||||
|
address: 0x20000000
|
||||||
|
bytes: 0x30000
|
||||||
|
flash:
|
||||||
|
address: 0x8000000
|
||||||
|
bytes: 0x200000
|
||||||
|
- device-id: 0x471
|
||||||
|
names:
|
||||||
|
- STM32L4Pxxx
|
||||||
|
- STM32L4Qxxx
|
||||||
|
ram:
|
||||||
|
address: 0x20000000
|
||||||
|
bytes: 0x30000
|
||||||
|
flash:
|
||||||
|
address: 0x8000000
|
||||||
|
bytes: 0x100000
|
||||||
|
- device-id: 0x472
|
||||||
|
names:
|
||||||
|
- STM32L5xx
|
||||||
|
ram:
|
||||||
|
address: 0x20000000
|
||||||
|
bytes: 0x40000
|
||||||
|
flash:
|
||||||
|
address: 0x8000000
|
||||||
|
bytes: 0x80000
|
||||||
|
- device-id: 0x479
|
||||||
|
names:
|
||||||
|
- STM32G491xC
|
||||||
|
- STM32G491xE
|
||||||
|
ram:
|
||||||
|
address: 0x20000000
|
||||||
|
bytes: 0x8000
|
||||||
|
flash:
|
||||||
|
address: 0x8000000
|
||||||
|
bytes: 0x80000
|
||||||
|
- device-id: 0x480
|
||||||
|
names:
|
||||||
|
- STM32H7A
|
||||||
|
- STM32H7B
|
||||||
|
ram:
|
||||||
|
address: 0x24000000
|
||||||
|
bytes: 0x100000
|
||||||
|
flash:
|
||||||
|
address: 0x8000000
|
||||||
|
bytes: 0x200000
|
||||||
|
- device-id: 0x481
|
||||||
|
names:
|
||||||
|
- STM32U5xx
|
||||||
|
ram:
|
||||||
|
address: 0x20000000
|
||||||
|
bytes: 0x8000
|
||||||
|
flash:
|
||||||
|
address: 0x8000000
|
||||||
|
bytes: 0x400000
|
||||||
|
- device-id: 0x482
|
||||||
|
names:
|
||||||
|
- STM32U575
|
||||||
|
- STM32U585
|
||||||
|
ram:
|
||||||
|
address: 0x20000000
|
||||||
|
bytes: 0xc0000
|
||||||
|
flash:
|
||||||
|
address: 0x8000000
|
||||||
|
bytes: 0x200000
|
||||||
|
- device-id: 0x483
|
||||||
|
names:
|
||||||
|
- STM32H72x
|
||||||
|
- STM32H73x
|
||||||
|
ram:
|
||||||
|
address: 0x24000000
|
||||||
|
bytes: 0x20000
|
||||||
|
flash:
|
||||||
|
address: 0x8000000
|
||||||
|
bytes: 0x100000
|
||||||
|
- device-id: 0x484
|
||||||
|
names:
|
||||||
|
- STM32H5xx
|
||||||
|
ram:
|
||||||
|
address: 0x20000000
|
||||||
|
bytes: 0x40000
|
||||||
|
flash:
|
||||||
|
address: 0x8000000
|
||||||
|
bytes: 0x200000
|
||||||
|
- device-id: 0x492
|
||||||
|
names:
|
||||||
|
- STM32WBA55
|
||||||
|
- STM32WBA54
|
||||||
|
ram:
|
||||||
|
address: 0x20000000
|
||||||
|
bytes: 0x10000
|
||||||
|
flash:
|
||||||
|
address: 0x8000000
|
||||||
|
bytes: 0x100000
|
||||||
|
- device-id: 0x494
|
||||||
|
names:
|
||||||
|
- STM32WB1xxx
|
||||||
|
ram:
|
||||||
|
address: 0x20000000
|
||||||
|
bytes: 0x3000
|
||||||
|
flash:
|
||||||
|
address: 0x8000000
|
||||||
|
bytes: 0x50000
|
||||||
|
- device-id: 0x495
|
||||||
|
names:
|
||||||
|
- STM32WB5x
|
||||||
|
ram:
|
||||||
|
address: 0x20000000
|
||||||
|
bytes: 0x30000
|
||||||
|
flash:
|
||||||
|
address: 0x8000000
|
||||||
|
bytes: 0x100000
|
||||||
|
- device-id: 0x496
|
||||||
|
names:
|
||||||
|
- STM32WB35xx
|
||||||
|
ram:
|
||||||
|
address: 0x20000000
|
||||||
|
bytes: 0x8000
|
||||||
|
flash:
|
||||||
|
address: 0x8000000
|
||||||
|
bytes: 0x80000
|
||||||
|
- device-id: 0x497
|
||||||
|
names:
|
||||||
|
- STM32WLxx
|
||||||
|
ram:
|
||||||
|
address: 0x20000000
|
||||||
|
bytes: 0x3000
|
||||||
|
flash:
|
||||||
|
address: 0x8000000
|
||||||
|
bytes: 0x40000
|
||||||
|
- device-id: 0x500
|
||||||
|
names:
|
||||||
|
- STM32MP1
|
||||||
|
ram:
|
||||||
|
address: 0x10000000
|
||||||
|
bytes: 0x20000
|
||||||
|
- device-id: 0x501
|
||||||
|
names:
|
||||||
|
- STM32MP13xx
|
||||||
|
ram:
|
||||||
|
address: 0x10000000
|
||||||
|
bytes: 0x20000
|
159
parse.py
159
parse.py
@ -3,6 +3,7 @@
|
|||||||
import sys
|
import sys
|
||||||
import xmltodict
|
import xmltodict
|
||||||
import yaml
|
import yaml
|
||||||
|
|
||||||
try:
|
try:
|
||||||
from yaml import CSafeLoader as SafeLoader
|
from yaml import CSafeLoader as SafeLoader
|
||||||
except ImportError:
|
except ImportError:
|
||||||
@ -15,6 +16,30 @@ from collections import OrderedDict
|
|||||||
from glob import glob
|
from glob import glob
|
||||||
|
|
||||||
|
|
||||||
|
class DecimalInt:
|
||||||
|
def __init__(self, val):
|
||||||
|
self.val = val
|
||||||
|
|
||||||
|
|
||||||
|
def represent_decimal_int(dumper, data):
|
||||||
|
return dumper.represent_int(data.val)
|
||||||
|
|
||||||
|
|
||||||
|
yaml.add_representer(DecimalInt, represent_decimal_int)
|
||||||
|
|
||||||
|
|
||||||
|
class HexInt:
|
||||||
|
def __init__(self, val):
|
||||||
|
self.val = val
|
||||||
|
|
||||||
|
|
||||||
|
def represent_hex_int(dumper, data):
|
||||||
|
return dumper.represent_int(hex(data.val))
|
||||||
|
|
||||||
|
|
||||||
|
yaml.add_representer(HexInt, represent_hex_int)
|
||||||
|
|
||||||
|
|
||||||
def removeprefix(value: str, prefix: str, /) -> str:
|
def removeprefix(value: str, prefix: str, /) -> str:
|
||||||
if value.startswith(prefix):
|
if value.startswith(prefix):
|
||||||
return value[len(prefix):]
|
return value[len(prefix):]
|
||||||
@ -112,6 +137,7 @@ def paren_ok(val):
|
|||||||
return False
|
return False
|
||||||
return n == 0
|
return n == 0
|
||||||
|
|
||||||
|
|
||||||
# warning: horrible abomination ahead
|
# warning: horrible abomination ahead
|
||||||
|
|
||||||
|
|
||||||
@ -468,6 +494,24 @@ def chip_name_from_package_name(x):
|
|||||||
raise Exception("bad name: {}".format(x))
|
raise Exception("bad name: {}".format(x))
|
||||||
|
|
||||||
|
|
||||||
|
memories_map = {
|
||||||
|
'flash': [
|
||||||
|
'FLASH', 'FLASH_BANK1', 'FLASH_BANK2',
|
||||||
|
'D1_AXIFLASH', 'D1_AXIICP',
|
||||||
|
],
|
||||||
|
'ram': [
|
||||||
|
'SRAM', 'SRAM1', 'SRAM2',
|
||||||
|
'D1_AXISRAM',
|
||||||
|
'D1_ITCMRAM',
|
||||||
|
'D1_DTCMRAM',
|
||||||
|
'D1_AHBSRAM',
|
||||||
|
'D2_AXISRAM',
|
||||||
|
'D3_BKPSRAM',
|
||||||
|
'D3_SRAM'
|
||||||
|
],
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
def parse_chips():
|
def parse_chips():
|
||||||
os.makedirs('data/chips', exist_ok=True)
|
os.makedirs('data/chips', exist_ok=True)
|
||||||
|
|
||||||
@ -493,8 +537,14 @@ def parse_chips():
|
|||||||
package_flashs = [package_flashs] * len(package_names)
|
package_flashs = [package_flashs] * len(package_names)
|
||||||
for package_i, package_name in enumerate(package_names):
|
for package_i, package_name in enumerate(package_names):
|
||||||
chip_name = chip_name_from_package_name(package_name)
|
chip_name = chip_name_from_package_name(package_name)
|
||||||
flash = int(package_flashs[package_i])
|
flash = OrderedDict({
|
||||||
ram = int(package_rams[package_i])
|
'bytes': DecimalInt(int(package_flashs[package_i]) * 1024),
|
||||||
|
'regions': {},
|
||||||
|
})
|
||||||
|
ram = OrderedDict({
|
||||||
|
'bytes': DecimalInt(int(package_rams[package_i]) * 1024),
|
||||||
|
'regions': {},
|
||||||
|
})
|
||||||
gpio_af = next(filter(lambda x: x['@Name'] == 'GPIO', r['IP']))['@Version']
|
gpio_af = next(filter(lambda x: x['@Name'] == 'GPIO', r['IP']))['@Version']
|
||||||
gpio_af = removesuffix(gpio_af, '_gpio_v1_0')
|
gpio_af = removesuffix(gpio_af, '_gpio_v1_0')
|
||||||
|
|
||||||
@ -541,6 +591,7 @@ def parse_chips():
|
|||||||
'family': family,
|
'family': family,
|
||||||
'line': r['@Line'],
|
'line': r['@Line'],
|
||||||
'die': die,
|
'die': die,
|
||||||
|
'device-id': None,
|
||||||
'packages': [],
|
'packages': [],
|
||||||
'datasheet': None,
|
'datasheet': None,
|
||||||
'reference-manual': None,
|
'reference-manual': None,
|
||||||
@ -568,6 +619,11 @@ def parse_chips():
|
|||||||
chips[chip_name]['reference-manual'] = rm[0]
|
chips[chip_name]['reference-manual'] = rm[0]
|
||||||
chips[chip_name]['application-notes'] = documents_for(chip_name, 'Application note')
|
chips[chip_name]['application-notes'] = documents_for(chip_name, 'Application note')
|
||||||
|
|
||||||
|
if 'datasheet' in chips[chip_name] and chips[chip_name]['datasheet'] is None:
|
||||||
|
del chips[chip_name]['datasheet']
|
||||||
|
if 'reference-manual' in chips[chip_name] and chips[chip_name]['reference-manual'] is None:
|
||||||
|
del chips[chip_name]['reference-manual']
|
||||||
|
|
||||||
# Some packages have some peripehrals removed because the package had to
|
# Some packages have some peripehrals removed because the package had to
|
||||||
# remove GPIOs useful for that peripheral. So we merge all peripherals from all packages.
|
# remove GPIOs useful for that peripheral. So we merge all peripherals from all packages.
|
||||||
peris = chips[chip_name]['peripherals']
|
peris = chips[chip_name]['peripherals']
|
||||||
@ -637,11 +693,71 @@ def parse_chips():
|
|||||||
chip_nvic = chip['nvic']
|
chip_nvic = chip['nvic']
|
||||||
del chip['nvic']
|
del chip['nvic']
|
||||||
|
|
||||||
|
device_id = determine_device_id(chip_name)
|
||||||
|
if device_id is not None:
|
||||||
|
chip['device-id'] = HexInt(device_id)
|
||||||
|
else:
|
||||||
|
del chip['device-id']
|
||||||
|
|
||||||
h = find_header(chip_name)
|
h = find_header(chip_name)
|
||||||
if h is None:
|
if h is None:
|
||||||
raise Exception("missing header for {}".format(chip_name))
|
raise Exception("missing header for {}".format(chip_name))
|
||||||
h = headers_parsed[h]
|
h = headers_parsed[h]
|
||||||
|
|
||||||
|
found = []
|
||||||
|
|
||||||
|
for each in memories_map['flash']:
|
||||||
|
if each + '_BASE' in h['defines']['all']:
|
||||||
|
if each == 'FLASH':
|
||||||
|
key = 'BANK_1'
|
||||||
|
elif each == 'FLASH_BANK1':
|
||||||
|
key = 'BANK_1'
|
||||||
|
elif each == 'FLASH_BANK2':
|
||||||
|
key = 'BANK_2'
|
||||||
|
else:
|
||||||
|
key = each
|
||||||
|
|
||||||
|
if key in found:
|
||||||
|
continue
|
||||||
|
|
||||||
|
found.append(key)
|
||||||
|
|
||||||
|
chip['flash']['regions'][key] = OrderedDict( {
|
||||||
|
'base': HexInt(h['defines']['all'][each + '_BASE'])
|
||||||
|
} )
|
||||||
|
|
||||||
|
if key == 'BANK_1' or key == 'BANK_2':
|
||||||
|
flash_size = determine_flash_size(chip_name)
|
||||||
|
if flash_size is not None:
|
||||||
|
if flash_size > chip['flash']['bytes'].val:
|
||||||
|
flash_size = chip['flash']['bytes'].val
|
||||||
|
chip['flash']['regions'][key]['bytes'] = DecimalInt(flash_size)
|
||||||
|
|
||||||
|
found = []
|
||||||
|
|
||||||
|
for each in memories_map['ram']:
|
||||||
|
if each + '_BASE' in h['defines']['all']:
|
||||||
|
if each == 'D1_AXISRAM':
|
||||||
|
key = 'SRAM'
|
||||||
|
elif each == 'SRAM1':
|
||||||
|
key = 'SRAM'
|
||||||
|
else:
|
||||||
|
key = each
|
||||||
|
|
||||||
|
if key in found:
|
||||||
|
continue
|
||||||
|
|
||||||
|
found.append(key)
|
||||||
|
|
||||||
|
chip['ram']['regions'][key] = OrderedDict( {
|
||||||
|
'base': HexInt(h['defines']['all'][each + '_BASE'])
|
||||||
|
} )
|
||||||
|
|
||||||
|
if key == 'SRAM':
|
||||||
|
ram_size = determine_ram_size(chip_name)
|
||||||
|
if ram_size is not None:
|
||||||
|
chip['ram']['regions'][key]['bytes'] = DecimalInt(ram_size)
|
||||||
|
|
||||||
# print("Got", len(chip['cores']), "cores")
|
# print("Got", len(chip['cores']), "cores")
|
||||||
for core in chip['cores']:
|
for core in chip['cores']:
|
||||||
core_name = core['name']
|
core_name = core['name']
|
||||||
@ -832,7 +948,6 @@ def parse_chips():
|
|||||||
# Process peripheral - DMA channel associations
|
# Process peripheral - DMA channel associations
|
||||||
for pname, p in peris.items():
|
for pname, p in peris.items():
|
||||||
if (peri_chs := dma_channels[chip_dma]['peripherals'].get(pname)) is not None:
|
if (peri_chs := dma_channels[chip_dma]['peripherals'].get(pname)) is not None:
|
||||||
|
|
||||||
p['dma_channels'] = {
|
p['dma_channels'] = {
|
||||||
req: [
|
req: [
|
||||||
ch
|
ch
|
||||||
@ -1210,7 +1325,45 @@ def filter_interrupts(peri_irqs, all_irqs):
|
|||||||
|
|
||||||
return filtered
|
return filtered
|
||||||
|
|
||||||
|
memories = []
|
||||||
|
|
||||||
|
def parse_memories():
|
||||||
|
with open('data/memories.yaml', 'r') as yaml_file:
|
||||||
|
m = yaml.load(yaml_file, Loader=SafeLoader)
|
||||||
|
for each in m:
|
||||||
|
memories.append(each)
|
||||||
|
|
||||||
|
|
||||||
|
def determine_ram_size(chip_name):
|
||||||
|
for each in memories:
|
||||||
|
for name in each['names']:
|
||||||
|
if is_chip_name_match(name, chip_name):
|
||||||
|
return each['ram']['bytes']
|
||||||
|
|
||||||
|
return None
|
||||||
|
|
||||||
|
def determine_flash_size(chip_name):
|
||||||
|
for each in memories:
|
||||||
|
for name in each['names']:
|
||||||
|
if is_chip_name_match(name, chip_name):
|
||||||
|
return each['flash']['bytes']
|
||||||
|
|
||||||
|
return None
|
||||||
|
|
||||||
|
def determine_device_id(chip_name):
|
||||||
|
for each in memories:
|
||||||
|
for name in each['names']:
|
||||||
|
if is_chip_name_match(name, chip_name):
|
||||||
|
return each['device-id']
|
||||||
|
return None
|
||||||
|
|
||||||
|
def is_chip_name_match(pattern, chip_name):
|
||||||
|
pattern = pattern.replace('x', '.')
|
||||||
|
return re.match(pattern + ".*", chip_name)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
parse_memories()
|
||||||
parse_interrupts()
|
parse_interrupts()
|
||||||
parse_rcc_regs()
|
parse_rcc_regs()
|
||||||
parse_documentations()
|
parse_documentations()
|
||||||
|
123
util/parse_memory.py
Normal file
123
util/parse_memory.py
Normal file
@ -0,0 +1,123 @@
|
|||||||
|
#!/usr/bin/env python3
|
||||||
|
|
||||||
|
import sys
|
||||||
|
import xmltodict
|
||||||
|
import yaml
|
||||||
|
from collections import OrderedDict
|
||||||
|
from glob import glob
|
||||||
|
|
||||||
|
try:
|
||||||
|
from yaml import CSafeLoader as SafeLoader
|
||||||
|
except ImportError:
|
||||||
|
from yaml import SafeLoader
|
||||||
|
|
||||||
|
|
||||||
|
def represent_ordereddict(dumper, data):
|
||||||
|
value = []
|
||||||
|
|
||||||
|
for item_key, item_value in data.items():
|
||||||
|
node_key = dumper.represent_data(item_key)
|
||||||
|
node_value = dumper.represent_data(item_value)
|
||||||
|
|
||||||
|
value.append((node_key, node_value))
|
||||||
|
|
||||||
|
return yaml.nodes.MappingNode(u'tag:yaml.org,2002:map', value)
|
||||||
|
|
||||||
|
yaml.add_representer(OrderedDict, represent_ordereddict)
|
||||||
|
|
||||||
|
def represent_int(dumper, data):
|
||||||
|
return dumper.represent_int(hex(data))
|
||||||
|
|
||||||
|
yaml.add_representer(int, represent_int)
|
||||||
|
|
||||||
|
def splat_names(base, parts):
|
||||||
|
names = []
|
||||||
|
for part in parts:
|
||||||
|
if part.startswith("STM32"):
|
||||||
|
names.append( base )
|
||||||
|
elif part.startswith( base[5]):
|
||||||
|
names.append('STM32' + part)
|
||||||
|
else:
|
||||||
|
names.append( base[0: len(base) - len(part)] + part)
|
||||||
|
|
||||||
|
return names
|
||||||
|
|
||||||
|
|
||||||
|
def split_names(str):
|
||||||
|
cleaned = []
|
||||||
|
names = str.split("/")
|
||||||
|
current_base = None
|
||||||
|
for name in names:
|
||||||
|
name = name.split(' ')[0].strip()
|
||||||
|
if '-' in name:
|
||||||
|
parts = name.split('-')
|
||||||
|
current_base = parts[0]
|
||||||
|
splatted = splat_names(current_base, parts )
|
||||||
|
current_base = splatted[0]
|
||||||
|
cleaned = cleaned + splatted
|
||||||
|
elif name.startswith("STM32"):
|
||||||
|
current_base = name
|
||||||
|
cleaned.append(name)
|
||||||
|
elif name.startswith( current_base[5]):
|
||||||
|
names.append('STM32' + name)
|
||||||
|
else:
|
||||||
|
cleaned.append( current_base[0: len(current_base) - len(name)] + name)
|
||||||
|
return cleaned
|
||||||
|
|
||||||
|
memories = []
|
||||||
|
|
||||||
|
def parse_files(dir):
|
||||||
|
for f in sorted(glob(dir + '/*.xml')):
|
||||||
|
#print("parsing ", f);
|
||||||
|
device = xmltodict.parse(open(f, 'rb'))['Root']['Device']
|
||||||
|
device_id = device['DeviceID']
|
||||||
|
name = device['Name']
|
||||||
|
names = split_names(name)
|
||||||
|
flash_size = None
|
||||||
|
flash_addr = None
|
||||||
|
ram_size = None
|
||||||
|
ram_addr = None
|
||||||
|
|
||||||
|
for peripheral in device['Peripherals']['Peripheral']:
|
||||||
|
if peripheral['Name'] == 'Embedded SRAM' and ram_size is None:
|
||||||
|
configs = peripheral['Configuration']
|
||||||
|
if type(configs) != list:
|
||||||
|
configs = [ configs ]
|
||||||
|
ram_addr = int(configs[0]['Parameters']['@address'], 16)
|
||||||
|
ram_size = int(configs[0]['Parameters']['@size'], 16)
|
||||||
|
#print( f'ram {addr} {size}')
|
||||||
|
if peripheral['Name'] == 'Embedded Flash' and flash_size is None:
|
||||||
|
configs = peripheral['Configuration']
|
||||||
|
if type(configs) != list:
|
||||||
|
configs = [ configs ]
|
||||||
|
flash_addr = int(configs[0]['Parameters']['@address'], 16)
|
||||||
|
flash_size = int(configs[0]['Parameters']['@size'], 16)
|
||||||
|
#print( f'flash {addr} {size}')
|
||||||
|
|
||||||
|
chunk = OrderedDict( {
|
||||||
|
'device-id': int(device_id, 16),
|
||||||
|
'names': names,
|
||||||
|
})
|
||||||
|
|
||||||
|
if ram_size is not None:
|
||||||
|
chunk['ram'] = OrderedDict( {
|
||||||
|
'address': ram_addr,
|
||||||
|
'bytes': ram_size,
|
||||||
|
})
|
||||||
|
|
||||||
|
if flash_size is not None:
|
||||||
|
chunk['flash'] = OrderedDict( {
|
||||||
|
'address': flash_addr,
|
||||||
|
'bytes': flash_size,
|
||||||
|
})
|
||||||
|
|
||||||
|
memories.append( chunk )
|
||||||
|
|
||||||
|
dir = "sources/cubeprogdb/db"
|
||||||
|
|
||||||
|
parse_files(dir)
|
||||||
|
|
||||||
|
with open('data/memories.yaml', 'w') as f:
|
||||||
|
f.write(yaml.dump(memories, width=500))
|
||||||
|
|
||||||
|
#print(yaml.dump(memories, width=500))
|
Loading…
x
Reference in New Issue
Block a user