cancel
Showing results for 
Search instead for 
Did you mean: 

Issues running loading FW STM32 with STLINK_V3

RCull.2
Associate

I'm trying to use a STLINK-V3 to run GDB on my STM32, but I'm having issues. I've followed the directions on https://github.com/stlink-org/stlink/blob/develop/doc/tutorial.md, but I'm having issues loading the FW using `st-flash`.

$> st-flash write fw.bin 0x8000000
st-flash 1.6.1
2021-01-07T14:20:15 INFO usb.c: Unable to match requested speed 1800 kHz, using 1000 kHz
2021-01-07T14:20:15 INFO common.c: F7xx: 320 KiB SRAM, 1024 KiB flash in at least 2 KiB pages.
file fw.bin md5 checksum: 5f3fc1e69e2c1fa8b09f8da496d94256, stlink checksum: 0x0053afe3
2021-01-07T14:20:15 INFO common.c: Attempting to write 53432 (0xd0b8) bytes to stm32 address: 134217728 (0x8000000)
EraseFlash - Sector:0x0 Size:0x8000 2021-01-07T14:20:15 INFO common.c: Flash page at addr: 0x08000000 erased
EraseFlash - Sector:0x1 Size:0x8000 2021-01-07T14:20:15 INFO common.c: Flash page at addr: 0x08008000 erased
2021-01-07T14:20:15 INFO common.c: Finished erasing 2 pages of 32768 (0x8000) bytes
2021-01-07T14:20:15 INFO common.c: Starting Flash write for F2/F4/L4
2021-01-07T14:20:15 INFO flash_loader.c: Successfully loaded flash loader in sram
enabling 32-bit flash writes
size: 32768
2021-01-07T14:20:17 ERROR flash_loader.c: flash loader run error
2021-01-07T14:20:17 ERROR common.c: stlink_flash_loader_run(0x8000000) failed! == -1
stlink_fwrite_flash() == -1

I've also had issues loading the FW using gdb:

st-util:

$> st-util
st-util
2021-01-06T17:20:46 INFO usb.c: Unable to match requested speed 1800 kHz, using 1000 kHz
2021-01-06T17:20:46 INFO common.c: F7xx: 320 KiB SRAM, 1024 KiB flash in at least 2 KiB pages.
2021-01-06T17:20:46 INFO gdb-server.c: Chip clidr: 09000003, I-Cache: off, D-Cache: off
2021-01-06T17:20:46 INFO gdb-server.c:  cache: LoUU: 1, LoC: 1, LoUIS: 0
2021-01-06T17:20:46 INFO gdb-server.c:  cache: ctr: 8303c003, DminLine: 32 bytes, IminLine: 32 bytes
2021-01-06T17:20:46 INFO gdb-server.c: D-Cache L0: 2021-01-06T17:20:46 INFO gdb-server.c: f003e019 LineSize: 8, ways: 4, sets: 32 (width: 10)
2021-01-06T17:20:46 INFO gdb-server.c: I-Cache L0: 2021-01-06T17:20:46 INFO gdb-server.c: f007e009 LineSize: 8, ways: 2, sets: 64 (width: 11)
2021-01-06T17:55:15 INFO gdb-server.c: Listening at *:4242...
2021-01-06T18:04:44 INFO gdb-server.c: Found 8 hw breakpoint registers
2021-01-06T18:04:44 INFO gdb-server.c: GDB connected.
2021-01-06T18:04:48 INFO common.c: Attempting to write 32768 (0x8000) bytes to stm32 address: 134217728 (0x8000000)
EraseFlash - Sector:0x0 Size:0x8000 2021-01-06T18:04:48 INFO common.c: Flash page at addr: 0x08000000 erased
2021-01-06T18:04:48 INFO common.c: Finished erasing 1 pages of 32768 (0x8000) bytes
2021-01-06T18:04:48 INFO common.c: Starting Flash write for F2/F4/L4
2021-01-06T18:04:48 INFO flash_loader.c: Successfully loaded flash loader in sram
enabling 32-bit flash writes
size: 32768
2021-01-06T18:04:49 ERROR flash_loader.c: flash loader run error
2021-01-06T18:04:49 ERROR common.c: stlink_flash_loader_run(0x8000000) failed! == -1

gdb:

> ~/Downloads/gcc-arm-none-eabi-9-2020-q2-update/bin/arm-none-eabi-gdb fw.elf
...
Reading symbols from fw.elf...
(gdb) target extended localhost:4242
Remote debugging using localhost:4242
0x00000000 in ?? ()
(gdb) load
Loading section .isr_vector, size 0x1c8 lma 0x8000000
Loading section .text, size 0xb54c lma 0x80001d0
Loading section .rodata, size 0x17b4 lma 0x800b720
Loading section .init_array, size 0x4 lma 0x800ced4
Loading section .fini_array, size 0x4 lma 0x800ced8
Loading section .data, size 0x1dc lma 0x800cedc
Error finishing flash operation

Extra things to note:

  • MCU is a STM32F746xx
  • Running on MacOS 10.15
  • Using a STLINK-V3 v1.6.1
  • MCU board connects to STLINK using JTAG-10pin
0 REPLIES 0