Skip to main content
Visitor II
June 23, 2025
Solved

STM32G431 Bootloader

  • June 23, 2025
  • 4 replies
  • 1123 views

Hello , I'm using STM32G431RB, and I am trying to flash the MCU via UART1 using PA9 and PA10 pins but I can't make it work ..

I get an error like "Error: Activating device: KO. Please, verify the boot mode configuration and check the serial port configuration. Reset your device then try again... "

Serial port configuration = 9600 8e1 (but it's the same thing with other baudrates)

i'm using STM32Cube Programmer , also I followed the instructions in AN2606 , the application note states that it should follow pattern 15 , as far as I can view the option bytes using the onboard ST-Link:

BOOT_LOCK(bit) = unchecked

Boot0(pin) = manually set high

nBoot1(bit) = checked

Boot0_SW(bit) = checked

The chip is mounted on a new PCB without any other connections than PA9, PA10, RCC_OSC_IN, RCC_OSC_OUT and Serial Wire for debugging.

Can someone help me?

Thanks to everyone in advance 

 

 

 

 

    This topic has been closed for replies.
    Best answer by Karl Yamashita

    Besides USART 1, PA9 and PA10

    You can also use USART2, PA2 and PA3

    as well as USART3, PC10 and PC11

    You haven't shown your schematic in full use, so we don't know if you can start swapping pins/peripherals around.

     

    4 replies

    Super User
    June 23, 2025

    Is it powered? Correct orientation? VCAP pin voltage correct if present?

    Perhaps show the schematic and a picture of the setup.

    Stefano1Author
    Visitor II
    June 23, 2025

    This is the schematich

    schematic.pngconfig.png

    Chip receives on PC5 and transmits on PC4 (USART1).

    Boot0(pin) manually set high before reset.

     

    Super User
    June 23, 2025

    > I'm using STM32G431RB, and I am trying to flash the MCU via UART1 using PA9 and PA10 pins but I can't make it work ..

    PA9/PA10 don't appear to be connected to anything in the schematic.

    Schematic shows an X on some pins but not others which seems suspicious.

     

    > Chip receives on PC5 and transmits on PC4 (USART1).

    So are you using PC4/PC5 or PA9/PA10? The bootloader does not support PC4/PC5.

    Stefano1Author
    Visitor II
    June 23, 2025

    I tried with PC4 and PC5 (USART1).
    Considering I'm using STM32G431RB, which pins should I use?

    Super User
    June 23, 2025

    > Considering I'm using STM32G431RB, which pins should I use?

    Since PA9/PA10 are supported by the bootloader, you should use PA9/PA10.

     

    Why does your opening post say you are using PA9/PA10 if you are not using them?

    Stefano1Author
    Visitor II
    June 23, 2025

    I said PA9 and PA10 by mistake.

    The chip uses UART1 on PC4 and PC5 to communicate with another peripheral and it works perfectly.
    It uses a lot of I/O, SPI and I²C.
    The application note for the an2606 says I can use USART1, USART2, USART3, ... this fooled me.

    Can I use only PA9 and PA10?

     

    Super User
    June 23, 2025

    Only the pins listed in AN2606 are supported. In the case of USART1, only PA9/PA10 are supported. You cannot use PC4/PC5.

    Here is the relevant table in AN2606 for your chip:

    TDK_0-1750699356379.png

     

    Graduate II
    June 23, 2025

    Besides USART 1, PA9 and PA10

    You can also use USART2, PA2 and PA3

    as well as USART3, PC10 and PC11

    You haven't shown your schematic in full use, so we don't know if you can start swapping pins/peripherals around.

     

    Stefano1Author
    Visitor II
    June 25, 2025

    Hi,

    using PC10 and PC11 everything works perfectly.