Hello, I've been going around in circles for the past couple of hours trying to get this to work.
I've enabled serial port, disabled bluetooth, and done a loop test using picocom and a jumper link to confirm the serial port definitely works.
I have wired it correctly, referencing my own knowledge and several guides / other posts on here.
I put the device in boot0 mode too.
picocom does a successful loop test on /dev/serial0 when the link is over the GPIO UART pins, and of course stops when I pull the link.
whenever I run:
sudo stm32flash /dev/serial0
or any combination (and any port)
I always get:
Failed to set terminal flags
Error probing interface "serial_posix"
Cannot handle device "/dev/serial0"
Failed to open port: /dev/serial0
that said if I use rubbish, e.g. /dev/eoviergmio I get the same thing without 'Failed to set terminal flags'
I have tried looking around for references to "Failed to set terminal flags" without any luck.
I would greatly appreciate any insight on this.
Thanks,
Tom
Anonymous
a full prompt example with all details:
I've just inserted a USB-Serial, and /dev/ttyUSB0 does work when it's inserted - but we really need to use the internal serial.
Are you using the troublesome mini-UART or the other? https://www.raspberrypi.com/documentation/computers/configuration.html#mini-uart-and-cpu-core-frequency
Anyway, a workaround could be to configure the port using stty and then run stm32flash with -b 0.
to my understanding I am not using mini-UART. I disabled the bluetooth etc.
not familier with stty, will have to have a poke.
There is an example in the commit 48231f15 message:
There is one commit in git that helped for an issue on Raspberry 3 but I am not sure it is the same issue. Worth trying out latest git maybe.
https://sourceforge.net/p/stm32flash/tickets/146/
That is weird, but I cannot reproduce it:
Oh no, that is reproducing it! to clarify I only get 'Failed to set terminal flags' on existing ports.
Disregard that last comment, I read "same thing" but and didn't notice "without".
Managed to Resolve it
For future people having pains, the best config seems to be:
and remove the segment from cmdline.txt:
used ttyAMA0
I haven't tried using the gpio control flags as it seems it was depricated from the kernal, written my own using pinctrl for testing.
gpio7 is boot0
gpio27 is reset
Last edit: Thomas Williamson 2024-05-05
Thanks a lot for reporting back with the solution. I have added it to the Hints section in the wiki.