Skip to main content
Visitor II
January 23, 2023
Question

STM32G431 Flash from UART Problem

  • January 23, 2023
  • 2 replies
  • 3181 views

Hello , I'm using Nucleo-G431RB board , 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... "

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 , nSWBOOT0 comes unchecked so software decides if it should run starting from bootloader address .. My settings for UART are 9600 Baudrate , Even parity . NBOOT0 and NBOOT1 comes checked so it seems it is not applicable for any pattern to jump bootloader mode , So I tried setting NSWBOOT0 so it matches the pattern stated "BOOT_LOCK(bit)=0, Boot0(pin) = 1, nBoot1(bit) = 1 and nBoot0_SW(bit) = 1" , I manually tied BOOT0 to 3.3V and when I reset the MCU I can verify that it starts at bootloader mode , what makes me think like that is the observation on behaviour of some pins using scope , It is not the code running the user flash .. Also I can say that my UART com bridge is sending 0x7F but there is no response coming out of the MCU at all .. Where do I do the mistake .. any help would be appreciated .

    This topic has been closed for replies.

    2 replies

    Graduate II
    January 23, 2023

    did you checked the wiring is TX-RX RX-TX?

    Which USB-UART bridge are you using?

    Pa9 and PA10 are not connected to anything else in the nucleo board so it should be ok

    BG1Author
    Visitor II
    January 23, 2023

    It is one of those CP2102 using bridges , and yes I double and tripple checked . Besides I can communicate with the MCU with my user code ..

    Graduate II
    January 23, 2023

    your UART config should be okay also, did you set 8 bit and 1 stop bit?

    0693W00000Y8thWQAR.png

    BG1Author
    Visitor II
    January 23, 2023

    A question out of curiosity , as for the document RM0440 , it claims for the option byte ST production value to be 0xFFEF F8AA .. But for the NucleoG431RB board Option Byte value was read as 0xFBEF F8AA as default (nSWBOOT0 = 0 by default) ? So , how does one run it from the bootloader mode and flash it over UART1 very first time ...?