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

Commit baa8c33

Browse files
committed
Updated Jenkinsfile & README.md
Support testing multiple on a single remote node Updated toolversion, more concise build instructions
1 parent 0786589 commit baa8c33

File tree

2 files changed

+43
-36
lines changed

2 files changed

+43
-36
lines changed

Jenkinsfile

+15-22
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ def boards_to_build_1 = ["LoPy_868", "WiPy"]
33
def boards_to_build_2 = ["LoPy_915", "SiPy"]
44
def boards_to_build_3 = ["FiPy_868", "GPy" , "LoPy4_868"]
55
def boards_to_build_4 = ["FiPy_915" , "LoPy4_915"]
6-
def boards_to_test = ["FiPy_868"]
6+
def boards_to_test = ["FiPy_868", "LoPy_868"]
77
def remote_node = "UDOO"
88

99
node {
@@ -80,16 +80,8 @@ node {
8080

8181
stage ('Test'){
8282
def parallelTests = [:]
83-
for (x in boards_to_test) {
84-
def name = x
85-
def board_name = name.toUpperCase()
86-
if (board_name == "LOPY_868" || board_name == "LOPY_915") {
87-
board_name = "LOPY"
88-
}
89-
if (board_name == "FIPY_868" || board_name == "FIPY_915") {
90-
board_name = "FIPY"
91-
}
92-
parallelTests[board_name] = testBuild(board_name)
83+
for (board_name in boards_to_test) {
84+
parallelTests[board_name] = testBuild(board_name.toUpperCase())
9385
}
9486
parallel parallelTests
9587
}
@@ -100,11 +92,11 @@ node {
10092
sleep(5) //Delay to skip all bootlog
10193
dir('tests') {
10294
timeout(30) {
103-
sh '''./run-tests --target=esp32-''' + name + ''' --device /dev/serial/by-id/usb-Pycom_Pytrack_Py000000-if00'''
95+
sh '''./run-tests --target=esp32-''' + name + ''' --device /dev/''' +name
10496
}
10597
}
106-
sh 'python esp32/tools/pypic.py --port /dev/serial/by-id/usb-Pycom_Pytrack_Py000000-if00 --enter'
107-
sh 'python esp32/tools/pypic.py --port /dev/serial/by-id/usb-Pycom_Pytrack_Py000000-if00 --exit'
98+
sh 'python esp32/tools/pypic.py --port /dev/' + name +' --enter'
99+
sh 'python esp32/tools/pypic.py --port /dev/' + name +' --exit'
108100
}
109101
}
110102
}
@@ -118,11 +110,11 @@ def flashBuild(name) {
118110
unstash 'esp32Tools'
119111
unstash 'tests'
120112
unstash 'tools'
121-
sh 'python esp32/tools/pypic.py --port /dev/serial/by-id/usb-Pycom_Pytrack_Py000000-if00 --enter'
122-
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'
123-
sh 'python esp32/tools/pypic.py --port /dev/serial/by-id/usb-Pycom_Pytrack_Py000000-if00 --enter'
124-
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'
125-
sh 'python esp32/tools/pypic.py --port /dev/serial/by-id/usb-Pycom_Pytrack_Py000000-if00 --exit'
113+
sh 'python esp32/tools/pypic.py --port /dev/' + name +' --enter'
114+
sh 'esp-idf/components/esptool_py/esptool/esptool.py --chip esp32 --port /dev/' + name +' --baud 921600 erase_flash'
115+
sh 'python esp32/tools/pypic.py --port /dev/' + name +' --enter'
116+
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'
117+
sh 'python esp32/tools/pypic.py --port /dev/' + name +' --exit'
126118
}
127119
}
128120
}
@@ -139,6 +131,7 @@ def boardBuild(name) {
139131
}
140132
def app_bin = name.toLowerCase() + '.bin'
141133
return {
134+
release_dir = "${JENKINS_HOME}/release/${JOB_BASE_NAME}"
142135
sh '''export PATH=$PATH:/opt/xtensa-esp32-elf/bin;
143136
export IDF_PATH=${WORKSPACE}/esp-idf;
144137
cd esp32;
@@ -158,15 +151,15 @@ def boardBuild(name) {
158151
export PYCOM_VERSION=$(cat ../../../pycom_version.h |grep SW_VERSION_NUMBER|cut -d\\" -f2);
159152
export GIT_TAG=$(git rev-parse --short HEAD);
160153
mkdir -p firmware_package;
161-
mkdir -p /var/lib/jenkins/release/\$PYCOM_VERSION/\$GIT_TAG;
154+
mkdir -p '''+ release_dir + '''/\$PYCOM_VERSION/\$GIT_TAG;
162155
cd firmware_package;
163156
cp ../bootloader/bootloader.bin .;
164-
mv ../application.elf /var/lib/jenkins/release/\$PYCOM_VERSION/\$GIT_TAG/''' + name + '''-\$PYCOM_VERSION-application.elf;
157+
mv ../application.elf ''' + release_dir + '''/\$PYCOM_VERSION/\$GIT_TAG/''' + name + '''-\$PYCOM_VERSION-application.elf;
165158
cp ../appimg.bin .;
166159
cp ../lib/partitions.bin .;
167160
cp ../../../../boards/''' + name_short + '''/''' + name_u + '''/script .;
168161
cp ../''' + app_bin + ''' .;
169-
tar -cvzf /var/lib/jenkins/release/\$PYCOM_VERSION/\$GIT_TAG/''' + name + '''-\$PYCOM_VERSION.tar.gz appimg.bin bootloader.bin partitions.bin script ''' + app_bin
162+
tar -cvzf ''' + release_dir + '''/\$PYCOM_VERSION/\$GIT_TAG/''' + name + '''-\$PYCOM_VERSION.tar.gz appimg.bin bootloader.bin partitions.bin script ''' + app_bin
170163
}
171164
}
172165

README.md

+28-14
Original file line numberDiff line numberDiff line change
@@ -59,15 +59,15 @@ the Espressif website:
5959

6060
- for 64-bit Linux::
6161

62-
https://dl.espressif.com/dl/xtensa-esp32-elf-linux64-1.22.0-73-ge28a011-5.2.0.tar.gz
62+
https://dl.espressif.com/dl/xtensa-esp32-elf-linux64-1.22.0-80-g6c4433a-5.2.0.tar.gz
6363

6464
- for 32-bit Linux::
6565

66-
https://dl.espressif.com/dl/xtensa-esp32-elf-linux32-1.22.0-73-ge28a011-5.2.0.tar.gz
66+
https://dl.espressif.com/dl/xtensa-esp32-elf-linux32-1.22.0-80-g6c4433a-5.2.0.tar.gz
6767

6868
- for Mac OS:
6969

70-
https://dl.espressif.com/dl/xtensa-esp32-elf-osx-1.22.0-73-ge28a011-5.2.0.tar.gz
70+
https://dl.espressif.com/dl/xtensa-esp32-elf-osx-1.22.0-80-g6c4433a-5.2.0.tar.gz
7171

7272
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::
7373

@@ -105,6 +105,20 @@ By default the firmware is built for the WIPY2:
105105
$ make TARGET=app
106106
$ make flash
107107

108+
You can change the board type by using the BOARD variable:
109+
110+
$ cd esp32
111+
$ make BOARD=GPY clean
112+
$ make BOARD=GPY TARGET=boot
113+
$ make BOARD=GPY TARGET=app
114+
$ make flash
115+
116+
We currently support the following BOARD types:
117+
118+
WIPY LOPY SIPY GPY FIPY LOPY4
119+
120+
For LoRa, you may need to specify the `LORA_BAND` as explained below.
121+
108122
To specify a serial port other than /dev/ttyUSB0, use ESPPORT variable:
109123

110124
$ # On MacOS
@@ -114,7 +128,11 @@ To specify a serial port other than /dev/ttyUSB0, use ESPPORT variable:
114128
$ # On linux
115129
$ # make ESPPORT=/dev/ttyUSB1 flash
116130

117-
To build and flash your LoPy for the default region (868 MHz):
131+
To flash at full speed, use ESPSPEED variable:
132+
133+
$ make ESPSPEED=921600 flash
134+
135+
To build and flash a LoPy for the default region (868 MHz):
118136

119137
$ # LORA_BAND defaults to USE_BAND_868
120138
$ cd esp32
@@ -124,20 +142,16 @@ To build and flash your LoPy for the default region (868 MHz):
124142
$ make BOARD=LOPY flash
125143

126144

127-
or for 915MHz regions:
145+
For 915MHz regions add the `LORA_BAND=USE_BAND_915` variable:
128146

129147
$ cd esp32
130-
$ make BOARD=LOPY LORA_BAND=USE_BAND_915 clean
148+
$ make BOARD=LOPY LORA_BAND=USE_BAND_915 clean
131149
$ make BOARD=LOPY LORA_BAND=USE_BAND_915 TARGET=boot
132150
$ make BOARD=LOPY LORA_BAND=USE_BAND_915 TARGET=app
133151
$ make BOARD=LOPY LORA_BAND=USE_BAND_915 flash
134152

135-
or the SiPy:
136-
137-
$ cd esp32
138-
$ make BOARD=SIPY TARGET=boot
139-
$ make BOARD=SIPY TARGET=app
140-
$ make BOARD=SIPY flash
153+
The above also applies to the FiPy and LoPy4
141154

142-
Make sure that your board is placed into programming mode, otherwise flahing will fail.
143-
To do this, connect ``P2`` to ``GND`` and then reset the board.
155+
Make sure that your board is placed into programming mode, otherwise flashing will fail.<br>
156+
PyTrack and PySense boards will automatically switch into programming mode (currently supported on MacOS and Linux only!)<br>
157+
Expansion Board 2.0 users, please connect ``P2`` to ``GND`` and then reset the board.

0 commit comments

Comments
 (0)