cancel
Showing results for 
Search instead for 
Did you mean: 

STM32C0 bootloader interface

Dat Tran
Senior II

Hi everyone,

On STM32C0, PA9 and PA11 are same pin, need to enable/disable remap to switch between them.

Meaning if I enable PA9 then PA11 cannot be used.

Same issue for PA10 and PA12.

In STM32 Bootloader mode, STM32 can detect UART or USB mode on these pins at the same time, how do they do that?

If we config USB, using PA11 and PA12 then we cannot use PA9, PA10 for UART1. 

If we config UART then we cannot use PA11 and PA12 for USB.

We can detect start of frame or USB, if config these pins for USB, or receiving 0x7F for UART, if config these pins for UART.

But I can't find anyway to do UART and USB at the same time.

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions

From that organigram, if USART has not received a complete 0x7F byte from the host, USB will be executed no matter which GPIO is used.

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.

View solution in original post

12 REPLIES 12
SofLit
ST Employee

Hello,

What STM32C0 part number?

Did you check 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.

Thank you so much for response, 

I am using STM32C071xx.

I just check your link about AN2606, I see hardware requires but still not clear about how detect between USB, UART.

Can you please point out a little bit more?

Thank you so much!

 

 

 

 

How do we detect usb cable once pin PA9, PA10 are configured for UART1?

 

DatTran_0-1733254314695.png

 

This is shown in the organigram you shared. USART has priority on USB, if 0x7F has been received it will jump to the UART bootloader otherwise the bootlaoder will be executed till USB cable detection.

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.

@SofLit wrote:

This is shown in the organigram you shared. USART has priority on USB, if 0x7F has been received it will jump to the UART bootloader otherwise the bootlaoder will be executed till USB cable detection.


 

The main thing here is, how do we detect USB cable plug while PA9, PA10 are used for UART?

USB still work even PA9 and PA10 are used for UART?

 

From that organigram, if USART has not received a complete 0x7F byte from the host, USB will be executed no matter which GPIO is used.

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.

No, problem is still there, I tested on LQFP64 version which is PA9, PA10, PA11, PA12 are separately, on small version 28 pin still have problem, not sure how we detect usb cable. 

No, problem is still there, I tested on LQFP64 version which is PA9, PA10, PA11, PA12 are separately, on small version 28 pins still have problem, not sure how we detect usb cable. 

Why you edited your post you've already confirmed it's working:

SofLit_0-1733260105609.png

I suppose that thread is closed. Please open an new thread.

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.