2026-04-02 6:52 PM - last edited on 2026-04-03 3:17 AM by Andrew Neil
Hi all, I have reached the point of desperation, and I am all out of ideas how to get my STM32U031 project working.
I designed a very simple PCB which has only a few components. I have attached the KiCad files in case it is helpful. I followed guidelines for decoupling capacitors and broke out the SWDIO and SWCLK pins.
The issue I have is this: I can not program/connect to the chip over SWD.
When I power the PCB from 3V, the first noticeable problem is GPIO PA3 goes high. You can notice that because that pin is connected to the gate of a mosfet which is used to switch some LEDs, so when it goes high, the LEDs turn on. It is especially strange because I put an external pulldown resistor on the pin, so the fresh unprogrammed MCU is driving it high for some reason. I also connected my ST Link to the PCB, but when I try to connect with any speed or reset settings, I see this error:
02:27:47 : UR connection mode is defined with the SWrst reset mode
02:27:47 : ST-LINK SN : 003B00243333511831363730
02:27:47 : ST-LINK FW : V3J16M7
02:27:47 : Board : STLINK-V3MINIE
02:27:47 : Voltage : 2.96V
02:27:47 : Error: Unable to get core ID
02:27:47 : Error: ST-LINK error (DEV_TARGET_CMD_ERR)
I initially thought the issue was a damaged MCU during soldering, so I ordered a new MCU and soldered it using low temperature paste to a new PCB with just the MCU and decoupling caps to eliminate the possibility of other things on the circuit causing issues. As far as I can tell the second assembled circuit has the exact same problems.
I also tried soldering a wire to the reset pin to allow me to manually reset the chip and add an external pull up resistor (even though the IC has a built in pullup on NRST), but that didn't make any difference either.
To further try to diagnose the issue, I have soldered another new chip to a DIP breakout PCB I had lying around. I soldered decoupling caps the best I could, but it is still not ideal how far away they are from the chip. I still think it should be a good way to test things though.
Sadly, even with the chip on a breakout I have the same problems! I can not program it, and some GPIO are at weird voltage levels. PA3 is high like my previous attempts. Some other pins are also weird like PB1 is at 2V for some reason, PA5 is at 1.3V, the list goes on. Also, I will mention that I have seen the chip draw between 1mA and 4mA from a 3V supply of my Nordic PPK 2. One time it drew 1mA and some time later after debugging things it randomly is seems to draw 4mA, so not sure what is causing the change.
The strange voltages make me feel like the chips are damaged, but I seriously doubt three chips in a row have been damaged. They were ordered form the ST E Store, kept in sealed ESD bags, and assembled with low temp paste.
I also thought perhaps I got the orientation wrong, but as far as I can tell I have it right. On my PCB and on my breakout board. I do find it weird that in CubeMX, the ST logo and MPN on the chip are in a different orientation than on the actual chip. However I have double checked the pin I marking on the underside of the MCU and it matches the pin 1 marking dot on the top of the MCU.
I am out of ideas now, so if anyone can suggest something, please do!
I have uploaded photos of things I think could be useful.
Thank you in advance!
Solved! Go to Solution.
2026-04-03 3:42 PM
I have tried your suggestion and tied pin 31 (BOOT0) to GND on my PCB, but still to change unfortunately.
I also tried adding a decoupling cap to the NRST pin, which also didn't make a difference.
Thank you for the ideas though!
I guess it isn't too surprising since my DIP breakout experiment now works fine and it doesn't have either BOOT0 tied to ground or the capacitor on the NRST pin. I added the NRST capacitor anyway to the DIP breakout circuit and it still works.
2026-04-03 4:57 PM
Since I could get the MCU on the dip breakout connecting, but not the one on the PCB, I decided to solder a new PCB with the known good chip from the DIP breakout. I also reduced the wire length from the PCB to the programmer, and now I can connect!
I do not need to have the NRST pin connected to the programmer for a successful connection. I also do not need the 100nF cap between NRST and ground, however I will add that in the next revision to be safe.
It seems to me the issue was caused by too long cable lengths from the ST link to the MCU and potentially a damaged chip on the PCB. Either way I am glad it is working, thank you for all the help everyone!
2026-04-03 9:05 PM
If the bootloader starts you can still connect with STM32CubeProgrammer. Doesn't matter what state BOOT0 is at here.
Caps on NRST are also irrelevant here.
Had to be a wiring issue.
2026-04-04 1:16 AM
@EricNava wrote:I do not need to have the NRST pin connected to the programmer
But I strongly recommend that you do have that connection!
It can get you out of a few other "can't connect" situations ...