diff --git a/Jenkinsfile b/Jenkinsfile index 1adc1fad54..60fb7a8b29 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -3,7 +3,7 @@ def boards_to_build_1 = ["LoPy_868", "WiPy"] def boards_to_build_2 = ["LoPy_915", "SiPy"] def boards_to_build_3 = ["FiPy_868", "GPy" , "LoPy4_868"] def boards_to_build_4 = ["FiPy_915" , "LoPy4_915"] -def boards_to_test = ["FiPy_868"] +def boards_to_test = ["FiPy_868", "LoPy_868"] def remote_node = "UDOO" node { @@ -80,16 +80,8 @@ node { stage ('Test'){ def parallelTests = [:] - for (x in boards_to_test) { - def name = x - def board_name = name.toUpperCase() - if (board_name == "LOPY_868" || board_name == "LOPY_915") { - board_name = "LOPY" - } - if (board_name == "FIPY_868" || board_name == "FIPY_915") { - board_name = "FIPY" - } - parallelTests[board_name] = testBuild(board_name) + for (board_name in boards_to_test) { + parallelTests[board_name] = testBuild(board_name.toUpperCase()) } parallel parallelTests } @@ -100,11 +92,11 @@ node { sleep(5) //Delay to skip all bootlog dir('tests') { timeout(30) { - sh '''./run-tests --target=esp32-''' + name + ''' --device /dev/serial/by-id/usb-Pycom_Pytrack_Py000000-if00''' + sh '''./run-tests --target=esp32-''' + name + ''' --device /dev/''' +name } } - sh 'python esp32/tools/pypic.py --port /dev/serial/by-id/usb-Pycom_Pytrack_Py000000-if00 --enter' - sh 'python esp32/tools/pypic.py --port /dev/serial/by-id/usb-Pycom_Pytrack_Py000000-if00 --exit' + sh 'python esp32/tools/pypic.py --port /dev/' + name +' --enter' + sh 'python esp32/tools/pypic.py --port /dev/' + name +' --exit' } } } @@ -118,11 +110,11 @@ def flashBuild(name) { unstash 'esp32Tools' unstash 'tests' unstash 'tools' - sh 'python esp32/tools/pypic.py --port /dev/serial/by-id/usb-Pycom_Pytrack_Py000000-if00 --enter' - sh 'esp-idf/components/esptool_py/esptool/esptool.py --chip esp32 --port /dev/serial/by-id/usb-Pycom_Pytrack_Py000000-if00 --baud 921600 erase_flash' - sh 'python esp32/tools/pypic.py --port /dev/serial/by-id/usb-Pycom_Pytrack_Py000000-if00 --enter' - sh 'esp-idf/components/esptool_py/esptool/esptool.py --chip esp32 --port /dev/serial/by-id/usb-Pycom_Pytrack_Py000000-if00 --baud 921600 --before no_reset --after no_reset write_flash -z --flash_mode dio --flash_freq 80m --flash_size detect 0x1000 esp32/build/'+ name +'/release/bootloader/bootloader.bin 0x8000 esp32/build/'+ name +'/release/lib/partitions.bin 0x10000 esp32/build/'+ name +'/release/appimg.bin' - sh 'python esp32/tools/pypic.py --port /dev/serial/by-id/usb-Pycom_Pytrack_Py000000-if00 --exit' + sh 'python esp32/tools/pypic.py --port /dev/' + name +' --enter' + sh 'esp-idf/components/esptool_py/esptool/esptool.py --chip esp32 --port /dev/' + name +' --baud 921600 erase_flash' + sh 'python esp32/tools/pypic.py --port /dev/' + name +' --enter' + sh 'esp-idf/components/esptool_py/esptool/esptool.py --chip esp32 --port /dev/' + name +' --baud 921600 --before no_reset --after no_reset write_flash -z --flash_mode dio --flash_freq 80m --flash_size detect 0x1000 esp32/build/'+ name +'/release/bootloader/bootloader.bin 0x8000 esp32/build/'+ name +'/release/lib/partitions.bin 0x10000 esp32/build/'+ name +'/release/appimg.bin' + sh 'python esp32/tools/pypic.py --port /dev/' + name +' --exit' } } } @@ -139,6 +131,7 @@ def boardBuild(name) { } def app_bin = name.toLowerCase() + '.bin' return { + release_dir = "${JENKINS_HOME}/release/${JOB_BASE_NAME}" sh '''export PATH=$PATH:/opt/xtensa-esp32-elf/bin; export IDF_PATH=${WORKSPACE}/esp-idf; cd esp32; @@ -158,15 +151,15 @@ def boardBuild(name) { export PYCOM_VERSION=$(cat ../../../pycom_version.h |grep SW_VERSION_NUMBER|cut -d\\" -f2); export GIT_TAG=$(git rev-parse --short HEAD); mkdir -p firmware_package; - mkdir -p /var/lib/jenkins/release/\$PYCOM_VERSION/\$GIT_TAG; + mkdir -p '''+ release_dir + '''/\$PYCOM_VERSION/\$GIT_TAG; cd firmware_package; cp ../bootloader/bootloader.bin .; - mv ../application.elf /var/lib/jenkins/release/\$PYCOM_VERSION/\$GIT_TAG/''' + name + '''-\$PYCOM_VERSION-application.elf; + mv ../application.elf ''' + release_dir + '''/\$PYCOM_VERSION/\$GIT_TAG/''' + name + '''-\$PYCOM_VERSION-application.elf; cp ../appimg.bin .; cp ../lib/partitions.bin .; cp ../../../../boards/''' + name_short + '''/''' + name_u + '''/script .; cp ../''' + app_bin + ''' .; - tar -cvzf /var/lib/jenkins/release/\$PYCOM_VERSION/\$GIT_TAG/''' + name + '''-\$PYCOM_VERSION.tar.gz appimg.bin bootloader.bin partitions.bin script ''' + app_bin + tar -cvzf ''' + release_dir + '''/\$PYCOM_VERSION/\$GIT_TAG/''' + name + '''-\$PYCOM_VERSION.tar.gz appimg.bin bootloader.bin partitions.bin script ''' + app_bin } } diff --git a/README.md b/README.md index 6f0be435ef..e241aa5ec9 100644 --- a/README.md +++ b/README.md @@ -59,15 +59,15 @@ the Espressif website: - for 64-bit Linux:: - https://dl.espressif.com/dl/xtensa-esp32-elf-linux64-1.22.0-73-ge28a011-5.2.0.tar.gz + https://dl.espressif.com/dl/xtensa-esp32-elf-linux64-1.22.0-80-g6c4433a-5.2.0.tar.gz - for 32-bit Linux:: - https://dl.espressif.com/dl/xtensa-esp32-elf-linux32-1.22.0-73-ge28a011-5.2.0.tar.gz + https://dl.espressif.com/dl/xtensa-esp32-elf-linux32-1.22.0-80-g6c4433a-5.2.0.tar.gz - for Mac OS: - https://dl.espressif.com/dl/xtensa-esp32-elf-osx-1.22.0-73-ge28a011-5.2.0.tar.gz + https://dl.espressif.com/dl/xtensa-esp32-elf-osx-1.22.0-80-g6c4433a-5.2.0.tar.gz To use it, you will need to update your ``PATH`` environment variable in ``~/.bash_profile`` file. To make ``xtensa-esp32-elf`` available for all terminal sessions, add the following line to your ``~/.bash_profile`` file:: @@ -105,6 +105,20 @@ By default the firmware is built for the WIPY2: $ make TARGET=app $ make flash +You can change the board type by using the BOARD variable: + + $ cd esp32 + $ make BOARD=GPY clean + $ make BOARD=GPY TARGET=boot + $ make BOARD=GPY TARGET=app + $ make flash + +We currently support the following BOARD types: + + WIPY LOPY SIPY GPY FIPY LOPY4 + +For LoRa, you may need to specify the `LORA_BAND` as explained below. + To specify a serial port other than /dev/ttyUSB0, use ESPPORT variable: $ # On MacOS @@ -114,7 +128,11 @@ To specify a serial port other than /dev/ttyUSB0, use ESPPORT variable: $ # On linux $ # make ESPPORT=/dev/ttyUSB1 flash -To build and flash your LoPy for the default region (868 MHz): +To flash at full speed, use ESPSPEED variable: + + $ make ESPSPEED=921600 flash + +To build and flash a LoPy for the default region (868 MHz): $ # LORA_BAND defaults to USE_BAND_868 $ cd esp32 @@ -124,20 +142,16 @@ To build and flash your LoPy for the default region (868 MHz): $ make BOARD=LOPY flash -or for 915MHz regions: +For 915MHz regions add the `LORA_BAND=USE_BAND_915` variable: $ cd esp32 - $ make BOARD=LOPY LORA_BAND=USE_BAND_915 clean + $ make BOARD=LOPY LORA_BAND=USE_BAND_915 clean $ make BOARD=LOPY LORA_BAND=USE_BAND_915 TARGET=boot $ make BOARD=LOPY LORA_BAND=USE_BAND_915 TARGET=app $ make BOARD=LOPY LORA_BAND=USE_BAND_915 flash -or the SiPy: - - $ cd esp32 - $ make BOARD=SIPY TARGET=boot - $ make BOARD=SIPY TARGET=app - $ make BOARD=SIPY flash +The above also applies to the FiPy and LoPy4 -Make sure that your board is placed into programming mode, otherwise flahing will fail. -To do this, connect ``P2`` to ``GND`` and then reset the board. +Make sure that your board is placed into programming mode, otherwise flashing will fail.
+PyTrack and PySense boards will automatically switch into programming mode (currently supported on MacOS and Linux only!)
+Expansion Board 2.0 users, please connect ``P2`` to ``GND`` and then reset the board.