Sorry, my wording was unclear. I was wanting to know whether anyone uses a terminal emulator to flash firmware (ymodem), instead of using ‘–serial’ or the python script. I’ve tried using Linux/minicom but could not get it to work; I’m abandoning that idea now.
I do, however, have another workaround for the problem of how to trigger ymodem mode on some distributions of Linux. Linux doesn’t always regard 28800 baud as a standard speed, which is needed to trigger ymodem mode, and it fails to set it.
I know some people on this forum are changing the firmware to use a different trigger speed, but here is another way.
Problem: on my Linux laptop (Centos), the python script fails:
[tim@c7 ~]$ python ymodem2.py /dev/ttyACM0 firmware.bin
Traceback (most recent call last):
"ymodem2.py", line 159, in <module>
"ymodem2.py", line 145, in ymodem
"/usr/lib/python2.7/site-packages/serial/serialutil.py", line 261, in
"/usr/lib/python2.7/site-packages/serial/serialposix.py", line 282,
"/usr/lib/python2.7/site-packages/serial/serialposix.py", line 417,
"/usr/lib/python2.7/site-packages/serial/serialposix.py", line 60, in
ValueError('Failed to set custom baud rate: %r' % baudrate)
ValueError: Failed to set custom baud rate: 28800
Workaround: I modified the python script to use current
ser = serial.Serial(port, baudrate=28800)
ser = serial.Serial(port)
To set the (non-standard) serial speed prior to invoking the python script it is necessary to call a Linux/C program that sets it using ‘ioctl’. I adapted some of the code at:
and named it ‘set28800.c’. I won’t reproduce the code here because it’s fairly straightforward to work out from the examples in the link.
Set the serial speed immediately prior to invoking the python script, like this:
./set28800 && sleep 1 && python ymodem2.py /dev/ttyACM0 firmware.bin