Page 1 of 1

Painless geany editing of SD files for PYBv1.1

Posted: Tue Dec 04, 2018 4:23 pm
by mplichota
My host is a Raspberry Pi running raspian. I keep master copies of the code destined for the target in ~/uPy.

The script to run the console interface is in ~/bin/uPcomm:
[code]
#!/bin/sh
# connect to uPy board
screen /dev/ttyACM0
[/code]

The script to edit the local copy of 1 file and copy it to the target is in ~/bin/uPcomm:
[code]
#!/bin/sh
# edit and sync 1 source file for the uPy board
# the uPy board (PYBv1.1) SD card must be mounted
uPYBOARD_MNT=/media/pi/F980-F79B # Rasperry Pi mount point
cd ~/uPy
geany $1 # edit, save, close window, quit
xmessage -nearmouse "Quit any running uPy board program, then soft reset the uPy board by sending a Ctrl-d" 2> /dev/null
cp $1 $uPYBOARD_MNT
sync -d $uPYBOARD_MNT/$1
[/code]

My policy is to always have a uSD device inserted on the target, so I have not tested this using the on-chip /flash directory.