11def buildVersion
22def boards_to_build = [" WiPy" , " LoPy" , " SiPy" , " GPy" , " FiPy" , " LoPy4" ]
33def variants_to_build = [ " PYBYTES" ]
4- def boards_to_test = [" 1b6fa1 " , " 00ec51" ]
4+ def boards_to_test = [" 00ec51" ]
55def open_thread
66
77node {
@@ -30,21 +30,13 @@ node {
3030 for (variant in variants_to_build) {
3131 board_variant = board + " _" + variant
3232 open_thread = ' off'
33- // Enable openthread in case of FIPY/LoPy4/LoPy BASE builds
34- if (board == ' FiPy' || board == ' LoPy4' || board == ' LoPy' )
35- {
36- // openthread is currently disabled
37- open_thread = ' off'
38- }
3933 parallelSteps[board_variant] = boardBuild(board, variant, open_thread)
4034 }
4135 parallel parallelSteps
4236 }
4337 }
44-
45- stash includes : ' **/*.bin' , name : ' binary'
38+ stash includes : ' **/*.tar.gz' , name : ' binary'
4639 stash includes : ' tests/**' , name : ' tests'
47- stash includes : ' esp-idf/components/esptool_py/**' , name : ' esp-idfTools'
4840 stash includes : ' tools/**' , name : ' tools'
4941 stash includes : ' esp32/tools/**' , name : ' esp32Tools'
5042}
@@ -54,7 +46,7 @@ for (variant in variants_to_build) {
5446 stage (' Flash-' + variant) {
5547 def parallelFlash = [:]
5648 for (board in boards_to_test) {
57- parallelFlash[board] = flashBuild(board, variant)
49+ parallelFlash[board] = flashBuild(board, PYCOM_VERSION , variant)
5850 }
5951 parallel parallelFlash
6052 }
@@ -69,54 +61,46 @@ for (variant in variants_to_build) {
6961}
7062
7163def boardBuild (name , variant , open_thread ) {
72- def name_u = name. toUpperCase()
73- def name_short = name_u. split(' _' )[0 ]
74- def app_bin = name. toLowerCase() + ' .bin'
7564 return {
7665 release_dir = " ${ JENKINS_HOME} /release/${ JOB_NAME} /" + PYCOM_VERSION + " /" + GIT_TAG + " /"
7766 sh ''' export PATH=$PATH:/opt/xtensa-esp32-elf/bin;
7867 export IDF_PATH=${WORKSPACE}/esp-idf;
79- make -C esp32 clean BOARD=''' + name_short + ' VARIANT=' + variant + ' BUILD_DIR=build-' + variant
80-
68+ make -C esp32 clean BOARD=''' + name. toUpperCase() + ' VARIANT=' + variant
8169 sh ''' export PATH=$PATH:/opt/xtensa-esp32-elf/bin;
8270 export IDF_PATH=${WORKSPACE}/esp-idf;
83- make -C esp32 -j2 release BOARD=''' + name_short + ' BUILD_DIR=build-' + variant + ' RELEASE_DIR=' + release_dir + variant + ' /' + ' VARIANT=' + variant + ' OPENTHREAD=' + open_thread
84-
85- sh ' mv esp32/build-' + variant + ' /' + name_u + ' /release/application.elf ' + release_dir + variant + ' /' + name + " -" + PYCOM_VERSION + ' -application.elf'
71+ make -C esp32 -j2 release BOARD=''' + name. toUpperCase() + ' VARIANT=' + variant + ' OPENTHREAD=' + open_thread
72+ sh ' mkdir -p ' + release_dir + variant + ' /'
73+ sh ' cp esp32/build-' + variant + ' /' + name + ' -' + PYCOM_VERSION + ' .tar.gz ' + release_dir + variant + ' /'
74+ sh ' mv esp32/build-' + variant + ' /' + name. toUpperCase() + ' /release/application.elf ' + release_dir + variant + ' /' + name + " -" + PYCOM_VERSION + ' -application.elf'
8675 }
8776}
8877
89- def flashBuild (short_name , variant ) {
78+ def flashBuild (short_name , version , variant ) {
9079 return {
9180 String device_name = get_device_name(short_name)
92- String board_name_u = get_firmware_name(short_name)
81+ String board_name = get_firmware_name(short_name)
9382 node(get_remote_name(short_name)) {
9483 sh ' rm -rf *'
9584 unstash ' binary'
96- unstash ' esp-idfTools'
9785 unstash ' esp32Tools'
9886 unstash ' tests'
9987 unstash ' tools'
100- sh ' python esp32/tools/pypic.py --port ' + device_name + ' --enter'
101- sh ' esp-idf/components/esptool_py/esptool/esptool.py --chip esp32 --port ' + device_name + ' --baud 921600 --before no_reset --after no_reset erase_flash'
102- sh ' python esp32/tools/pypic.py --port ' + device_name + ' --enter'
103- sh ' esp-idf/components/esptool_py/esptool/esptool.py --chip esp32 --port ' + device_name + ' --baud 921600 --before no_reset --after no_reset write_flash -pz --flash_mode dio --flash_freq 80m --flash_size detect 0x1000 esp32/build-' + variant + ' /' + board_name_u + ' /release/bootloader/bootloader.bin 0x8000 esp32/build-' + variant + ' /' + board_name_u + ' /release/lib/partitions.bin 0x10000 esp32/build-' + variant + ' /' + board_name_u + ' /release/' + board_name_u. toLowerCase() + ' .bin'
104- sh ' python esp32/tools/pypic.py --port ' + device_name + ' --exit'
88+ sh ' python esp32/tools/fw_updater/updater.py --port ' + device_name + ' flash -t esp32/build-' + variant + ' /' + board_name + ' -' + version + ' .tar.gz'
10589 }
10690 }
10791}
10892
10993def testBuild (short_name ) {
11094 return {
11195 String device_name = get_device_name(short_name)
112- String board_name_u = get_firmware_name(short_name)
96+ String board_name = get_firmware_name(short_name) . toUpperCase( )
11397 node(get_remote_name(short_name)) {
11498 sleep(5 ) // Delay to skip all bootlog
11599 dir(' tests' ) {
116100 timeout(30 ) {
117101 // As some tests are randomly failing... enforce script always returns 0 (OK)
118102 sh ''' export PATH=$PATH:/usr/local/bin;
119- ./run-tests --target=esp32- ''' + board_name_u + ' --device ' + device_name + ' || exit 0'
103+ ./run-tests --target=esp32 --device '' ' + device_name + ' || exit 0'
120104 }
121105 }
122106 sh ' python esp32/tools/pypic.py --port ' + device_name + ' --enter'
@@ -134,7 +118,7 @@ def get_firmware_name(short_name) {
134118 node {
135119 def node_info = sh (script : ' cat ${JENKINS_HOME}/pycom-ic.conf || exit 0' , returnStdout : true ). trim()
136120 def matcher = node_info =~ short_name + ' :(.+):.*'
137- matcher ? matcher[0 ][1 ] : " WIPY "
121+ matcher ? matcher[0 ][1 ] : " WiPy "
138122 }
139123}
140124
0 commit comments