Hi!
I wanted to know: what is the best way to develop on pyboard? I mean, how do you edit your code, send it to pyboard, run it, correct it, re-test...?
Any advice welcome.
Developping on pyboard
Developping on pyboard
Frédéric
- Markus Gritsch
- Posts: 41
- Joined: Fri May 16, 2014 9:04 pm
Re: Developping on pyboard
I don't know if there is a "best" way, but I edit the code in my Editor of choice, save it to the virtual file system on the pyboard, press Ctrl+D in the micro-python serial terminal to soft-reset the board, press Ctrl+C to interrupt the running code and loop back to the editing step
I would be quite happy, if this actually would work all the time, but far too often the board locks up after pressing Ctrl+C and the only way to continue is a hard reset. This then makes it a lot more inconvenient, because I have to close the serial connection before pressing the reset button and re-open it after the hard-reset. It gets even worse when I forget to close the serial connection before pressing reset, because then the COM port is not available since it was held by the terminal, and I have to close the terminal and perform another hard-reset. Really annoying.
This type of hard fault is documentet here: http://micropython.org/doc/general But I wonder if it is ok that it happens from time to time when interrupting a running program, or if this is a bug...
I would be quite happy, if this actually would work all the time, but far too often the board locks up after pressing Ctrl+C and the only way to continue is a hard reset. This then makes it a lot more inconvenient, because I have to close the serial connection before pressing the reset button and re-open it after the hard-reset. It gets even worse when I forget to close the serial connection before pressing reset, because then the COM port is not available since it was held by the terminal, and I have to close the terminal and perform another hard-reset. Really annoying.
This type of hard fault is documentet here: http://micropython.org/doc/general But I wonder if it is ok that it happens from time to time when interrupting a running program, or if this is a bug...
Re: Developping on pyboard
So, you don't need to umount the virtual file system when doing a soft-reboot (Ctrl-D)? Changes are not lost?
Are such amovible devices mounted with sync option, under linux?
Are such amovible devices mounted with sync option, under linux?
Frédéric
- Markus Gritsch
- Posts: 41
- Joined: Fri May 16, 2014 9:04 pm
Re: Developping on pyboard
I use Windows 7 and there the virtual file system is shown as a removable disk in the explorer. I have no idea, how it behaves under Linux. Anyway, you could just try it and see for yourself, if changes to the file you make in your editor have any effect when immediately soft-resetting the board.
-
- Posts: 19
- Joined: Mon Jun 09, 2014 1:54 pm
Re: Developping on pyboard
The same process works fine on Linux, and the filesystem remains mounted throughout. You only need to umount if you're doing a hard-reset.
Re: Developping on pyboard
So FAT file systems (under both Windows 7 and linux) tend to get written to fairly quickly and not keep alot of cached data around.fma wrote:So, you don't need to umount the virtual file system when doing a soft-reboot (Ctrl-D)? Changes are not lost?
Are such amovible devices mounted with sync option, under linux?
For large files, its pretty easy to interrupt things while cached data is still unwritten, but for small files, you'd have to be pretty quick.
Obviously, the safest way is to eject on the host OS, but you can probably get away without it if there a couple of seconds between writing the file and reseting uPy.
Under linux, I see:
Code: Select all
/dev/sdc1 on /media/dhylands/4421-0002 type vfat (rw,nosuid,nodev,uid=35029,gid=1001,shortname=mixed,dmask=0077,utf8=1,showexec,flush,uhelper=udisks2)
If set, the filesystem will try to flush to disk more early than normal. Not set by default.