• Status Unconfirmed
  • Percent Complete
  • Ticket Type Bug Report
  • Category
  • Assigned To No-one
  • Operating System All
  • Severity High
  • Priority Normal
  • Reported Version 1.10
  • Due in Version Undecided
  • Due Date Undecided
  • Votes 0
  • Private No
Attached to Project: EmBitz IDE
Opened by sneuf (sneuf) - 2017-01-05

Ticket#276 - Debug issue with STM32F446RE

I have an issue with the STM32F446RE debugging (ST-Link + GDB) in EmBitz 1.11.

When debugging code which is linked in both flash and SRAM, the program code ist not loaded correctly from the debugger.

I have almost all code linked in RAM except some functions in a separate flash section linked in ROM:

ROM (rx) : ORIGIN = 0x08020000, LENGTH = 128K
RAM (rwx) : ORIGIN = 0x20000000, LENGTH = 63K

Code runs from SRAM.

When I start debugging, I see gdb loads something at address 0x08000000 (which is default start address of STM32F4), but this should not happen, beacause there is no code linked.

The HEX file is ok. If I flash it with my own bootloader (located at 0x08000000, loads the program in SRAM and starts it), the program runs without problem.

If I change the linker file to load all in SRAM, the debugging goes without issues.

So there is only a problem with "mixed linked" code.

This ticket does not depend on any other tickets.

sneuf (sneuf)
Wednesday, 22 February 2017, 13:52 GMT
Similar issue with STM32L431CC when start debugging the second time:

Mixed linked Code gives:

STLINK GDB Server (EmBitz Dec 8 2016 12:12:38)
Shutdown after disconnect is active.
Connect under reset is active.

Connected to STlink/V2 probe at 001:010
Chip ID is 00000435, Core ID is 2ba01477.
Target voltage: 3.18
Number of HW-breakpoints: 6
Listening at *:4242...
GDB connected.
Reset: system
GDB Program Transfer:

Flash skip unchanged page 0x8020000 of 0x800 bytes.
EraseFlash - Page:0x101
WriteFlash - Size: 2048 @ 0x08020800
2017-02-22T14:45:02 ERROR E:\_stlink\stlink-master\src\stlink-common.c: Verification of flash failed
Reset: system
Write register (SP = 0xB1724B08)
Write register (PC = 0x68456804)
sneuf (sneuf)
Wednesday, 22 February 2017, 13:54 GMT
But it works in a earlier version of STLINK GDB Server.

Better get it both work with EB-Link?
sneuf (sneuf)
Wednesday, 22 February 2017, 13:59 GMT
Tried STM32L431CC with older STLINK GDB Server from here (2016/07/15)


and it works again.

So something changed in the EMBitz 1.11 STLINK GDB Server Version (2016/12/08)?