-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
boards/esp32*: use espreset tool for reset in make test #12752
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
gschorcht
added
Area: cpu
Area: CPU/MCU ports
CI: ready for build
If set, CI server will compile all applications for all available boards for the labeled PR
Platform: ESP
Platform: This PR/issue effects ESP-based platforms
Type: enhancement
The issue suggests enhanceable parts / The PR enhances parts of the codebase / documentation
labels
Nov 20, 2019
This was referenced Nov 20, 2019
aabadie
approved these changes
Nov 20, 2019
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ACK
I confirm this is fixing the make flash test
commands on esp32 platforms. And the proposed fix makes sense.
Tested with esp32-wroom-32:
master
$ ESPTOOL=esptool.py BUILD_IN_DOCKER=1 make BOARD=esp32-wroom-32 -C tests/thread_basic flash test
make: Entering directory '/work/riot/RIOT/tests/thread_basic'
ESP32_SDK_DIR should be defined as /path/to/esp-idf directory
ESP32_SDK_DIR is set by default to /opt/esp/esp-idf
Launching build container using image "riot/riotbuild:latest".
docker run --rm -t -u "$(id -u)" \
-v '/usr/share/zoneinfo/Europe/Paris:/etc/localtime:ro' -v '/work/riot/RIOT:/data/riotbuild/riotbase:delegated' -e 'RIOTBASE=/data/riotbuild/riotbase' -e 'CCACHE_BASEDIR=/data/riotbuild/riotbase' -e 'BUILD_DIR=/data/riotbuild/riotbase/build' -e 'RIOTPROJECT=/data/riotbuild/riotbase' -e 'RIOTCPU=/data/riotbuild/riotbase/cpu' -e 'RIOTBOARD=/data/riotbuild/riotbase/boards' -e 'RIOTMAKE=/data/riotbuild/riotbase/makefiles' \
-e 'BOARD=esp32-wroom-32' \
-w '/data/riotbuild/riotbase/tests/thread_basic/' \
'riot/riotbuild:latest' make 'BOARD=esp32-wroom-32'
ESP32_SDK_DIR should be defined as /path/to/esp-idf directory
ESP32_SDK_DIR is set by default to /opt/esp/esp-idf
Building application "tests_thread_basic" for "esp32-wroom-32" with MCU "esp32".
"make" -C /data/riotbuild/riotbase/boards/esp32-wroom-32
"make" -C /data/riotbuild/riotbase/boards/common/esp32
"make" -C /data/riotbuild/riotbase/core
"make" -C /data/riotbuild/riotbase/cpu/esp32
"make" -C /data/riotbuild/riotbase/cpu/esp32/freertos
"make" -C /data/riotbuild/riotbase/cpu/esp32/periph
"make" -C /data/riotbuild/riotbase/cpu/esp32/vendor
"make" -C /data/riotbuild/riotbase/cpu/esp32/vendor/esp-idf
"make" -C /data/riotbuild/riotbase/cpu/esp32/vendor/esp-idf/driver
"make" -C /data/riotbuild/riotbase/cpu/esp32/vendor/esp-idf/esp32
"make" -C /data/riotbuild/riotbase/cpu/esp32/vendor/esp-idf/soc
"make" -C /data/riotbuild/riotbase/cpu/esp32/vendor/esp-idf/spi_flash
"make" -C /data/riotbuild/riotbase/cpu/esp_common
"make" -C /data/riotbuild/riotbase/cpu/esp_common/vendor
"make" -C /data/riotbuild/riotbase/cpu/esp_common/vendor/xtensa
"make" -C /data/riotbuild/riotbase/drivers
"make" -C /data/riotbuild/riotbase/drivers/periph_common
"make" -C /data/riotbuild/riotbase/sys
"make" -C /data/riotbuild/riotbase/sys/div
"make" -C /data/riotbuild/riotbase/sys/log
"make" -C /data/riotbuild/riotbase/sys/luid
"make" -C /data/riotbuild/riotbase/sys/newlib_syscalls_default
"make" -C /data/riotbuild/riotbase/sys/random
"make" -C /data/riotbuild/riotbase/sys/random/tinymt32
"make" -C /data/riotbuild/riotbase/sys/stdio_uart
"make" -C /data/riotbuild/riotbase/sys/xtimer
text data bss dec hex filename
58441 4500 9436 72377 11ab9 /data/riotbuild/riotbase/tests/thread_basic/bin/esp32-wroom-32/tests_thread_basic.elf
esptool.py --chip esp32 elf2image -fm dout -fs 2MB -ff 40m -o /work/riot/RIOT/tests/thread_basic/bin/esp32-wroom-32/tests_thread_basic.elf.bin /work/riot/RIOT/tests/thread_basic/bin/esp32-wroom-32/tests_thread_basic.elf; printf "\n" > /work/riot/RIOT/tests/thread_basic/bin/esp32-wroom-32/partitions.csv; printf "nvs, data, nvs, 0x9000, 0x6000\n" >> /work/riot/RIOT/tests/thread_basic/bin/esp32-wroom-32/partitions.csv; printf "phy_init, data, phy, 0xf000, 0x1000\n" >> /work/riot/RIOT/tests/thread_basic/bin/esp32-wroom-32/partitions.csv; printf "factory, app, factory, 0x10000, " >> /work/riot/RIOT/tests/thread_basic/bin/esp32-wroom-32/partitions.csv; ls -l /work/riot/RIOT/tests/thread_basic/bin/esp32-wroom-32/tests_thread_basic.elf.bin | awk '{ print $5 }' >> /work/riot/RIOT/tests/thread_basic/bin/esp32-wroom-32/partitions.csv; python /work/riot/RIOT/cpu/esp32/gen_esp32part.py --disable-sha256sum --verify /work/riot/RIOT/tests/thread_basic/bin/esp32-wroom-32/partitions.csv /work/riot/RIOT/tests/thread_basic/bin/esp32-wroom-32/partitions.bin
esptool.py v2.8
Parsing CSV input...
esptool.py --chip esp32 -p /dev/ttyUSB0 -b 460800 --before default_reset --after hard_reset write_flash -z -fm dout -fs detect -ff 40m 0x1000 /work/riot/RIOT/cpu/esp32/bin/bootloader.bin 0x8000 /work/riot/RIOT/tests/thread_basic/bin/esp32-wroom-32/partitions.bin 0x10000 /work/riot/RIOT/tests/thread_basic/bin/esp32-wroom-32/tests_thread_basic.elf.bin
esptool.py v2.8
Serial port /dev/ttyUSB0
Connecting......
Chip is ESP32D0WDQ6 (revision 1)
Features: WiFi, BT, Dual Core, 240MHz, VRef calibration in efuse, Coding Scheme None
Crystal is 40MHz
MAC: 80:7d:3a:fd:d9:90
Uploading stub...
Running stub...
Stub running...
Changing baud rate to 460800
Changed.
Configuring flash size...
Auto-detected Flash size: 4MB
Flash params set to 0x0320
Compressed 20608 bytes to 12166...
Wrote 20608 bytes (12166 compressed) at 0x00001000 in 0.3 seconds (effective 589.4 kbit/s)...
Hash of data verified.
Compressed 3072 bytes to 85...
Wrote 3072 bytes (85 compressed) at 0x00008000 in 0.0 seconds (effective 6050.0 kbit/s)...
Hash of data verified.
Compressed 98896 bytes to 41274...
Wrote 98896 bytes (41274 compressed) at 0x00010000 in 1.0 seconds (effective 776.3 kbit/s)...
Hash of data verified.
Leaving...
Hard resetting via RTS pin...
/work/riot/RIOT/dist/tools/pyterm/pyterm -p "/dev/ttyUSB0" -b "115200" --noprefix --no-repeat-command-on-empty-line
Connect to serial port /dev/ttyUSB0
Welcome to pyterm!
Type '/exit' to exit.
ets Jun 8 2016 00:22:57
rst:0x1 (POWERON_RESET),boot:0x3 (DOWNLOAD_BOOT(UART0/UART1/SDIO_REI_REO_V2))
waiting for download
Serial port disconnected, waiting to get reconnected...
Try to reconnect to /dev/ttyUSB0 again...
Reconnected to serial port /dev/ttyUSB0
Serial port disconnected, waiting to get reconnected...
Try to reconnect to /dev/ttyUSB0 again...
Reconnected to serial port /dev/ttyUSB0
Timeout in expect script at "child.expect('first thread\r\n')" (tests/thread_basic/tests/01-run.py:14)
this PR
$ ESPTOOL=esptool.py BUILD_IN_DOCKER=1 make BOARD=esp32-wroom-32 -C tests/thread_basic flash test
make: Entering directory '/work/riot/RIOT/tests/thread_basic'
ESP32_SDK_DIR should be defined as /path/to/esp-idf directory
ESP32_SDK_DIR is set by default to /opt/esp/esp-idf
Launching build container using image "riot/riotbuild:latest".
docker run --rm -t -u "$(id -u)" \
-v '/usr/share/zoneinfo/Europe/Paris:/etc/localtime:ro' -v '/work/riot/RIOT:/data/riotbuild/riotbase:delegated' -e 'RIOTBASE=/data/riotbuild/riotbase' -e 'CCACHE_BASEDIR=/data/riotbuild/riotbase' -e 'BUILD_DIR=/data/riotbuild/riotbase/build' -e 'RIOTPROJECT=/data/riotbuild/riotbase' -e 'RIOTCPU=/data/riotbuild/riotbase/cpu' -e 'RIOTBOARD=/data/riotbuild/riotbase/boards' -e 'RIOTMAKE=/data/riotbuild/riotbase/makefiles' \
-e 'BOARD=esp32-wroom-32' \
-w '/data/riotbuild/riotbase/tests/thread_basic/' \
'riot/riotbuild:latest' make 'BOARD=esp32-wroom-32'
ESP32_SDK_DIR should be defined as /path/to/esp-idf directory
ESP32_SDK_DIR is set by default to /opt/esp/esp-idf
Building application "tests_thread_basic" for "esp32-wroom-32" with MCU "esp32".
"make" -C /data/riotbuild/riotbase/boards/esp32-wroom-32
"make" -C /data/riotbuild/riotbase/boards/common/esp32
"make" -C /data/riotbuild/riotbase/core
"make" -C /data/riotbuild/riotbase/cpu/esp32
"make" -C /data/riotbuild/riotbase/cpu/esp32/freertos
"make" -C /data/riotbuild/riotbase/cpu/esp32/periph
"make" -C /data/riotbuild/riotbase/cpu/esp32/vendor
"make" -C /data/riotbuild/riotbase/cpu/esp32/vendor/esp-idf
"make" -C /data/riotbuild/riotbase/cpu/esp32/vendor/esp-idf/driver
"make" -C /data/riotbuild/riotbase/cpu/esp32/vendor/esp-idf/esp32
"make" -C /data/riotbuild/riotbase/cpu/esp32/vendor/esp-idf/soc
"make" -C /data/riotbuild/riotbase/cpu/esp32/vendor/esp-idf/spi_flash
"make" -C /data/riotbuild/riotbase/cpu/esp_common
"make" -C /data/riotbuild/riotbase/cpu/esp_common/vendor
"make" -C /data/riotbuild/riotbase/cpu/esp_common/vendor/xtensa
"make" -C /data/riotbuild/riotbase/drivers
"make" -C /data/riotbuild/riotbase/drivers/periph_common
"make" -C /data/riotbuild/riotbase/sys
"make" -C /data/riotbuild/riotbase/sys/div
"make" -C /data/riotbuild/riotbase/sys/log
"make" -C /data/riotbuild/riotbase/sys/luid
"make" -C /data/riotbuild/riotbase/sys/newlib_syscalls_default
"make" -C /data/riotbuild/riotbase/sys/random
"make" -C /data/riotbuild/riotbase/sys/random/tinymt32
"make" -C /data/riotbuild/riotbase/sys/stdio_uart
"make" -C /data/riotbuild/riotbase/sys/xtimer
text data bss dec hex filename
58445 4500 9436 72381 11abd /data/riotbuild/riotbase/tests/thread_basic/bin/esp32-wroom-32/tests_thread_basic.elf
esptool.py --chip esp32 elf2image -fm dout -fs 2MB -ff 40m -o /work/riot/RIOT/tests/thread_basic/bin/esp32-wroom-32/tests_thread_basic.elf.bin /work/riot/RIOT/tests/thread_basic/bin/esp32-wroom-32/tests_thread_basic.elf; printf "\n" > /work/riot/RIOT/tests/thread_basic/bin/esp32-wroom-32/partitions.csv; printf "nvs, data, nvs, 0x9000, 0x6000\n" >> /work/riot/RIOT/tests/thread_basic/bin/esp32-wroom-32/partitions.csv; printf "phy_init, data, phy, 0xf000, 0x1000\n" >> /work/riot/RIOT/tests/thread_basic/bin/esp32-wroom-32/partitions.csv; printf "factory, app, factory, 0x10000, " >> /work/riot/RIOT/tests/thread_basic/bin/esp32-wroom-32/partitions.csv; ls -l /work/riot/RIOT/tests/thread_basic/bin/esp32-wroom-32/tests_thread_basic.elf.bin | awk '{ print $5 }' >> /work/riot/RIOT/tests/thread_basic/bin/esp32-wroom-32/partitions.csv; python /work/riot/RIOT/cpu/esp32/gen_esp32part.py --disable-sha256sum --verify /work/riot/RIOT/tests/thread_basic/bin/esp32-wroom-32/partitions.csv /work/riot/RIOT/tests/thread_basic/bin/esp32-wroom-32/partitions.bin
esptool.py v2.8
Parsing CSV input...
esptool.py --chip esp32 -p /dev/ttyUSB0 -b 460800 --before default_reset --after hard_reset write_flash -z -fm dout -fs detect -ff 40m 0x1000 /work/riot/RIOT/cpu/esp32/bin/bootloader.bin 0x8000 /work/riot/RIOT/tests/thread_basic/bin/esp32-wroom-32/partitions.bin 0x10000 /work/riot/RIOT/tests/thread_basic/bin/esp32-wroom-32/tests_thread_basic.elf.bin
esptool.py v2.8
Serial port /dev/ttyUSB0
Connecting.....
Chip is ESP32D0WDQ6 (revision 1)
Features: WiFi, BT, Dual Core, 240MHz, VRef calibration in efuse, Coding Scheme None
Crystal is 40MHz
MAC: 80:7d:3a:fd:d9:90
Uploading stub...
Running stub...
Stub running...
Changing baud rate to 460800
Changed.
Configuring flash size...
Auto-detected Flash size: 4MB
Flash params set to 0x0320
Compressed 20608 bytes to 12166...
Wrote 20608 bytes (12166 compressed) at 0x00001000 in 0.3 seconds (effective 597.3 kbit/s)...
Hash of data verified.
Compressed 3072 bytes to 85...
Wrote 3072 bytes (85 compressed) at 0x00008000 in 0.0 seconds (effective 6185.4 kbit/s)...
Hash of data verified.
Compressed 98896 bytes to 41290...
Wrote 98896 bytes (41290 compressed) at 0x00010000 in 1.0 seconds (effective 764.3 kbit/s)...
Hash of data verified.
Leaving...
Hard resetting via RTS pin...
/work/riot/RIOT/dist/tools/pyterm/pyterm -p "/dev/ttyUSB0" -b "115200" --noprefix --no-repeat-command-on-empty-line
Connect to serial port /dev/ttyUSB0
Welcome to pyterm!
Type '/exit' to exit.
ets Jun 8 2016 00:22:57
rst:0x1 (POWERON_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DOUT, clock div:2
load:0x3fff0018,len:4
load:0x3fff001c,len:5632
ho 0 tail 12 room 4
load:0x40078000,len:0
load:0x40078000,len:14868
entry 0x40078628
I (30) boot: ESP-IDF v3.1-dev-961-ga255622 2nd stage bootloader
I (30) boot: compile time 12:38:02
I (30) boot: Enabling RNG early entropy source...
I (36) boot: SPI Speed : 40MHz
I (40) boot: SPI Mode : DOUT
I (44) boot: SPI Flash Size : 4MB
I (48) boot: Partition Table:
I (52) boot: ## Label Usage Type ST Offset Length
I (59) boot: 0 nvs WiFi data 01 02 00009000 00006000
I (67) boot: 1 phy_init RF data 01 01 0000f000 00001000
I (74) boot: 2 factory factory app 00 00 00010000 00018250
I (82) boot: End of partition table
I (86) esp_image: segment 0: paddr=0x00010020 vaddr=0x3f400020 size=0x018d8 ( 6360) map
I (97) esp_image: segment 1: paddr=0x00011900 vaddr=0x3ffb0000 size=0x01194 ( 4500) load
I (105) esp_image: segment 2: paddr=0x00012a9c vaddr=0x40080000 size=0x00400 ( 1024) load
I (113) esp_image: segment 3: paddr=0x00012ea4 vaddr=0x40080400 size=0x04568 ( 17768) load
I (129) esp_image: segment 4: paddr=0x00017414 vaddr=0x00000000 size=0x08bfc ( 35836)
I (143) esp_image: segment 5: paddr=0x00020018 vaddr=0x400d0018 size=0x08210 ( 33296) map
I (158) boot: Loaded app from partition at offset 0x10000
I (158) boot: Disabling RNG early entropy source...
Starting ESP32 with ID: 5e807d3afdd990
Current clocks in Hz: CPU=80000000 APB=80000000 XTAL=40000000 SLOW=150000
PRO cpu is up (single core mode, only PRO cpu is used)
PRO cpu starts user code
Used clocks in Hz: CPU=80000000 APB=80000000 XTAL
Board configuration:
UART_DEV(0) txd=1 rxd=3
UART_DEV(1) txd=10 rxd=9
LED pins=[ ]
BUTTONS pins=[ 0 ]
Starting RIOT kernel on PRO cpu
I (237) [main_trampoline]: main(): This is RIOT! (Version: 2020.01-devel-729-g5ba4a-review_espreset)
first thread
second thread
make: Leaving directory '/work/riot/RIOT/tests/thread_basic'
17 tasks
@aabadie Thanks for reviewing, testing and merging. This was really fast 😄 |
9 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Area: cpu
Area: CPU/MCU ports
CI: ready for build
If set, CI server will compile all applications for all available boards for the labeled PR
Platform: ESP
Platform: This PR/issue effects ESP-based platforms
Type: enhancement
The issue suggests enhanceable parts / The PR enhances parts of the codebase / documentation
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Contribution description
The ESP8266 port in PR #11108 introduced the reset tool
/dist/tools/esptool/espreset.py
to reset the ESP8266. Using this tool also for ESP32 allows automatic testing of ESP32 boards with themake tests
command.This PR is the first in a series of upcoming PRs, each with very small changes that will make it possible to perform automatic tests on ESP32 boards using the
make tests
command.Testing procedure
Make, flash and execute an automatic test, for example,
Issues/PRs references
Requires #12750