stlink: Semihosting is not working after 1.5.1 with STM32F429

Thank you for giving feedback to the stlink project.

NOTICE: Please read and follow instructions in #906 before submitting a ticket. This feature request will be deleted without notice when not enough information is provided! So please ensure that all fields are filled out.

  • I made serious effort to avoid creating duplicate or nearly similar issue

In order to allow developers and other contributors to isolate and target your respective issue, please take some time to fill out each of the following items appropriate to your specific problem:

  • Programmer/board type: stlink-v2
  • Operating system and version: MacOS
  • Stlink tools version and/or git commit hash: 1.6.1 via brew
  • Stlink commandline tool name: st-util --semihosting
  • Target chip (and board if applicable): STM32F429I-DISC

Futher we kindly ask you to describe the detected problem as detailed as possible and to add debug output if available, by using the following template:

Commandline-Output:

2020-09-23T23:35:30 INFO common.c: F42x/F43x: 256 KiB SRAM, 2048 KiB flash in at least 16 KiB pages.
2020-09-23T23:35:30 INFO gdb-server.c: Listening at *:4242...
2020-09-23T23:35:33 INFO gdb-server.c: Found 6 hw breakpoint registers
2020-09-23T23:35:33 INFO gdb-server.c: GDB connected.
2020-09-23T23:35:33 INFO common.c: Attempting to write 16384 (0x4000) bytes to stm32 address: 134217728 (0x8000000)
EraseFlash - Sector:0x0 Size:0x4000 2020-09-23T23:35:33 INFO common.c: Flash page at addr: 0x08000000 erased
2020-09-23T23:35:33 INFO common.c: Finished erasing 1 pages of 16384 (0x4000) bytes
2020-09-23T23:35:33 INFO common.c: Starting Flash write for F2/F4/L4
2020-09-23T23:35:33 INFO flash_loader.c: Successfully loaded flash loader in sram
enabling 32-bit flash writes
size: 16384
2020-09-23T23:35:34 INFO common.c: Starting verification of write complete
2020-09-23T23:35:34 INFO common.c: Flash written and verified! jolly good!
2020-09-23T23:35:34 INFO common.c: Attempting to write 16384 (0x4000) bytes to stm32 address: 134234112 (0x8004000)
EraseFlash - Sector:0x1 Size:0x4000 2020-09-23T23:35:34 INFO common.c: Flash page at addr: 0x08004000 erased
2020-09-23T23:35:34 INFO common.c: Finished erasing 1 pages of 16384 (0x4000) bytes
2020-09-23T23:35:34 INFO common.c: Starting Flash write for F2/F4/L4
2020-09-23T23:35:34 INFO flash_loader.c: Successfully loaded flash loader in sram
enabling 32-bit flash writes
size: 16384
2020-09-23T23:35:34 INFO common.c: Starting verification of write complete
2020-09-23T23:35:34 INFO common.c: Flash written and verified! jolly good!
2020-09-23T23:35:34 INFO common.c: Attempting to write 16384 (0x4000) bytes to stm32 address: 134250496 (0x8008000)
EraseFlash - Sector:0x2 Size:0x4000 2020-09-23T23:35:35 INFO common.c: Flash page at addr: 0x08008000 erased
2020-09-23T23:35:35 INFO common.c: Finished erasing 1 pages of 16384 (0x4000) bytes
2020-09-23T23:35:35 INFO common.c: Starting Flash write for F2/F4/L4
2020-09-23T23:35:35 INFO flash_loader.c: Successfully loaded flash loader in sram
enabling 32-bit flash writes
size: 16384
2020-09-23T23:35:35 INFO common.c: Starting verification of write complete
2020-09-23T23:35:35 INFO common.c: Flash written and verified! jolly good!
2020-09-23T23:35:35 INFO common.c: Attempting to write 16384 (0x4000) bytes to stm32 address: 134266880 (0x800c000)
EraseFlash - Sector:0x3 Size:0x4000 2020-09-23T23:35:35 INFO common.c: Flash page at addr: 0x0800c000 erased
2020-09-23T23:35:35 INFO common.c: Finished erasing 1 pages of 16384 (0x4000) bytes
2020-09-23T23:35:35 INFO common.c: Starting Flash write for F2/F4/L4
2020-09-23T23:35:35 INFO flash_loader.c: Successfully loaded flash loader in sram
enabling 32-bit flash writes
size: 16384
2020-09-23T23:35:36 INFO common.c: Starting verification of write complete
2020-09-23T23:35:36 INFO common.c: Flash written and verified! jolly good!
2020-09-23T23:35:36 INFO common.c: Attempting to write 65536 (0x10000) bytes to stm32 address: 134283264 (0x8010000)
EraseFlash - Sector:0x4 Size:0x10000 2020-09-23T23:35:36 INFO common.c: Flash page at addr: 0x08010000 erased
2020-09-23T23:35:36 INFO common.c: Finished erasing 1 pages of 65536 (0x10000) bytes
2020-09-23T23:35:36 INFO common.c: Starting Flash write for F2/F4/L4
2020-09-23T23:35:36 INFO flash_loader.c: Successfully loaded flash loader in sram
enabling 32-bit flash writes
size: 32768
size: 32768
2020-09-23T23:35:37 INFO common.c: Starting verification of write complete
2020-09-23T23:35:38 INFO common.c: Flash written and verified! jolly good!

Expected/description:

I have been debugging today using semihosting but it was not working despite using an application which I was sure it was fine some months ago. Then I tried to compile version 1.5.1 which I was using and st-util --semihosting works there, whereas with the new versions results in SIGTRAP

Thank you for your support.

The stlink project maintainers

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Reactions: 2
  • Comments: 17 (12 by maintainers)

Most upvoted comments

@Nightwalker-87 Yes, this bug is related to #1027. Semihost uses the stlink_read_all_regs for determine a state: https://github.com/stlink-org/stlink/blob/fe526ec9ebc77224ed3ac0e688e07cd250cd59a0/src/st-util/gdb-server.c#L1458-L1469