cancel
Showing results for 
Search instead for 
Did you mean: 

STM32G431 Flash from UART Problem

BG1
Senior

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 .

6 REPLIES 6
Javier1
Principal

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

we dont need to firmware by ourselves, lets talk

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 ..

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

0693W00000Y8thWQAR.png

we dont need to firmware by ourselves, lets talk

0693W00000Y8titQAB.png 

Maybe is worth to hook up an oscilloscope to take a look to your signal integrity

we dont need to firmware by ourselves, lets talk

I watch the voltages and they are pretty clear ..

BG1
Senior

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 ...?