Can't program/connect to STM32U031K4U6 over SWD
- April 3, 2026
- 4 replies
- 377 views
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!








