cancel
Showing results for 
Search instead for 
Did you mean: 

Can't program STM32F411CEU6 via UART interface

MWon.1
Associate II

Hi,

I'm having a very similar issue reported in this question.

My problem: I can't program a STM32F411CEU6 with Arduino IDE and using UART.

So, I have designed a customized board with a STM32F411CEU6. I'm new in the field and so to prevent any big surprises I just used the design of a Black Pill as a reference (it turns out I had a big surprise :grinning_face_with_sweat: ). Also, I have one Black Pill I use as a control.

I'm able to program the Black Pill with Arduino IDE in three different ways:

1. Via SWD using the official ST-link v2

2. Via SWD using a Chinese made USB pen ST-link like one: https://www.amazon.com/HiLetgo-Emulator ... a?dchild=1.

3. Via UART using an FTDI UART to USB converter

Also, I'm able to program my customized board:

1. Via SWD using the official ST-link v2

2. Via SWD using the ST-link USB pen

But can't program it using UART! :face_with_steam_from_nose:

I'm using pins PA9 and PA10 that are the UART1 pins in STM32F411CEU6 chip. I have tested a UART communication in these pins on my custom board and everything ok (I uploaded a sketch with a "Hello World" message using SWD).

The error

When I try to connect STM32CubeProgramer using UART (I'm able to connect it using SWD) I get the error:

12:58:46 : Serial Port cu.usbserial-A50285BI is successfully opened.
  12:58:46 : Port configuration: parity = even, baudrate = 115200, data-bit = 8,                     stop-bit = 1.0, flow-control = off
  12:58:48 : Timeout error occured while waiting for acknowledgement.
  12:58:48 : Timeout error occured while waiting for acknowledgement.
  12:58:48 : Error: Activating device: KO. Please, verify the boot mode configuration and check the serial port configuration. Reset your device then try again... 

Btw. Not sure if it is related but the first time I tried the chip, I got the following error:

RUNNING Program ... 
  Address:      : 0x8000000
Warning: The core is locked up
Start operation achieved successfully
the selected serial port Start operation achieved successfully
 does not exist or your board is not connected

that was solved with the following steps:

1. Open STM32CubeProgramer and click connect

2. Click Option Bytes (OB) located in the left bar

3. Select Read Out Protection and choose AA option

4. Then select PCROP and uncheck the box

4. Click apply

So, any ideas one why I can't program it using UART?

3 REPLIES 3

>>So, any ideas one why I can't program it using UART?

Signals on other pins/usarts that the loader assumes are more prescient? ie a GPS/GNSS receiver that starts chirping immediately at start-up

Check pins enumerated in AN2606

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

Ok, thanks. That's a good point. I will check that.

Unfortunately, I think that's not what is causing the problem. I have tried with all other UARTS floating and I get the same error.