cancel
Showing results for 
Search instead for 
Did you mean: 

STM32CubeProgrammer not identifying target MCU

ym21
Associate II

I have a custom PCB with an blank, unflashed STM32L4R and my goal is to flash it with firmware via the ST-LINK on my NUCLEO board that hosts another STM32L4R. The only pins I connected for debugging/flashing purposes is USB_DM and USB_DP, the rest, like NRST, SDWIO, SWCLK, SWO, BOOT0 are left unconnected. I am able to jump those pins to my ST-LINK or my USB device, however, my current method of flashing is jumping NRST, SWDIO, SWCLK, and SWO to my ST-LINK and programming it using STM32CubeIDE and STM32CubeProgrammer. I disconnected the jumpers on the ST-LINK that connect it to the NUCLEO MCU, which in theory should allow my PCB STM32 to become the target, however, I am getting launch sequence errors within STM32CubeIDE as well as "Target Not Found" errors in STM32CubeProgrammer. I included screenshots below and I tried switching modes and such, but nothing is working. I have connected CN5 Pin 1 to 3.3V, CN5 Pin 2 to PA14 on my PCB MCU, CN5 Pin 3 to ground, CN5 Pin 4 to PA13 on my target MCU, CN5 Pin 5 to NRST on my target MCU, and CN5 Pin 6 to PB3 on my target MCU. These were all according to the table given in my MCU datasheet. I want to know if I am setting this up properly and I want to see if this is a hardware or a software issue. Any advice or tips will help. Thank you

7 REPLIES 7
Chris21
Senior III

By "disconnected the jumpers" do you mean removing SB100,102,104,106?

Chris21
Senior III

I see now, just removing the jumpers on CN4 should work.  Also note from manual: "JP4 NRST (target STM32 RESET) must be open when CN3 pin 5 is used in an external application."

TDK
Super User

Duplicate/related:

Flashing a blank STM32 - STMicroelectronics Community

If you feel a post has answered your question, please click "Accept as Solution".

Yes, I made all those changes that were outlined in the data sheets but my device is still not able to recognize the target MCU. If everything setup wise looks sufficient, it could be just a hardware issue. 

gbm
Principal

Is your MCU powered?

Only 3 lines are required for connecting ST-Link - GND, SWDIO and SWCLK.

If you want to power your board, connect 3V3 to Arduino connector. There is no Vdd available on CN5. Pin 1 of CN5 should be left unconnected. Only pins 2, 3, 4 should be used.

My STM32 stuff on github - compact USB device stack and more: https://github.com/gbm-ii/gbmUSBdevice
ym21
Associate II

My mcu is able to be powered from a power source other than the st link. I currently have swdio, swck , swo, gnd and nrst. You are saying I must only connect swck, swdio, and gnd? What if I want to debug using the swv, then I would need to connect swo right? 

gbm
Principal

Right, but above we are discussing the lack of basic debug connection, so I'm trying to reduce it to a minimum.

My STM32 stuff on github - compact USB device stack and more: https://github.com/gbm-ii/gbmUSBdevice