error using STM32G491CET6
Open source flash program for STM32 using the ST serial bootloader
Brought to you by:
tormod
I'm trying to use stm32flash from a raspberry to update a stm32g491x MCU via serial but I get this error from the application
pi@raspberrypi:~ $ sudo stm32flash -w OxyMonitor_rev11.hex -b 38400 /dev/ttyAMA0
stm32flash 0.7
http://stm32flash.sourceforge.net/
Using Parser : Intel HEX
Location : 0x8000000
Size : 47980
Interface serial_posix: 38400 8E1
GET returns unknown commands (0x 8)
Unknown/unsupported device (Device ID: 0x8079)
Anonymous
Can you please try with a USB-UART dongle, so that we can rule out any issue with the Raspberry serial port?
Thanks for reply
this using USB-UART dongle
Try
-b 115200
for some reason if i try to use an high baudrate, my mcu doesn't enter in boot mode...
look at this ( https://community.st.com/s/question/0D53W00001PvxvwSAB/stm32cubeprogrammer-connection-over-uart-error )
in fact if I set baudrate 38400 I get this error
and if i try to use 115200 as boudrate i get this,
Last edit: Enrico Razzaboni 2022-03-30
This is from the errata of this chip:
I don't know which baud rates lead to 8 or 16. This would affect noisy lines. Is this a custom designed board or a STM dev board?
Does it work with any other tool for programming over serial? Did you test several chips, or could it be a broken unit?
I'm using a custom board.
i can load firmware over serial with Stm32CubeProgrammer. i've tested with more the one micro
Can you please try the patch in https://sourceforge.net/p/stm32flash/tickets/134/#1dd4 which gives more debug information?
I also remember seeing an issue where one model often would introduce extra zero bytes on the line, but I couldn't find it now. Also there the Cube programmer had a workaround for it.
Using boudrate 38400 i get this
i've tried with a lower baudrate and it works... at this point i think is my harware issue.
thank you for the help
Did the Stm32CubeProgrammer also use a very low baud rate?
You can use SWD to program a test program onto it, e.g. a test program that simply sets up the serial port and echoes RX back to TX. Then you can check if the serial line is reliable.
And if you have an oscilloscope, check the waveforms and noise level. And sometimes the RX and TX connections are good but the ground connection has been left out...
i've checked and on micro side, in Tx line there is a lot of noise.
this should be caused by a hardware peculiarity, on the same serial i can communicate with two micro
Diff:
Thanks for following up. Closing this then.