Skip to content
This repository has been archived by the owner on Sep 16, 2024. It is now read-only.

Commit

Permalink
Updated Jenkinsfile & README.md
Browse files Browse the repository at this point in the history
Support testing multiple on a single remote node
Updated toolversion, more concise build instructions
  • Loading branch information
Xykon committed Jan 28, 2018
1 parent 0786589 commit baa8c33
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 36 deletions.
37 changes: 15 additions & 22 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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
}
Expand All @@ -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'
}
}
}
Expand All @@ -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'
}
}
}
Expand All @@ -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;
Expand All @@ -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
}
}

Expand Down
42 changes: 28 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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::

Expand Down Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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.<br>
PyTrack and PySense boards will automatically switch into programming mode (currently supported on MacOS and Linux only!)<br>
Expansion Board 2.0 users, please connect ``P2`` to ``GND`` and then reset the board.

2 comments on commit baa8c33

@robert-hh
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For consistency, the flash line in the README example above (new line 114) should be:
make BOARD=GPY flash

@Xykon
Copy link
Member Author

@Xykon Xykon commented on baa8c33 Jan 31, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot... I've updated the README.md file.

Please sign in to comment.