0
votes

I just tried out the new STM32 Cube IDE, which based on Atollic True Studio which based on Eclipse.

Looks good, Cube MX is integraded but the Debugger / ST-Link Intigration made problems by me.

If I flash a MCU for first time, it works pretty well. But on next time, the IDE says

"Target no device found

Error in initializing ST-LINK device. Reason: No device found on target."

I found out that the ST-Link V2 with my Hardware need a "Connect under Reset".

With the ST-Link Utility it works fine, but in Cube IDE I cant find that point to set up.

Here is the Config Form: IDE

Can anyone assist?

2

2 Answers

1
votes

I found the problem of the code, why the upload just works one time after full erase:

Cube IDE generate the HAL_MspInit() in ..stm32f1xx_hal_msp.c which contains:

__HAL_AFIO_REMAP_SWJ_DISABLE();

With that all debug stuff will be disabled after first flash. With changing this line to:

__HAL_AFIO_REMAP_SWJ_NOJTAG();

The Debug mode works fine and several times in a row.

0
votes

With version up to v1.0.1 it is not possible to connect under reset with STM32CubeIDE from GUI.

The reason(s) why you are having the issue could be:

  • You are using low-power features where CPU is halted
  • You are overwriting default alternate function setup for SWDIO and SWCLK pins (PA13 and PA14).

If you need to use Connect under reset, use STM32CubeProgrammer for flashing. Even better, try not to use sleep modes or do not overwrite flashing GPIOs for the test.