diff --git a/fastbuild/buildesp b/fastbuild/buildesp index 161222b..0dd7361 100755 --- a/fastbuild/buildesp +++ b/fastbuild/buildesp @@ -5,14 +5,19 @@ then make clean esptool.py --port /dev/ttyUSB0 erase_flash fi -if make -j 8 +if make -j 8 axtls then - sleep 1 - esptool.py --port /dev/ttyUSB0 --baud 115200 write_flash --verify --flash_size=detect -fm dio 0 firmware-combined.bin - cd - - sleep 1 - rsusb # alias rsusb='rshell -p /dev/pyboard --editor nano -p /dev/ttyUSB0' + if make -j 8 + then + sleep 1 + esptool.py --port /dev/ttyUSB0 --baud 115200 write_flash --verify --flash_size=detect -fm dio 0 build/firmware-combined.bin + cd - + sleep 1 + rshell -p /dev/ttyUSB0 --editor nano + else + echo Build failure + fi else - echo Build failure + echo Axtls build failure fi - +cd - diff --git a/fastbuild/buildnew b/fastbuild/buildnew index 5079c7f..05ec94e 100755 --- a/fastbuild/buildnew +++ b/fastbuild/buildnew @@ -2,8 +2,10 @@ # Update MicroPython source and prepare for build cd /mnt/qnap2/data/Projects/MicroPython/micropython/ +echo Working... git checkout master git pull origin master +git submodule update --init cd mpy-cross make clean make -j 8 @@ -13,3 +15,9 @@ make BOARD=PYBV10 clean make BOARD=PYBLITEV10 clean cd ../esp8266 make clean +cd ../unix +make axtls +# If you're going to enable deplibs: see micropython/README +#make deplibs +make + diff --git a/fastbuild/buildpyb b/fastbuild/buildpyb index f76ceeb..b5a5771 100755 --- a/fastbuild/buildpyb +++ b/fastbuild/buildpyb @@ -4,7 +4,8 @@ # requires pyb_check # 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="" if pyb_check PYBV11 then @@ -22,7 +23,7 @@ echo Building for $BOARD if [ $BOARD ] then - cd $DIRECTORY + cd $MPDIR/stmhal if [ $# -eq 1 ] && [ $1 = "--clean" ] then make BOARD=$BOARD clean diff --git a/fastbuild/pyb_boot b/fastbuild/pyb_boot old mode 100644 new mode 100755 index 4feeede..83b2128 --- a/fastbuild/pyb_boot +++ b/fastbuild/pyb_boot @@ -1,15 +1,21 @@ -#!/usr/bin/env python -# Edit this to match the location of micropython/tools and the Pyboard device +#!/usr/bin/python3 + +# Called from buildpyb +# Put pyboard into DFU mode. 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 def main(): - pyb=pyboard.Pyboard('/dev/pyboard') + pyb=pyboard.Pyboard(device) pyb.enter_raw_repl() try: pyb.exec_raw('pyb.bootloader()') - except: + print('Failed to enter DFU mode') + except Exception: # It will throw one! pass if __name__ == "__main__": diff --git a/fastbuild/pyb_check b/fastbuild/pyb_check index 223a4aa..cf4bc98 100755 --- a/fastbuild/pyb_check +++ b/fastbuild/pyb_check @@ -7,17 +7,23 @@ import sys import os, os.path +mp = os.getenv('MPDIR') +sys.path.append(''.join((mp, '/tools'))) import pyboard -device = '/dev/pyboard' + errmsg = 'Must supply board type PYBV10 PYBV11 PYBLITEV10' d = {'PYBV11' : b'PYBv1.1', 'PYBV10' : b'PYBv1.0', 'PYBLITEV10' : b'PYBLITEv1.0'} + +device = os.getenv('MPDEVICE') + + def main(): if len(sys.argv) < 2: print(errmsg) sys.exit(1) if not os.path.exists(device): sys.exit(1) - pybd = pyboard.Pyboard('/dev/pyboard') + pybd = pyboard.Pyboard(device) pybd.enter_raw_repl() hardware = pybd.exec('import os; print(os.uname()[4].split(' ')[0])').strip() pybd.exit_raw_repl()