Skip to content

Instantly share code, notes, and snippets.

@rcubee
Created November 11, 2023 17:42
Show Gist options
  • Save rcubee/27a3d030f75725dd4b295903ab247de5 to your computer and use it in GitHub Desktop.
Save rcubee/27a3d030f75725dd4b295903ab247de5 to your computer and use it in GitHub Desktop.
STM32C0x1 support
$ ./st-flash erase
st-flash 1.7.0-316-g31c7fc6-dirty
2023-11-11T18:37:01 INFO common.c: STM32C031xx: 12 KiB SRAM, 32 KiB flash in at least 2 KiB pages.
Mass erasing...
Mass erase completed successfully.
2023-11-11T18:37:01 INFO common.c: Go to Thumb mode
$ ./st-flash read readout.bin 0x08000000 32768
st-flash 1.7.0-316-g31c7fc6-dirty
2023-11-11T18:37:34 INFO common.c: STM32C031xx: 12 KiB SRAM, 32 KiB flash in at least 2 KiB pages.
2023-11-11T18:37:34 INFO common.c: read from address 0x08000000 size 32768
$ hexdump readout.bin
0000000 ffff ffff ffff ffff ffff ffff ffff ffff
*
0008000
$ ./st-flash write flasher.bin 0x08000000
st-flash 1.7.0-316-g31c7fc6-dirty
2023-11-11T18:38:16 INFO common.c: STM32C031xx: 12 KiB SRAM, 32 KiB flash in at least 2 KiB pages.
file flasher.bin md5 checksum: 452556f2bac683bf541450dc72d0c714, stlink checksum: 0x005dbf48
2023-11-11T18:38:16 INFO common_flash.c: Attempting to write 32768 (0x8000) bytes to stm32 address: 134217728 (0x8000000)
-> Flash page at 0x8007800 erased (size: 0x800)
2023-11-11T18:38:17 INFO flash_loader.c: Starting Flash write for WB/G0/G4/L5/U5/H5/C0
16/16 pages written
2023-11-11T18:38:22 INFO common_flash.c: Starting verification of write complete
2023-11-11T18:38:22 INFO common_flash.c: Flash written and verified! jolly good!
2023-11-11T18:38:22 INFO common.c: Go to Thumb mode
$ ./st-flash --area=option read
st-flash 1.7.0-316-g31c7fc6-dirty
2023-11-11T18:38:37 INFO common.c: STM32C031xx: 12 KiB SRAM, 32 KiB flash in at least 2 KiB pages.
fffffeaa
$ ./st-flash --area=optcr read
st-flash 1.7.0-316-g31c7fc6-dirty
2023-11-11T18:38:42 INFO common.c: STM32C031xx: 12 KiB SRAM, 32 KiB flash in at least 2 KiB pages.
fffffeaa
$ ./st-info --probe
Found 1 stlink programmers
version: V2J42S27
serial: 0668FF313050353043154428
flash: 32768 (pagesize: 2048)
sram: 12288
chipid: 0x453
dev-type: STM32C031xx
$ ./st-trace
2023-11-11T18:38:54 INFO common.c: STM32C031xx: 12 KiB SRAM, 32 KiB flash in at least 2 KiB pages.
2023-11-11T18:38:54 ERROR trace.c: We do not support SWO output for device 'STM32C031xx'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment