cancel
Showing results for 
Search instead for 
Did you mean: 

Unable to program STM32F103 through UART

Nv7
Associate II

I created a custom board with the STM32 (F103C8T6), and I am trying to program it using a FTDI USB to Serial module. However, nothing is happening, it doesn't seem to be sending anything and when I try using STM32CubeProgrammer it says:
Timeout error occured while waiting for acknowledgement.
Error: Activating device: KO. Please, verify the boot mode configuration and check the serial port configuration. Reset your device then try again...

Relevant schematics:

 
 

Nv7_2-1694149065260.png

Note that BTEN is unconnected and the BT0 header pin is connected to VCC (which should put it into boot mode).

 

Nv7_4-1694149113730.png

I have tried reversing RXD and TXD and both 9600 and 115200 baud rate. How can I debug this?

 

13 REPLIES 13
Issamos
Lead II

Hello @Nv7 

This post can be helpful for your case.

Best regards.

II

Check part orientation 

Check level on NRST

Check RX/TX sense. The STM32 TX should go to the FTFI RX.

Use 8E1 with 0x7F data pattern.

Check connectivity with SWD/JTAG.

Check BOOT0 and BOOT1 levels.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

Is it a genuine STM32F103, or a blue pill?

JW

RomainR.
ST Employee

Hello @Nv7 

I think what is missing in your design is a header connector for the Serial Wire Debugger on the dedicated IO's:
PA13 SWDIO
PA14 SWDCLK
You could establish a connection with a STLink and the STM32CubeProgrammer in SWD mode to validate that your MCU is programmable/Option Bytes readable and therefore "debug" possible.
This step will allow you to validate the power supply integrity of your PCB (all VDD/VSS and VDDA/VSSA are properly connected and your MCU is correctly powered)
After that, testing the STM32 in bootloader will be your next step.

You can refer to AN2586 Getting started with STM32F10xxx hardware development in section 4 Boot configuration.
Getting started with STM32F10xxx hardware development - undefined

BR
romain,

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

- NRST is LOW when button pressed, HIGH when button isn't pressed
- I tried both directions but I did what you said first
- What is 8E1 with 0x7F?
- I didn't get a SWD programmer because I was hoping to program via serial
- BOOT0 is HIGH, BOOT1 is floating

It is a STM32F103C8T6 I got assembled from JLCPCB. I am pretty sure it is genuine, but it is on a custom design of mine

Unfortunately this board doesn't have SWD debugging since we were expecting to program it via serial. Can we do anything through serial?

RomainR.
ST Employee

In your design BOOT1 is floating, internal bootloader cannot works.
Again, you should review your design and refer in AN2586 Chapter 4 Boot Configuration.
To enter in Bootloader (System memory in the Table 2 below) you must apply on pins BOOT0 = 1 (VCC) and BOOT1 = 0 (GND).
BR
Romain,

RomainR_0-1694182727854.png

 

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

Shouldn't it still work right now because the flash memory is empty?