cancel
Showing results for 
Search instead for 
Did you mean: 

Pins for STM32 UART Bootloader communication?

MFord.1
Associate III

Hi,

I have been reading through documentation for the ST UART bootloader on the STM32F091cc chip. I want to use UART2 as my UART for both standard serial communication and FW updates.

UART2 can use pins (PA2,PA3) or (PA14, PA15). I would like to be able to use PA2 and PA3 because PA14 overlaps the SYS_SWCLK and I would like to be able to use SWD and UART at the same time.

I have successfully talked to the bootloader over PA14 and PA15, and there is a discrepancy in documentation that is making me hesitant to move to PA2and PA3. PCB is not easy to hack up or else I'd jump some pins and try.

0693W000008yPUrQAM.pngThis is from the AN2606 Application note and mentions both pin sets for the STM32F09xxx device bootloader.

0693W000008yPVuQAM.pngThis is from the STM32F091xC  data sheet. It only mentions PA14/PA15.

Does anyone have any idea which one is correct? Could you use both pin sets for UART2 to talk to the bootloader? Or only the PA14,PA15 set?

Thank you for your help.

1 ACCEPTED SOLUTION

Accepted Solutions
Imen.D
ST Employee

Hello @MFord.1​ ,

Both PA2/PA3 & PA14/PA15 can be used for USART2 as on AN2606.

I'm checking the DS and I will forward your feedback internally to update it.

 Imen

When your question is answered, please close this topic by clicking "Accept as Solution".
Thanks
Imen

View solution in original post

8 REPLIES 8

Not a part I'm using.

I will note that the input pins are initially fed to a TIM to measure the baud via the 0x7F bit pattern. Once it sees this it should switch to the appropriate pairs and emit the response pattern.

You could disassemble the ROM code and check what it is doing, and on which pins.

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

Hello @MFord.1​ ,

Both PA2/PA3 & PA14/PA15 can be used for USART2 as on AN2606.

I'm checking the DS and I will forward your feedback internally to update it.

 Imen

When your question is answered, please close this topic by clicking "Accept as Solution".
Thanks
Imen

Thank you Imen!

I just wanted to clarify that you mean both PA2/PA3 and PA14/PA15 can be used to activate/talk to the bootloader, correct? I know they can both be used for USART2 in general.

Thank you again.

Yes, that's correct.

Imen

When your question is answered, please close this topic by clicking "Accept as Solution".
Thanks
Imen

Hello.

MFord.1

I am also working of project which involves STM32H723 and STM32H745 firmware update vai UART.

I am getting response 0x79 from STM bootloader for sync byte 0x79, but after that bootloader is not responding to any further commands. All I get is 0xFF in response. I have referred UART bootloader programming document.

It would be a big help to me if I could get a look at your UART boot mode communication code.

Thank you.

I can't share any code as it is proprietary.

What do you get if you send a basic version command? I believe its an "0x00 0xFF". Also, are you using even parity?

Hi MFord.1 (Community Member)

Earlier as I have mentioned that I am getting response for synchronize byte 0x7F, it was actually an error value, because i was using arduino's software serial and there is no way to get the UART data frame with even parity.

But now I am using another STM controller STM32L432KC with

Baud rate I have tried from 1200 to 115200.

1 - stop bit

9 bit data ( including parity ) as this is the only configure option available in STM32CubeIDE.

Even Parity enable.

1 - stop bit.

as host controller to access flash memory ofSTM32H723ZG controller.

I have application code running in STM32H732ZG controller which toggles the LED and put the received byte on UART3 PD9_RX pin over UART3 TX pin PD8, this is to verify that UART RX TX connection are properly connected.

Now, by holding Boot0 pin HIGH as per pattern_10 for STM32H7xxx series from boot loader document. I am providing reset condition to STM32H723ZG controller and controller starts to execute bootloader. (This is confirmed because SPI boot commands are working , SPI connections are removed after testing )

Do I need to connect RTS and CTS while communicating in UART Boot mode ?

On sending 0x7F byte with some delay over UART3 after reset , I am receiving some response from STM32H723ZG controller , but its not at same speed as synchronize byte , its something garbage pulses as can be seen on logic analyzer, ill share the screenshot soon.

More over on connecting STM32H723Zg with cube programmer , there also its not working in UART mode.

Errror : Activating device: KO. Please, verify the boot mode configuration and check the serial port configuration. Reset your device then try again...

Is the issue in cube programmer UART mode ?

Thank you .

Vaibhav.

If you can tap into the UART pins on your target board, I would recommend using a terminal window configured to 115200, Even parity, 8 data bits, and 1 stop bit to try and "manually" talk to the bootloader. If you still cannot get responses, you have isolated your problem to just one chip.

You could use something like this:

https://www.ftdichip.com/Support/Documents/DataSheets/Cables/DS_TTL-232R_CABLES.pdf

To talk to your chip from a laptop and terminal window.

To answer your question, I have been able to talk to the bootloader without RTS and CTS.