2025-04-08 5:04 AM - last edited on 2025-04-12 6:55 AM by mƎALLEm
Hello,
I am designing a card that will use an STM32G474QET6TR and I want to program it using USART.
The card will use a USB to USART converter (FTDI4232HL).
The Rx and Tx of the FTDI are connected to pin PA2 and PA3 respectively, as I found in AN2606.
My first question is how can I tell my MCU that it is supposed to use bootloader mode ? and Which pattern would be better to use ? Also, regarding the pattern, how do I tell the MCU that nBoot1(bit) is supposed to be a 1 or a 0 ?
I am quite lost regarding how the bootloader works and any docs I've read as made me even more lost ?? So any help provided will be most welcome.
Thank you very much
Solved! Go to Solution.
2025-04-18 4:26 AM
Hello @EliazLB;
According t the BOOT_LOCK, nBOOT1, nBOOT0, BOOT0 nSWBOOT0 configurations, the MCU operates on the main Flash memory, boot from system memory...
For the STM32G474, the bootloader is activated by applying Pattern 14.
You can used the STM32CubeProgrammer to configure the option byte like as nBOOT0, nSWBOOT0 and nBOOT1.
May be this MOOC can help you to to stat with STM32 Boot: STM32 boot and startup tips - 1 Empty check mechanism - YouTube.
I hope this help you.
Thank you.
Kaouthar
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.
2025-04-18 4:26 AM
Hello @EliazLB;
According t the BOOT_LOCK, nBOOT1, nBOOT0, BOOT0 nSWBOOT0 configurations, the MCU operates on the main Flash memory, boot from system memory...
For the STM32G474, the bootloader is activated by applying Pattern 14.
You can used the STM32CubeProgrammer to configure the option byte like as nBOOT0, nSWBOOT0 and nBOOT1.
May be this MOOC can help you to to stat with STM32 Boot: STM32 boot and startup tips - 1 Empty check mechanism - YouTube.
I hope this help you.
Thank you.
Kaouthar
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.
2025-04-18 5:11 AM
Simply new MCU use automatic line 3 in pattern table. After first programm loaded (any way) only lines 1,2 work. Basic factory config is for line 1. Set boot pin high externaly and reset or power on. Open programmer select COM when USART is used and click connect.
2025-04-18 5:24 AM
Fy,
To tell an MCU you have to start with the boot loader, this one must be configured as following AN2606 and pattern 14 in your case. From an hardware point of view the selection with pattern 14 allows 2 cases where Boot0 (pin) must be tied to 1 ( Vcc. 0 being ground).
Assuming this fact the MCU starts directly under bootloader mode (with two cases; one bank or double bank organisation).
Using an FTDI USB to RS232 converter take care of using the same logical levels (3,3V).
By using a serial link you must be able to deal with the communication protocol as describe in AN3155. A serial link is subject to erronous bits, you'll have to deal with ACK/NACK.
For prototyping you could use a NUCLEO's board which integrates the USB to RS232 converter, and may be speed-up your developpment. The NUCLEO64's board gathers the USB converter with a common clock avoiding bits errors, and a wide capability to connect MCU's pins.
Best regards.
Butterfly
2025-04-18 6:26 AM
Thank you for the answer. I have a nucleo board to develop my software so i'll be able to try everything through it !