OpenOCD stuck when suspending STM32F429 running FreeRTOS

I am trying to get OpenOCD debugger working with STM32F429 Discovery board running FreeRTOS. I can program the binary and start debugging with no problem. Simple programs with no FreeRTOS work ok - I can start, suspend, step and resume.

When I use FreeRTOS I can program and start the code and see the tasks executing ok. But when I try to suspend exectution OpenOCD enters endless loop and does not react to Eclipse/GDB anymore. OpenOCD debug log output shows endless loop of such sequence:

Debug: 5618 41065 target.c:1916 target_read_buffer(): reading buffer of 4 byte at 0x080146cc

Debug: 5619 41065 hla_target.c:766 adapter_read_memory(): adapter_read_memory 0x080146cc 4 1

Debug: 5620 41070 gdb_server.c:2662 gdb_input_inner(): received packet: ‘m80146cc,4’

Debug: 5621 41070 gdb_server.c:1373 gdb_read_memory_packet(): addr: 0x080146cc, len: 0x00000004

Debug: 5622 41070 target.c:1916 target_read_buffer(): reading buffer of 4 byte at 0x080146cc

Debug: 5623 41070 hla_target.c:766 adapter_read_memory(): adapter_read_memory 0x080146cc 4 1

Debug: 5624 41075 gdb_server.c:2662 gdb_input_inner(): received packet: ‘m80146cc,4’

Debug: 5625 41075 gdb_server.c:1373 gdb_read_memory_packet(): addr: 0x080146cc, len: 0x00000004

… and so on to infinity

The disassembly around 0x080146cc shows an entry of function prvTaskExitError in port.c of FreeRTOS ARM GCC:

080146c6: mov r0, r3

080146c8: add sp, #16

080146ca: bx lr

238 {

prvTaskExitError:

080146cc: push {r3, lr}

245 configASSERT( uxCriticalNesting == ~0UL );

080146ce: movw r3, #28

080146d2: movt r3, #8192 ; 0x2000

080146d6: ldr r3, [r3, #0]

My setup:

  • OpenOCD 0.8

  • Eclipse Kepler

  • GDB 0.8.3

  • gcc version 4.7.4 20130613 (release) [ARM/embedded-4_7-branch revision 200083] (GNU Tools for ARM Embedded Processors)

  • Code is a sample from STM32Cube_FW_F4_V1.1.0 FreeRTOS demo project

  • Compile flags: arm-none-eabi-gcc -c -gdwarf-2 -DDEBUG -O0 -mcpu=cortex-m4 -mthumb -mfpu=fpv4-sp-d16 -mfloat-abi=softfp -march=armv7e-m

  • Link flags: arm-none-eabi-g++ -gdwarf-2 -DDEBUG -O0 -mcpu=cortex-m4 -mthumb -mfpu=fpv4-sp-d16 -mfloat-abi=softfp -march=armv7e-m --cref,–gc-sections -lc -lm -lc -lgcc --output build/F429_Test.elf -Wl,-Map=build/F429_Test.map,

I was debugging STM32F303 with FreeRTOS without problem with similar setup.

ANY IDEAS WHAT IS WRONG? OpenOCD BUG?

Regards,

Mindaugas