Hello STM32 community
I'm facing an issue with my custom PCB featuring the STM32F030CC microcontroller. I've been using an STLINK V2 with opto-isolation for programming via SWD.
Here's the scenario:
Initial Success: After connecting power and performing the first programming, a simple program controlling a GPIO worked perfectly.
Programming Failure in STM32CubeMX: However, when I tried to program the device again using STM32CubeMX, I encountered the following error: "Target no device found Error in initializing ST-LINK device. Reason: No device found on target." Importantly, I didn't make any changes to the configuration between the initial success and this point.
Reproducible on Another PCB: To rule out the possibility of a single PCB issue, I tried the same procedure on a different custom PCB, and I encountered the same problem.
I don't see any reason why that happens, but it worked once for almost 3 days. Another pcb was working fine for 6 programminga and the last one's gone after just one.
I've already gone through a comprehensive list of troubleshooting steps, including checking connections, firmware updates, different computers, and power supplies. Unfortunately, the issue persists.
Has anyone experienced a similar problem or have any suggestions for further troubleshooting? Your insights and expertise would be greatly appreciated.
Thank you in advance for your help!
Do you provide connectivity for NRST or BOOT0 ?
Which device specifically, how many pins?
With NRST you might want to try "Connect Under Reset" options for debug connectivity. This can help where your code reconfigures the SWD involved pins, disables debugging, or turns off the chip, ie low power or turning off involved circuits.
With BOOT0 HIGH the device should enter ROM code rather than your own, this can help determine if it is an issue with the software or hardware.
You could also add a delay in your startup code, ie Reset_Handler() and in-bound so the pins remain usable by the debugger to wrestle control of the MCU. Also perhaps code to facilitate an update, or erase user code.
Yes, I do provide the NRST connectivity to ST-Link, whilst the BOOT0 had pulldown resistor.
The uC is STM32F030CCT6 48pins.
Unluckily the "Connect Under Reset" option did not help me at all and I am currently unable to test adding a delay.
Try to connect NRST to GND, then turn on the power and start "Connect" in CubeProg. Immediately after that, disconnect NRST from GND. If "connect" succeeds, then do "Mass Erase". This method usually works for me.
So far I knew that the issue is not with the software itself due to the fact that I was testing a blank new project with only 1 GPIO toggle.
However I've discovered that the issue may be with the power delivery. I'm powering the uC with 3.3V output of the LDO. As long as the input is 12V it fails because the 3.3V in not continuous. Reducing the input voltage to only 5V reduce the amount of heat dissipation as well and thus uC with a led blink project do not cause the LDO to overheat.
With power from 5V there are no issues in CubeIDE nor CubeProg, the device is visible and can be connected or programmed.