‎2023-02-01 02:36 PM
Hello,
I have two custom boards based on the STM32G0B1CBU. When I try to program them via the SWD interface (using ST-LINK or SEGGER J-Link), I get the "No Device Found on Target" error.
I checked the schematics and used an oscilloscope to make sure the signals on the pins were OK.
Programming the boards via USB worked the first time. After that, I can't connect them via USB, but I assume that's because with my firmware, the USB bootloader no longer works.
I also tried connecting the PA14/Boot_0 pin, which is also connected to SWCLK, permanently to 3.3V as recommended here: https://community.st.com/s/question/0D53W000012VSk2SAG/problem-with-swd-interface, but that didn't work either.
I also updated the ST-Link firmware several times, as indicated here: https://community.st.com/s/question/0D53W00001KSncTSAT/stm32g0-unable-to-connect-via-swd
Since I had to fix a few hardware bugs on these boards, the boards were heated up to ~350°C for a few seconds, which may have damaged the SWCLK or SWDIO pins. But since the firmware I flashed via USB works fine, I don't think that's the case.
Since I have tried every single suggestion I have found in the community about SWD interface problems, I have no idea what to do anymore. Does anyone have any ideas what I could test or what could fix the problem?
I appreciate any help and advice! Thanks in advance 🙂
With kind regards
Robin
‎2023-02-02 12:39 AM
Looks like for the first time the internal flash empty check helped you. Try SWD connect under reset and find the correct timing of releasing reset (or power on) and starting attached SWD. May take few dozens attempts. Attaching a cheap LA may help getting a feeling for the correct timing.
hth
KnarfB
‎2023-02-02 10:31 AM
Thank you very much for your help 🙂
The hardware reset mode works with the NRST pin. I also have a button to manually trigger the reset, and I can see from my LEDs that when flashing with SWD, the LEDs also go off momentarily. So I don't see how I could trigger the reset with better timing than the ST-Link doing it software-controlled :D
I've never had any problems with the flash/debugging interface on other microcontrollers or the STM32 series. Do you think it has something to do with the STM32G0?
‎2023-02-02 11:01 AM
Well the G0 is for very small pincounts, with this, SWD pins are shared with BOOT which is latched at Reset raising edge after power up... While BOOT is also one of the SWD pins which can themselves been reconfigured as GPIO... Reset pin too can be reprogrammed as GPIO.
As for the STM8 SWIM interface, it could be better to add a 1 second SW delay after reset before reconfiguring these pins, so there is some time opportunity to catch the debug mode... yet this may only be one root cause to the difficulty to enter debug mode with it.
‎2023-02-02 01:42 PM
I tried to get the debugger to work with SWD by pressing the reset button at various times during the connection process - with no luck:/
‎2023-02-03 01:17 PM
Okay, what does this mean for my problem?
As far as I know, the fact that the SWDIO is shared with the BOOT pin should not affect the flashing when the SWD interface is selected on the microcontroller.