kopia lustrzana https://github.com/peterhinch/micropython-samples
Improvements to fastbuild scripts
rodzic
fca404821b
commit
0b22d8c057
|
@ -5,14 +5,19 @@ then
|
||||||
make clean
|
make clean
|
||||||
esptool.py --port /dev/ttyUSB0 erase_flash
|
esptool.py --port /dev/ttyUSB0 erase_flash
|
||||||
fi
|
fi
|
||||||
if make -j 8
|
if make -j 8 axtls
|
||||||
then
|
then
|
||||||
sleep 1
|
if make -j 8
|
||||||
esptool.py --port /dev/ttyUSB0 --baud 115200 write_flash --verify --flash_size=detect -fm dio 0 firmware-combined.bin
|
then
|
||||||
cd -
|
sleep 1
|
||||||
sleep 1
|
esptool.py --port /dev/ttyUSB0 --baud 115200 write_flash --verify --flash_size=detect -fm dio 0 build/firmware-combined.bin
|
||||||
rsusb # alias rsusb='rshell -p /dev/pyboard --editor nano -p /dev/ttyUSB0'
|
cd -
|
||||||
|
sleep 1
|
||||||
|
rshell -p /dev/ttyUSB0 --editor nano
|
||||||
|
else
|
||||||
|
echo Build failure
|
||||||
|
fi
|
||||||
else
|
else
|
||||||
echo Build failure
|
echo Axtls build failure
|
||||||
fi
|
fi
|
||||||
|
cd -
|
||||||
|
|
|
@ -2,8 +2,10 @@
|
||||||
# Update MicroPython source and prepare for build
|
# Update MicroPython source and prepare for build
|
||||||
|
|
||||||
cd /mnt/qnap2/data/Projects/MicroPython/micropython/
|
cd /mnt/qnap2/data/Projects/MicroPython/micropython/
|
||||||
|
echo Working...
|
||||||
git checkout master
|
git checkout master
|
||||||
git pull origin master
|
git pull origin master
|
||||||
|
git submodule update --init
|
||||||
cd mpy-cross
|
cd mpy-cross
|
||||||
make clean
|
make clean
|
||||||
make -j 8
|
make -j 8
|
||||||
|
@ -13,3 +15,9 @@ make BOARD=PYBV10 clean
|
||||||
make BOARD=PYBLITEV10 clean
|
make BOARD=PYBLITEV10 clean
|
||||||
cd ../esp8266
|
cd ../esp8266
|
||||||
make clean
|
make clean
|
||||||
|
cd ../unix
|
||||||
|
make axtls
|
||||||
|
# If you're going to enable deplibs: see micropython/README
|
||||||
|
#make deplibs
|
||||||
|
make
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,8 @@
|
||||||
# requires pyb_check
|
# requires pyb_check
|
||||||
# Also requires the pyboard.py utility to be on the path (micropython/tools/pyboard.py)
|
# Also requires the pyboard.py utility to be on the path (micropython/tools/pyboard.py)
|
||||||
|
|
||||||
DIRECTORY='/mnt/qnap2/data/Projects/MicroPython/micropython/stmhal'
|
export MPDIR='/mnt/qnap2/data/Projects/MicroPython/micropython'
|
||||||
|
export MPDEVICE='/dev/pyboard'
|
||||||
BOARD=""
|
BOARD=""
|
||||||
if pyb_check PYBV11
|
if pyb_check PYBV11
|
||||||
then
|
then
|
||||||
|
@ -22,7 +23,7 @@ echo Building for $BOARD
|
||||||
|
|
||||||
if [ $BOARD ]
|
if [ $BOARD ]
|
||||||
then
|
then
|
||||||
cd $DIRECTORY
|
cd $MPDIR/stmhal
|
||||||
if [ $# -eq 1 ] && [ $1 = "--clean" ]
|
if [ $# -eq 1 ] && [ $1 = "--clean" ]
|
||||||
then
|
then
|
||||||
make BOARD=$BOARD clean
|
make BOARD=$BOARD clean
|
||||||
|
|
|
@ -1,15 +1,21 @@
|
||||||
#!/usr/bin/env python
|
#!/usr/bin/python3
|
||||||
# Edit this to match the location of micropython/tools and the Pyboard device
|
|
||||||
|
# Called from buildpyb
|
||||||
|
# Put pyboard into DFU mode.
|
||||||
|
|
||||||
import sys
|
import sys
|
||||||
sys.path.append('/mnt/qnap2/data/Projects/MicroPython/micropython/tools')
|
import os
|
||||||
|
mp = os.getenv('MPDIR')
|
||||||
|
device = os.getenv('MPDEVICE')
|
||||||
|
sys.path.append(''.join((mp, '/tools')))
|
||||||
import pyboard
|
import pyboard
|
||||||
def main():
|
def main():
|
||||||
pyb=pyboard.Pyboard('/dev/pyboard')
|
pyb=pyboard.Pyboard(device)
|
||||||
pyb.enter_raw_repl()
|
pyb.enter_raw_repl()
|
||||||
try:
|
try:
|
||||||
pyb.exec_raw('pyb.bootloader()')
|
pyb.exec_raw('pyb.bootloader()')
|
||||||
except:
|
print('Failed to enter DFU mode')
|
||||||
|
except Exception: # It will throw one!
|
||||||
pass
|
pass
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
|
|
|
@ -7,17 +7,23 @@
|
||||||
|
|
||||||
import sys
|
import sys
|
||||||
import os, os.path
|
import os, os.path
|
||||||
|
mp = os.getenv('MPDIR')
|
||||||
|
sys.path.append(''.join((mp, '/tools')))
|
||||||
import pyboard
|
import pyboard
|
||||||
device = '/dev/pyboard'
|
|
||||||
errmsg = 'Must supply board type PYBV10 PYBV11 PYBLITEV10'
|
errmsg = 'Must supply board type PYBV10 PYBV11 PYBLITEV10'
|
||||||
d = {'PYBV11' : b'PYBv1.1', 'PYBV10' : b'PYBv1.0', 'PYBLITEV10' : b'PYBLITEv1.0'}
|
d = {'PYBV11' : b'PYBv1.1', 'PYBV10' : b'PYBv1.0', 'PYBLITEV10' : b'PYBLITEv1.0'}
|
||||||
|
|
||||||
|
device = os.getenv('MPDEVICE')
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
if len(sys.argv) < 2:
|
if len(sys.argv) < 2:
|
||||||
print(errmsg)
|
print(errmsg)
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
if not os.path.exists(device):
|
if not os.path.exists(device):
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
pybd = pyboard.Pyboard('/dev/pyboard')
|
pybd = pyboard.Pyboard(device)
|
||||||
pybd.enter_raw_repl()
|
pybd.enter_raw_repl()
|
||||||
hardware = pybd.exec('import os; print(os.uname()[4].split(' ')[0])').strip()
|
hardware = pybd.exec('import os; print(os.uname()[4].split(' ')[0])').strip()
|
||||||
pybd.exit_raw_repl()
|
pybd.exit_raw_repl()
|
||||||
|
|
Ładowanie…
Reference in New Issue