Hi, after a lot of tests, now it works. i've added a sleep of 2 seconds after set reset pin to high
i don't see any difference, except the reply of stm32 micro
it's the .sh file with gpio and sleep command
here it is
stm32flash never failed from the command line. my host is not at limit (3/6% cpu)
Hi, i've tried also to run stm32 from bash file, and run bash file from qt. but i've the same result. bash code: #!/bin/bash PATH_GPIO_EXP="/sys/class/gpio/export" PATH_GPIO_DIR="/sys/class/gpio" RESET="5" C_BOOT="4" P_BOOT="3" sudo echo 0 > $PATH_GPIO_DIR/gpio$RESET/value sudo echo 1 > $PATH_GPIO_DIR/gpio$C_BOOT/value sudo echo 0 > $PATH_GPIO_DIR/gpio$P_BOOT/value /bin/sleep 4 sudo echo 1 > $PATH_GPIO_DIR/gpio$RESET/value sudo stm32flash -w $1 /dev/ttyUSB0
yes, i've the same issue
ok, here it is
ok, what you need?
stm32flash is running on embedded device with Yocto. you see windows screen because I've created a serial sniffer to watch what's going on. i attach a photo to undestand better
i've looked at the serial communication with serial sniffer. this is the result
no it's impossible :(
edit: there was an error on my code. QProcess *loadFirmware = new QProcess(); loadFirmware->start("stm32flash", QStringList() << "-b" << "9600" << "-w" << path << "/dev/ttyUSB0"); loadFirmware->waitForFinished(-1); qDebug() << loadFirmware->readAllStandardError(); qDebug() << loadFirmware->readAllStandardOutput(); output: "Failed to init device after retry.\n" "stm32flash 0.7\n\nhttp://stm32flash.sourceforge.net/\n\nUsing Parser : Raw BINARY\nSize : 301172\nInterface serial_posix: 9600 8E1\n\n" why...
ok i've tried this morning with this syntax and something change. but i've another error. code: QProcess *loadFirmware = new QProcess(); loadFirmware->start("stm32flash", QStringList() << "-b" << "9600" << "-w" << path << " /dev/ttyUSB0"); loadFirmware->waitForFinished(-1); qDebug() << loadFirmware->readAllStandardError(); qDebug() << loadFirmware->readAllStandardOutput(); output: "Error probing interface \"serial_posix\"\nCannot handle device \" /dev/ttyUSB0\"\nFailed to open port: /dev/ttyUSB0\n"...
but if you're sure that it not depends on your software, i'll find another solution
yes i've understood it. but id doesn't change.
yes, one example: gpio5.start("bash", QStringList() << "-c" << "echo 1 > /sys/class/gpio/gpio5/value");
are you sure that has nothing to do with stm32flash? because all other process works...
Error running stm32flash with QProcess (qt)
i've tried with a lower baudrate and it works... at this point i think is my harware issue. thank you for the help
Using boudrate 38400 i get this pi@raspberrypi:~ $ sudo stm32flash -w OxyMonitor_rev11.hex -b 38400 /dev/ttyUSB1 stm32flash 0.7 http://stm32flash.sourceforge.net/ Using Parser : Intel HEX Location : 0x8000000 Size : 47980 Interface serial_posix: 38400 8E1 written 1 bytes, starting with 0x7f read 1 bytes, starting with 0x79 written 2 bytes, starting with 0x01 read 1 bytes, starting with 0x79 read 3 bytes, starting with 0x31 read 2 bytes, starting with 0x00 read 1 bytes, starting with 0x79 written...
pi@raspberrypi:~ $ sudo stm32flash -w OxyMonitor_rev11.hex -b 115200 -c /dev/ttyUSB1 stm32flash 0.7 http://stm32flash.sourceforge.net/ Using Parser : Intel HEX Location : 0x8000000 Size : 47980 Interface serial_posix: 115200 8E1 written 2 bytes, starting with 0x01 read 1 bytes, starting with 0x79 read 3 bytes, starting with 0x31 read 1 bytes, starting with 0xf9 Got byte 0xf9 instead of ACK
I'm using a custom board. i can load firmware over serial with Stm32CubeProgrammer. i've tested with more the one micro
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 pi@raspberrypi:~ $ sudo stm32flash -w OxyMonitor_rev11.hex -b 38400 -c /dev/ttyUSB1 stm32flash 0.7 http://stm32flash.sourceforge.net/ Using Parser : Intel HEX Location : 0x8000000 Size : 47980 Interface serial_posix: 38400 8E1 GET returns unknown...
for some reason if i try to se 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 pi@raspberrypi:~ $ sudo stm32flash -w OxyMonitor_rev11.hex -b 38400 -c /dev/ttyUSB1 stm32flash 0.7 http://stm32flash.sourceforge.net/ Using Parser : Intel HEX Location : 0x8000000 Size : 47980 Interface serial_posix: 38400 8E1 GET returns unknown...
for some reason if i try to se 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 pi@raspberrypi:~ $ sudo stm32flash -w OxyMonitor_rev11.hex -b 38400 -c /dev/ttyUSB1 stm32flash 0.7 http://stm32flash.sourceforge.net/ Using Parser : Intel HEX Location : 0x8000000 Size : 47980 Interface serial_posix: 38400 8E1 GET returns unknown commands...
Thanks for reply this using USB-UART dongle pi@raspberrypi:~ $ sudo stm32flash -w OxyMonitor_rev11.hex -b 38400 /dev/ttyUSB1 stm32flash 0.7 http://stm32flash.sourceforge.net/ Using Parser : Intel HEX Location : 0x8000000 Size : 47980 Interface serial_posix: 38400 8E1 GET returns unknown commands (0xe3) Got byte 0x00 instead of ACK
error using STM32G491CET6