pi@RPi3B:~/esp $ . $HOME/esp/esp-idf/export.sh
Setting IDF_PATH to '/home/pi/esp/esp-idf'
Adding ESP-IDF tools to PATH...
Using Python interpreter in /home/pi/.espressif/python_env/idf4.4_py3.5_env/bin/python
Checking if Python packages are up to date...
Python requirements from /home/pi/esp/esp-idf/requirements.txt are satisfied.
Added the following directories to PATH:
/home/pi/esp/esp-idf/components/esptool_py/esptool
/home/pi/esp/esp-idf/components/espcoredump
/home/pi/esp/esp-idf/components/partition_table
/home/pi/esp/esp-idf/components/app_update
/home/pi/.espressif/tools/xtensa-esp32-elf/esp-2020r3-8.4.0/xtensa-esp32-elf/bin
/home/pi/.espressif/tools/xtensa-esp32s2-elf/esp-2020r3-8.4.0/xtensa-esp32s2-elf/bin
/home/pi/.espressif/tools/xtensa-esp32s3-elf/esp-2020r3-8.4.0/xtensa-esp32s3-elf/bin
/home/pi/.espressif/tools/riscv32-esp-elf/1.24.0.123_64eb9ff-8.4.0/riscv32-esp-elf/bin
/home/pi/.espressif/tools/esp32ulp-elf/2.28.51-esp-20191205/esp32ulp-elf-binutils/bin
/home/pi/.espressif/tools/esp32s2ulp-elf/2.28.51-esp-20191205/esp32s2ulp-elf-binutils/bin
/home/pi/.espressif/tools/openocd-esp32/v0.10.0-esp32-20200709/openocd-esp32/bin
/home/pi/.espressif/python_env/idf4.4_py3.5_env/bin
/home/pi/esp/esp-idf/tools
Done! You can now compile ESP-IDF projects.
Go to the project directory and run:
idf.py build
pi@RPi3B:~/esp $ cd unit_test
pi@RPi3B:~/esp/unit_test $ idf.py build
WARNING: Python 3 versions older than 3.6 are not supported.
Executing action: all (aliases: build)
Running make in directory /home/pi/esp/unit_test/build
Executing "make -j 6 all"...
[ 0%] Built target custom_bundle
[ 0%] Built target _project_elf_src
[ 0%] Built target partition_table_bin
[ 0%] Built target esp32_linker_script
[ 0%] Performing build step for 'bootloader'
[ 0%] Built target __idf_ulp
[ 0%] Built target __idf_esp_serial_slave_link
[ 1%] Built target _project_elf_src
[ 5%] Built target __idf_log
[ 1%] Built target __idf_sdmmc
[ 10%] Built target __idf_esp_rom
[ 1%] Built target __idf_esp_https_ota
[ 22%] Built target __idf_esp_hw_support
[ 31%] Built target __idf_efuse
[ 2%] Built target __idf_esp_http_server
[ 2%] Built target __idf_esp_http_client
[ 58%] Built target __idf_bootloader_support
[ 2%] Built target __idf_tcp_transport
[ 61%] Built target __idf_spi_flash
[ 63%] Built target __idf_micro-ecc
[ 3%] Built target __idf_esp-tls
[ 89%] Built target __idf_soc
[ 92%] Built target __idf_hal
[ 5%] Built target __idf_nghttp
[ 95%] Built target __idf_main
[ 5%] Built target __idf_app_trace
[ 98%] Built target bootloader.elf
[ 5%] Built target __idf_cxx
[100%] Built target gen_project_binary
[100%] Built target app
[ 6%] Built target __idf_newlib
[ 7%] No install step for 'bootloader'
[ 7%] Completed 'bootloader'
[ 9%] Built target __idf_freertos
[ 9%] Built target bootloader
[ 9%] Built target __idf_esp_timer
[ 10%] Built target __idf_esp_common
[ 11%] Built target __idf_esp32
[ 11%] Built target __idf_perfmon
[ 11%] Built target __idf_espcoredump
[ 12%] Built target __idf_xtensa
[ 16%] Built target __idf_driver
[ 17%] Built target __idf_esp_ringbuf
[ 18%] Built target __idf_esp_hw_support
[ 20%] Built target __idf_soc
[ 21%] Built target __idf_heap
[ 21%] Built target __idf_log
[ 30%] Built target __idf_lwip
[ 31%] Built target __idf_esp_wifi
[ 40%] Built target __idf_wpa_supplicant
[ 41%] Built target __idf_esp_event
[ 42%] Built target __idf_esp_netif
[ 42%] Built target __idf_tcpip_adapter
[ 43%] Built target __idf_esp_eth
[ 44%] Built target __idf_vfs
[ 48%] Built target __idf_hal
[ 48%] Built target __idf_esp_rom
[ 50%] Built target __idf_esp_system
[ 50%] Built target __idf_esp_gdbstub
[ 51%] Built target __idf_pthread
[ 53%] Built target __idf_nvs_flash
[ 55%] Built target __idf_spi_flash
[ 56%] Built target __idf_esp_ipc
[ 56%] Built target __idf_app_update
[ 57%] Built target __idf_bootloader_support
[ 57%] Built target __idf_efuse
[ 58%] Built target mbedx509
[ 59%] Built target mbedtls
[ 67%] Built target mbedcrypto
[ 68%] Built target __idf_mbedtls
[ 68%] Built target __idf_esp_pm
Scanning dependencies of target __idf_testable
[ 68%] Building C object esp-idf/testable/CMakeFiles/__idf_testable.dir/mean.c.obj
[ 68%] Built target __idf_console
[ 68%] Built target __idf_unity
[ 69%] Built target __idf_asio
[ 70%] Built target __idf_cbor
[ 70%] Built target __idf_esp_adc_cal
[ 71%] Built target __idf_esp_hid
[ 71%] Built target __idf_protobuf-c
[ 71%] Built target __idf_mdns
[ 72%] Built target __idf_esp_websocket_client
[ 75%] Built target __idf_coap
[ 76%] Built target __idf_expat
[ 76%] Built target __idf_wear_levelling
[ 76%] Built target __idf_jsmn
[ 76%] Built target __idf_json
[ 77%] Built target __idf_mqtt
[ 78%] Built target __idf_spiffs
[ 79%] Linking C static library libtestable.a
[ 80%] Built target __idf_openssl
[ 80%] Built target __idf_cmock
[ 84%] Built target __idf_freemodbus
[ 85%] Built target __idf_protocomm
[ 97%] Built target __idf_libsodium
[ 97%] Built target __idf_testable
[ 98%] Built target __idf_fatfs
[ 98%] Built target __idf_esp_local_ctrl
[ 99%] Built target __idf_wifi_provisioning
[ 99%] Built target __idf_main
[ 99%] Generating ld/esp32.project.ld
[ 99%] Built target __ldgen_output_esp32.project.ld
[100%] Linking CXX executable unit_test.elf
[100%] Built target unit_test.elf
[100%] Generating binary image from built executable
esptool.py v3.1-dev
Merged 1 ELF section
Generated /home/pi/esp/unit_test/build/unit_test.bin
[100%] Built target gen_project_binary
[100%] Built target app
Project build complete. To flash, run this command:
/home/pi/.espressif/python_env/idf4.4_py3.5_env/bin/python ../esp-idf/components/esptool_py/esptool/esptool.py -p (PORT) -b 460800 --before default_reset --after hard_reset --chip esp32 write_flash --flash_mode dio --flash_size detect --flash_freq 40m 0x1000 build/bootloader/bootloader.bin 0x8000 build/partition_table/partition-table.bin 0x10000 build/unit_test.bin
or run 'idf.py -p (PORT) flash'
pi@RPi3B:~/esp/unit_test $ idf.py -p /dev/ttyUSB0 flash
WARNING: Python 3 versions older than 3.6 are not supported.
Executing action: flash
Running make in directory /home/pi/esp/unit_test/build
Executing "make -j 6 flash"...
[ 0%] Built target custom_bundle
[ 0%] Built target esp32_linker_script
[ 0%] Built target partition_table_bin
[ 0%] Built target _project_elf_src
[ 0%] Performing build step for 'bootloader'
[ 0%] Built target __idf_ulp
[ 0%] Built target __idf_esp_serial_slave_link
[ 1%] Built target _project_elf_src
[ 5%] Built target __idf_log
[ 1%] Built target __idf_sdmmc
[ 10%] Built target __idf_esp_rom
[ 1%] Built target __idf_esp_https_ota
[ 22%] Built target __idf_esp_hw_support
[ 2%] Built target __idf_esp_http_server
[ 31%] Built target __idf_efuse
[ 2%] Built target __idf_esp_http_client
[ 58%] Built target __idf_bootloader_support
[ 2%] Built target __idf_tcp_transport
[ 61%] Built target __idf_spi_flash
[ 63%] Built target __idf_micro-ecc
[ 3%] Built target __idf_esp-tls
[ 89%] Built target __idf_soc
[ 5%] Built target __idf_nghttp
[ 92%] Built target __idf_hal
[ 5%] Built target __idf_app_trace
[ 95%] Built target __idf_main
[ 98%] Built target bootloader.elf
[ 5%] Built target __idf_cxx
[100%] Built target gen_project_binary
[ 6%] Built target __idf_newlib
[100%] Built target app
[ 7%] No install step for 'bootloader'
[ 9%] Built target __idf_freertos
[ 9%] Completed 'bootloader'
[ 9%] Built target __idf_esp_timer
[ 9%] Built target bootloader
[ 10%] Built target __idf_esp_common
[ 11%] Built target __idf_esp32
[ 11%] Built target __idf_perfmon
[ 11%] Built target __idf_espcoredump
[ 12%] Built target __idf_xtensa
[ 16%] Built target __idf_driver
[ 17%] Built target __idf_esp_ringbuf
[ 18%] Built target __idf_esp_hw_support
[ 20%] Built target __idf_soc
[ 21%] Built target __idf_heap
[ 21%] Built target __idf_log
[ 30%] Built target __idf_lwip
[ 31%] Built target __idf_esp_wifi
[ 40%] Built target __idf_wpa_supplicant
[ 41%] Built target __idf_esp_event
[ 42%] Built target __idf_esp_netif
[ 42%] Built target __idf_tcpip_adapter
[ 43%] Built target __idf_esp_eth
[ 44%] Built target __idf_vfs
[ 48%] Built target __idf_hal
[ 48%] Built target __idf_esp_rom
[ 50%] Built target __idf_esp_system
[ 50%] Built target __idf_esp_gdbstub
[ 51%] Built target __idf_pthread
[ 53%] Built target __idf_nvs_flash
[ 55%] Built target __idf_spi_flash
[ 56%] Built target __idf_esp_ipc
[ 56%] Built target __idf_app_update
[ 57%] Built target __idf_bootloader_support
[ 57%] Built target __idf_efuse
[ 58%] Built target mbedx509
[ 59%] Built target mbedtls
[ 67%] Built target mbedcrypto
[ 68%] Built target __idf_mbedtls
[ 68%] Built target __idf_esp_pm
[ 69%] Built target __idf_testable
[ 69%] Built target __idf_unity
[ 69%] Built target __idf_console
[ 70%] Built target __idf_cbor
[ 70%] Built target __idf_esp_adc_cal
[ 71%] Built target __idf_asio
[ 71%] Built target __idf_protobuf-c
[ 72%] Built target __idf_esp_hid
[ 75%] Built target __idf_coap
[ 76%] Built target __idf_expat
[ 76%] Built target __idf_mdns
[ 77%] Built target __idf_esp_websocket_client
[ 77%] Built target __idf_wear_levelling
[ 77%] Built target __idf_jsmn
[ 77%] Built target __idf_json
[ 78%] Built target __idf_openssl
[ 79%] Built target __idf_mqtt
[ 79%] Built target __idf_cmock
[ 80%] Built target __idf_spiffs
[ 91%] Built target __idf_freemodbus
[ 96%] Built target __idf_libsodium
[ 97%] Built target __idf_protocomm
[ 98%] Built target __idf_fatfs
[ 98%] Built target __idf_esp_local_ctrl
[ 99%] Built target __idf_wifi_provisioning
[ 99%] Built target __idf_main
[ 99%] Built target __ldgen_output_esp32.project.ld
[100%] Built target unit_test.elf
[100%] Built target gen_project_binary
[100%] Built target app
esptool.py esp32 -p /dev/ttyUSB0 -b 460800 --before=default_reset --after=hard_reset write_flash --flash_mode dio --flash_freq 40m --flash_size 2MB 0x8000 partition_table/partition-table.bin 0x1000 bootloader/bootloader.bin 0x10000 unit_test.bin
esptool.py v3.1-dev
Serial port /dev/ttyUSB0
Connecting....
Chip is ESP32-PICO-D4 (revision 1)
Features: WiFi, BT, Dual Core, 240MHz, Embedded Flash, VRef calibration in efuse, Coding Scheme None
Crystal is 40MHz
MAC: d8:a0:1d:5f:c1:54
Uploading stub...
Running stub...
Stub running...
Changing baud rate to 460800
Changed.
Configuring flash size...
Compressed 3072 bytes to 103...
Writing at 0x00008000... (100 %)
Wrote 3072 bytes (103 compressed) at 0x00008000 in 0.1 seconds (effective 446.5 kbit/s)...
Hash of data verified.
Compressed 25008 bytes to 15398...
Writing at 0x00001000... (100 %)
Wrote 25008 bytes (15398 compressed) at 0x00001000 in 0.8 seconds (effective 264.9 kbit/s)...
Hash of data verified.
Compressed 156480 bytes to 82233...
Writing at 0x00010000... (16 %)
Writing at 0x0001a249... (33 %)
Writing at 0x0001fbce... (50 %)
Writing at 0x00025464... (66 %)
Writing at 0x0002e9bc... (83 %)
Writing at 0x000361ae... (100 %)
Wrote 156480 bytes (82233 compressed) at 0x00010000 in 2.4 seconds (effective 529.1 kbit/s)...
Hash of data verified.
Leaving...
Hard resetting via RTS pin...
[100%] Built target flash
Done
pi@RPi3B:~/esp/unit_test $ idf.py -p /dev/ttyUSB0 monitor
WARNING: Python 3 versions older than 3.6 are not supported.
Executing action: monitor
Running idf_monitor in directory /home/pi/esp/unit_test
Executing "/home/pi/.espressif/python_env/idf4.4_py3.5_env/bin/python /home/pi/esp/esp-idf/tools/idf_monitor.py -p /dev/ttyUSB0 -b 115200 --toolchain-prefix xtensa-esp32-elf- /home/pi/esp/unit_test/build/unit_test.elf -m '/home/pi/.espressif/python_env/idf4.4_py3.5_env/bin/python' '/home/pi/esp/esp-idf/tools/idf.py' '-p' '/dev/ttyUSB0'"...
--- idf_monitor on /dev/ttyUSB0 115200 ---
--- Quit: Ctrl+] | Menu: Ctrl+T | Help: Ctrl+T followed by Ctrl+H ---
ets Jun 8 2016 00:22:57
rst:0x1 (POWERON_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 188777542, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:2
load:0x3fff0030,len:6916
load:0x40078000,len:14336
ho 0 tail 12 room 4
load:0x40080400,len:3672
0x40080400: _init at ??:?
entry 0x40080678
I (30) boot: ESP-IDF v4.4-dev-4-g73db14240 2nd stage bootloader
I (30) boot: compile time 03:48:52
I (30) boot: chip revision: 1
I (34) boot_comm: chip revision: 1, min. bootloader chip revision: 0
I (41) boot.esp32: SPI Speed : 40MHz
I (46) boot.esp32: SPI Mode : DIO
I (50) boot.esp32: SPI Flash Size : 2MB
I (55) boot: Enabling RNG early entropy source...
I (60) boot: Partition Table:
I (64) boot: ## Label Usage Type ST Offset Length
I (71) boot: 0 nvs WiFi data 01 02 00009000 00006000
I (78) boot: 1 phy_init RF data 01 01 0000f000 00001000
I (86) boot: 2 factory factory app 00 00 00010000 00100000
I (93) boot: End of partition table
I (97) boot_comm: chip revision: 1, min. application chip revision: 0
I (105) esp_image: segment 0: paddr=00010020 vaddr=3f400020 size=05bbch ( 23484) map
I (121) esp_image: segment 1: paddr=00015be4 vaddr=3ffb0000 size=02860h ( 10336) load
I (126) esp_image: segment 2: paddr=0001844c vaddr=40080000 size=07bcch ( 31692) load
I (143) esp_image: segment 3: paddr=00020020 vaddr=400d0020 size=1337ch ( 78716) map
I (171) esp_image: segment 4: paddr=000333a4 vaddr=40087bcc size=02f6ch ( 12140) load
I (182) boot: Loaded app from partition at offset 0x10000
I (182) boot: Disabling RNG early entropy source...
I (194) cpu_start: Pro cpu up.
I (194) cpu_start: Starting app cpu, entry point is 0x40080f34
0x40080f34: call_start_cpu1 at /home/pi/esp/esp-idf/components/esp_system/port/cpu_start.c:143
I (0) cpu_start: App cpu up.
I (208) cpu_start: Pro cpu start user code
I (208) cpu_start: cpu freq: 160000000
I (208) cpu_start: Application information:
I (212) cpu_start: Project name: unit_test
I (218) cpu_start: App version: 1
I (222) cpu_start: Compile time: Feb 28 2021 03:51:29
I (228) cpu_start: ELF file SHA256: 3807515689fe0775...
I (234) cpu_start: ESP-IDF: v4.4-dev-4-g73db14240
I (241) heap_init: Initializing. RAM available for dynamic allocation:
I (248) heap_init: At 3FFAE6E0 len 00001920 (6 KiB): DRAM
I (254) heap_init: At 3FFB3088 len 0002CF78 (179 KiB): DRAM
I (260) heap_init: At 3FFE0440 len 00003AE0 (14 KiB): D/IRAM
I (266) heap_init: At 3FFE4350 len 0001BCB0 (111 KiB): D/IRAM
I (273) heap_init: At 4008AB38 len 000154C8 (85 KiB): IRAM
I (280) spi_flash: detected chip: gd
I (283) spi_flash: flash io: dio
W (287) spi_flash: Detected size(4096k) larger than the size in the binary image header(2048k). Using the size in the binary image header.
I (301) cpu_start: Starting scheduler on PRO CPU.
I (0) cpu_start: Starting scheduler on APP CPU.
In main application. Collecting 32 random numbers from 1 to 100:
26 6 30 38 4 34 39 9 57 99
49 75 73 80 96 94 16 46 94 73
30 42 86 90 30 41 99 95 23 45
75 51
Mean: 54
pi@RPi3B:~/esp/unit_test $