When I am trying to copy my script file to my Nucleo F401 with rshell, rshell hangs about 90% of the time... and I have to reboot the board holding the user button, and sometimes I even frustratingly hold the user-button even longer so the filesystem gets wiped.
It /seems/ this hanging might be related to the quality of the code. But I can't check the code on my laptop because it stops processing when it sees "import pyb" or "from pyb import Timer"... so what am I to do? I even just tried pasting my whole file into the rshell REPL... but it seems to miss characters and gets corrupted during paste so that doesn't work to test things.
Here is the command that crashes/hangs most of the time:
rshell --buffer-size=32 --port=/dev/ttyACM0 cp m2.py /flash/m2.py
(afterwards I would also try to copy a boot.py that opens m2.py... if the filesystem was just recently wiped)
Help! This is wasting sooo much of my time and making me super-frustrated
Is it possible to check code on laptop before flashing MCU?
Re: Is it possible to check code on laptop before flashing MCU?
When using rshell with a UART, make sure that you pass in --buffer-size=32 (by defailt it assume it's connected to usb and uses a 512 byte buffer). What's happening is that the Rx buffer on the 401 is getting overflowed during file processing and this cause things to hang since the host end thinks it sent all of the data and the receiving end is missing some data.
- pythoncoder
- Posts: 5956
- Joined: Fri Jul 18, 2014 8:01 am
- Location: UK
- Contact:
Re: Is it possible to check code on laptop before flashing MCU?
Er, Dave, if you re-read the original post he is using that argumentdhylands wrote:When using rshell with a UART, make sure that you pass in --buffer-size=32 ...
Peter Hinch
Index to my micropython libraries.
Index to my micropython libraries.
Re: Is it possible to check code on laptop before flashing MCU?
I've definitely had issues with trying to update boot.py and/or main.py using rshell. If there is a bug in either one then rshell will definitely stop working, but even when there isn't I've also seen some weird things.That one is really difficult to debug since boot.py/main.py is executed each time the raw repl is entered, and the processor is essentially soft reset for each raw repl command. rshell issues several raw repl commands for each command that you use.
- pythoncoder
- Posts: 5956
- Joined: Fri Jul 18, 2014 8:01 am
- Location: UK
- Contact:
Re: Is it possible to check code on laptop before flashing MCU?
I use rshell heavily: daily on all Pyboard variants with frequent copying of sometimes large files, both to flash and SD. I usually have a USB connection, but I've also extensively used a UART via an FTDI adaptor. When using the adaptor I use --buffer-size=32. As far as I can remember the current version has never suffered an inexplicable failure. My guess is that the issue may be specific to either your hardware or to the Nucleo F401 port.
Peter Hinch
Index to my micropython libraries.
Index to my micropython libraries.