Showing results for 
Search instead for 
Did you mean: 

Errors in GDB and OpenOCD when debugging in STM32CubeIDE


Hi All. I have: STM32CubeIDE 1.4.2, ST-LINK V3, STM32F756

The project compiles successfully and runs in the Cube.

Also, I have absolutely no problem flashing my HEX file via ST-LINK Utility. It is perfectly flashed at the emulator speed of 24 MHz, starts up and displays debug information in the SWV Viewer.

However, I cannot replicate this in STM32CubeIDE.

Issue 1: Error checking downloaded code via ST_LINK GDB Server

I choose the reduced speed of the emulator (8 MHz), but the emulator runs at nominal 24 MHz

0693W000004K2dkQAC.jpgIn log:

ST-LINK SN : 003D00283038511834333935


Board    : STLINK-V3SET

Voltage   : 3.30V

SWD freq  : 24000 KHz

Connect mode: Normal

Reset mode : Software reset

Device ID  : 0x449

Revision ID : Rev Z

Device name : STM32F74x/STM32F75x

Flash size : 1 MBytes

Device type : MCU

Device CPU : Cortex-M7


Verifying ...

Read progress:

±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±± 50%

Error: Data mismatch found at address 0x0804F934 (byte = 0x00 instead of 0x4F)

The same error in the flash is found by the ST-LINK Utility when checking memory, that is, it really exists. But when programming through the ST-LINK Utility (same ST-Link, same MCU, same HEX), no errors occurred during rechecking.

I tryed low speeds, by this setting is seems to be ignored.

So I tryed second variant: OpenOCD...

Issue 2: SWO Output does not work in OpenOCD

I configured as follows

 0693W000004K2w3QAC.jpgSuccessfully connected to the target, loaded and verified the firmware at maximum speed, launched the program, opened the "SWV ITM Data Console", Added port 0 ... And nothing happened. Perhaps I need some additional initialization of OpenOCD, but I haven't found how to do it.

And again - when later connecting to the target through the ST-LINK utility, I see debug output in SWV Viewer (so, there are no problems in code or target).

P.S. Tried standalone STM32CubeProgrammer. It does not see connected ST-LINK at all. Although both the utility and IDE see the emulator without problems...

Please help me with this problems =)