Skip to main content
alnicko_artem
Associate II
July 14, 2025
Solved

STM32C071 impossible to flash through UART

  • July 14, 2025
  • 6 replies
  • 794 views

I have custom board with STM32C071 micro controller (I used stm32c031 before) and I can't flash it via UART (cant connect in STM32CubeProgrammer).

UART Used - USART1 (PA9/PA10) with auto baud rate (57600)

STM32CubeProgrammer - v2.20.0

Jump to boot loader mode from FW and can confirm it with st-link debug(with empty flash - dont work too).

Flashing via ST-Link works well, but it will not be available when the device is in the case, so i need UART flashing.

When i connect directly to the device and send 0x7f it doesn't respond as it should.

The only suspicion is that the device does not reassign pins from PA11 PA12 to PA9 PA10, since it uses USB on these pins, because STM32C031 on the same board flashing well, it have no USB and doesn't have this problem

STM32CubeProgrammer log:

12:52:33:798 : RTS low
12:52:33:799 : DTR Low
12:52:33:799 : Serial Port ttyUSB2 is successfully opened.
12:52:33:799 : Port configuration: parity = even, baudrate = 57600, data-bit = 8, stop-bit = 1,0, flow-control = off
12:52:33:799 : No Init bits value is : 0 
12:52:33:799 : Sending init command: 
12:52:33:799 : #byte 0x7F sent successfully to target
12:52:33:799 : Wait ends after 1 loop, dataready = 0, delay = 2002
12:52:33:799 : Timeout error occured while waiting for acknowledgement.
12:52:33:799 : No response from target received
12:52:33:799 : Retrying UART init connection...
12:52:33:799 : #byte 0x7F sent successfully to target
12:52:33:799 : Wait ends after 1 loop, dataready = 0, delay = 100
12:52:33:799 : Timeout error occured while waiting for acknowledgement.
12:52:33:799 : No response from target received
12:52:33:800 : Error: Activating device: KO. Please, verify the boot mode configuration and check the serial port configuration. Reset your device then try again... 
12:52:33:813 : UART PORT CLOSE 



Best answer by mƎALLEm

Hello @alnicko_artem ,

I got a feedback about this topic.

Indeed, UART1 is not available on STM32C071/ UFQFPN28 package. 

For C031 device a remapping was applied in the bootloader, see this note in the AN2606:

mALLEm_0-1752744069001.png

That's why the USART is available on C031 for the UFQFPN28 package.

For C071, USB/DFU has been added versus C031 and you should use USB instead of USART1 for C071.

Hope that answers your question.

PS: we plan to clarify that in the AN2606

6 replies

mƎALLEm
Technical Moderator
July 14, 2025

Hello,

Please confirm you have used PA9 PA10 GPIOs for USART1 bootloader and confirm if they are effectively used: do a continuity test. You need to ensure these connections in your hardware + Boot pin = VDD then reset.

"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."
alnicko_artem
Associate II
July 14, 2025

I am sure of the pins used and their functionality, these same pins were used when the same board had the STM32C031 chip. The fact that loading via UART worked correctly before(с031) hints that the reason is somewhere in the difference between the chip bootloaders.

alnicko_artem
Associate II
July 14, 2025

One interesting thing I noticed during debugging when the device was in the bootloader, the UART1 registers had already set the auto baud rate, although no signal had been sent yet.

TDK
Super User
July 14, 2025

By default, PA9/PA10 are not mapped onto pins so you won't be able to use them for the bootloader.

If you're jumping to the bootloader, it's possible you can remap these before the jump in order for them to work.

"If you feel a post has answered your question, please click ""Accept as Solution""."
alnicko_artem
Associate II
July 14, 2025

I already tried to remap the pins before going to the bootloader, but it did not give any effect, it cannot connect. The need for remap is questionable since the C031 chip used the same pins that, according to your logic, should have been remapped in advance, but it worked without it.

 LL_SYSCFG_EnablePinRemap(LL_SYSCFG_PIN_RMP_PA11);
 LL_SYSCFG_EnablePinRemap(LL_SYSCFG_PIN_RMP_PA12);
TDK
Super User
July 14, 2025

Can you provide the full part numbers of the chips you're using?

 

The C031 doesn't have USB, so the bootloader remaps pins PA11/PA12 to PA9/PA10. This is not the case on C071.

TDK_0-1752501177719.png

 

"If you feel a post has answered your question, please click ""Accept as Solution""."
alnicko_artem
Associate II
July 15, 2025

Connected USB to these pins and flashing firmware via USB works correctly, even if you remap the pins before bootloader, flashing via USB still works. How to make UART work on these pins remains a question.

TDK
Super User
July 15, 2025

Sure sounds like UART is not available on those pins, as they do not get remapped.

"If you feel a post has answered your question, please click ""Accept as Solution""."
mƎALLEm
Technical Moderator
July 16, 2025

Hello,

Need to check internally for that information. I will get back to you as soon as I have a feedback.

Internal ticket 214190.

"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."
mƎALLEm
mƎALLEmBest answer
Technical Moderator
July 17, 2025

Hello @alnicko_artem ,

I got a feedback about this topic.

Indeed, UART1 is not available on STM32C071/ UFQFPN28 package. 

For C031 device a remapping was applied in the bootloader, see this note in the AN2606:

mALLEm_0-1752744069001.png

That's why the USART is available on C031 for the UFQFPN28 package.

For C071, USB/DFU has been added versus C031 and you should use USB instead of USART1 for C071.

Hope that answers your question.

PS: we plan to clarify that in the AN2606

"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."