cancel
Showing results for 
Search instead for 
Did you mean: 

ST Link V3 cannot connect to BlueNRG2 when running FreeRTOS

JLepi.1
Associate II

I noticed a peculiar issue regarding FreeRTOS and ST Link. If you flash the BLE Beacon FreeRTOS example into the development board, ST Link cannot connect or event detect the BlueNRG target. This happens both with BlueNRG-X Flasher Utility and in Keil uVision. Only way to regain connection is to flash non-FreeRTOS example using BlueNRG-2 Navigator.

If I build and start a debug session with a FreeRTOS project, the target is flashed correctly, but almost immediately when entering main the connection is lost. This happens even if all FreeRTOS calls are removed.

In the attachments you can find log file where I flashed a FreeRTOS binary into the development board two times a row. The first flash is successful, but there is immediately a failure when ST Link tries to disconnect from the target. The next flashing fails immediately.

Any idea what could be causing this? What the FreeRTOS image is doing so that it kills the SWD?

3 REPLIES 3
JLepi.1
Associate II

I just tested what happens with Segger J-Link and to my surprise it is almost the same. J-Link can flash the target again, but it cannot debug because it cannot halt the CPU. I wonder does this have something to do with how sleep mode is implemented in the FreeRTOS port?

Winfred LU
ST Employee

Please debug without entering sleep mode.

In sleep mode, the digital power supply (for IOs) is switched off. The SWD interface is disconnected due to lost of power.

Uwe Bonnes
Principal III

The STLinkV3 is very picky about devices in WFI. V2 does better!