2024-12-03 10:39 AM - last edited on 2024-12-03 10:46 AM by SofLit
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.
Solved! Go to Solution.
2024-12-03 12:00 PM
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.
2024-12-03 10:45 AM - edited 2024-12-03 10:45 AM
Hello,
What STM32C0 part number?
Did you check the AN2606?
2024-12-03 11:26 AM
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!
2024-12-03 11:32 AM - edited 2024-12-03 11:33 AM
How do we detect usb cable once pin PA9, PA10 are configured for UART1?
2024-12-03 11:41 AM
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.
2024-12-03 11:54 AM
@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?
2024-12-03 12:00 PM
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.
2024-12-03 12:10 PM - edited 2024-12-03 12:59 PM
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.
2024-12-03 12:59 PM
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.
2024-12-03 01:09 PM
Why you edited your post you've already confirmed it's working:
I suppose that thread is closed. Please open an new thread.