STM32MP1 FreeRTOS debug issue
Hi,
We are currently using the STM32MP1-DK1 board.
We have tried several examples but we are facing some issues with the one using FreeRTOS (FreeRTOS_ThreadCreation) :
We have no issues running the program on the M4 both in Engineering mode and Production mode.
When we are debugging the program and stepping instruction by instruction, the debugging process is lost at a time during the execution.
In Engineering mode :
We can execute the program and and we can insert breakpoint wherever we want. But, after the instruction msr msp, r0 in the function prvPortStartFirstTask in the file port.c has been executing, if we stop the program execution by inserting a breakpoint, the debugging process is lost with the error :
Examination failed, GDB will be halted. Polling again in 6300ms
Polling target stm32mp15x.cpu0 failed, trying to reexamine
In Production mode :
We can execute the program and and we can insert breakpoint wherever we want. But, after the instruction bx r14 in the function vPortSVCHandler in the file port.c
has been executing, if we stop the program execution by inserting a breakpoint, the debuging process is lost with the error (in the linux console):
dwc2 49000000.usb-otg : dwc2_hsotg_ep_stop_xfr: timeout DIEPINT.NAKEFF
dwc2 49000000.usb-otg : dwc2_hsotg_ep_stop_xfr: timeout DOEPCTL.EPDisable
dwc2 49000000.usb-otg : dwc2_flush_tx_fifo : HANG ! AHB Idle GRSCTL
dwc2 49000000.usb-otg : dwc2_hsotg_ep_stop_xfr: timeout GINTSTS.GOUTNAKEFF
dwc2 49000000.usb-otg : dwc2_hsotg_ep_stop_xfr: timeout DOEPCTL.EPDisable
dwc2 49000000.usb-otg : dwc2_hsotg_ep_stop_xfr: timeout DIEPINT.NAKEFF
…
If we don’t stop the execution after executing these instructions, we can see with the LED that the program is executing without error and the tasks are correctly scheduling.
The same error will appears if we break the execution flow after theses instructions has been executed.
The program is compiled with the size optimization (-Os). When compiling without optimization (-Oo), the issue no longer appears and it is possible to debug the entire execution and include breakpoint whenever/wherever we want without having issues, both in Production mode and Engineering mode.
The behavior is the same when using the STM32MP1-DK2 board.
We don’t see what is the issue here and how changing the optimization from –Os to –Oo could impact the behavior of the program.
Do you have any idea of the root cause of the issue ?
Thanks,
Regards,
Romain
