也不知道是不是這樣。sdk (framework, library) 跟 toolchain:
結果 build toolchain 就 failed:
Connecting to isl.gforge.inria.fr (isl.gforge.inria.fr)|128.93.193.15|:80... failed: Connection timed out.
S3 的要看:
run 這個,依照你要用的 chip 版本 (以 S3 為例):
./install.sh esp32s3
就會 download 對應的 toolchain (不用自己 build)
一樣,要 access 到 install 的 toolchain,要先
All done! You can now run:
. ./export.sh
這個 env script 會出現:
Setting IDF_PATH to '/home/charles-chang/esp/esp-idf'
Detecting the Python interpreter
Checking "python" ...
Checking "python3" ...
Python 3.8.10
"python3" has been detected
Adding ESP-IDF tools to PATH...
Using Python interpreter in /home/charles-chang/.espressif/python_env/idf4.3_py3.8_env/bin/python
Checking if Python packages are up to date...
Python requirements from /home/charles-chang/esp/esp-idf/requirements.txt are satisfied.
Added the following directories to PATH:
/home/charles-chang/esp/esp-idf/components/esptool_py/esptool
/home/charles-chang/esp/esp-idf/components/espcoredump
/home/charles-chang/esp/esp-idf/components/partition_table
/home/charles-chang/esp/esp-idf/components/app_update
/home/charles-chang/.espressif/tools/xtensa-esp32-elf/esp-2020r3-8.4.0/xtensa-esp32-elf/bin
/home/charles-chang/.espressif/tools/xtensa-esp32s2-elf/esp-2020r3-8.4.0/xtensa-esp32s2-elf/bin
/home/charles-chang/.espressif/tools/xtensa-esp32s3-elf/esp-2020r3-8.4.0/xtensa-esp32s3-elf/bin
/home/charles-chang/.espressif/tools/riscv32-esp-elf/1.24.0.123_64eb9ff-8.4.0/riscv32-esp-elf/bin
/home/charles-chang/.espressif/tools/esp32ulp-elf/2.28.51-esp-20191205/esp32ulp-elf-binutils/bin
/home/charles-chang/.espressif/tools/esp32s2ulp-elf/2.28.51-esp-20191205/esp32s2ulp-elf-binutils/bin
/home/charles-chang/.espressif/tools/openocd-esp32/v0.10.0-esp32-20210401/openocd-esp32/bin
/home/charles-chang/.espressif/python_env/idf4.3_py3.8_env/bin
/home/charles-chang/esp/esp-idf/tools
Done! You can now compile ESP-IDF projects.
Go to the project directory and run:
idf.py build
依照這個getting start guide. copy hello-world, 要 build 的話...
都是用 idf.py 這個 tool.
idf.py set-target esp32s3
idf.py menuconfig
這個 menuconfig 包含很多東西,例如 bt, wifi, rtos, network-stack...etc
之後,用
idf.py build
build 完就會告訴你燒錄的command.
esp32-s3 的話,要 v4.4 以上才有 support,
ref:
使用 v4.3 的化,idf.py -p /dev/ttyUSB1 flash 會出現 Error:
A fatal error occurred: This chip is ESP32-S3(beta3) not ESP32. Wrong --chip argument?
改用 latest (master) 後,就 OK 了:
~/esp/hello_world$ idf.py -p /dev/ttyUSB1 flash
Executing action: flash
Running ninja in directory /home/charles-chang/esp/hello_world/build
Executing "ninja flash"...
[1/5] cd /home/charles-chang/esp/hello_world/build/esp-idf/esptool_py && /home/charles-chang/.espressif/python_env/idf5.2_py3.8_env/bin/python /home/charles-chang/esp/esp-idf/components/partition_table/check_sizes.py --offset 0x8000 partition --type app /home/charles-chang/esp/hello_world/build/partition_table/partition-table.bin /home/charles-chang/esp/hello_world/build/hello_world.bin
hello_world.bin binary size 0x314a0 bytes. Smallest app partition is 0x100000 bytes. 0xceb60 bytes (81%) free.
[2/5] Performing build step for 'bootloader'
[1/1] cd /home/charles-chang/esp/hello_world/build/bootloader/esp-idf/esptool_py && /home/charles-chang/.espressif/python_env/idf5.2_py3.8_env/bin/python /home/charles-chang/esp/esp-idf/components/partition_table/check_sizes.py --offset 0x8000 bootloader 0x0 /home/charles-chang/esp/hello_world/build/bootloader/bootloader.bin
Bootloader binary size 0x5250 bytes. 0x2db0 bytes (36%) free.
[2/3] cd /home/charles-chang/esp/esp-idf/components/esptool_py && /usr/bin/cmake -D IDF_PATH=/home/charles-chang/esp/esp-idf -D "SERIAL_TOOL=/home/charles-chang/.espressif/python_env/idf5.2_py3.8_env/bin/python;;/home/charles-chang/esp/esp-idf/components/esptool_py/esptool/esptool.py;--chip;esp32s3" -D "SERIAL_TOOL_ARGS=--before=default_reset;--after=hard_reset;write_flash;@flash_args" -D WORKING_DIRECTORY=/home/charles-chang/esp/hello_world/build -P /home/charles-chang/esp/esp-idf/components/esptool_py/run_serial_tool.cmake
esptool esp32s3 -p /dev/ttyUSB1 -b 460800 --before=default_reset --after=hard_reset write_flash --flash_mode dio --flash_freq 80m --flash_size 2MB 0x0 bootloader/bootloader.bin 0x10000 hello_world.bin 0x8000 partition_table/partition-table.bin
esptool.py v4.5.1
Serial port /dev/ttyUSB1
Connecting...
Chip is ESP32-S3 (revision v0.1)
Features: WiFi, BLE
Crystal is 40MHz
MAC: 34:85:18:98:db:8c
Uploading stub...
Running stub...
Stub running...
Changing baud rate to 460800
Changed.
Configuring flash size...
Flash will be erased from 0x00000000 to 0x00005fff...
Flash will be erased from 0x00010000 to 0x00041fff...
Flash will be erased from 0x00008000 to 0x00008fff...
Compressed 21072 bytes to 13405...
Writing at 0x00000000... (100 %)
Wrote 21072 bytes (13405 compressed) at 0x00000000 in 0.7 seconds (effective 253.4 kbit/s)...
Hash of data verified.
Compressed 201888 bytes to 109664...
Writing at 0x00010000... (14 %)
Writing at 0x0001cc87... (28 %)
Writing at 0x0002271e... (42 %)
Writing at 0x00028d61... (57 %)
Writing at 0x0002f274... (71 %)
Writing at 0x00037197... (85 %)
Writing at 0x0003cd0d... (100 %)
Wrote 201888 bytes (109664 compressed) at 0x00010000 in 2.6 seconds (effective 618.5 kbit/s)...
Hash of data verified.
Compressed 3072 bytes to 103...
Writing at 0x00008000... (100 %)
Wrote 3072 bytes (103 compressed) at 0x00008000 in 0.1 seconds (effective 396.0 kbit/s)...
Hash of data verified.
Leaving...
Hard resetting via RTS pin...
Done
devkti 上有兩個 microusb port,flash command 的 option,接 UART 時,是 /dev/ttyUSB0,接 USB 時,是 /dev/ttyACM0
燒錄好 hello-world 後,用
picocom -b 115200 /dev/ttyUSB0(ACM0) 就可以看到 hello world console output
燒錄的時候,只要下command 就好,竟然不用按reset...
但是說明有說。如果沒有bootloader,就要手動進入 download mode :
接 UART,按著 BOOT 然後 reset. 如果用 picocom 來看,就會看到:
ESP-ROM:esp32s3-20210327
build: Mar 27 2021
rst:0x1 (POWERON),boot:0x23 (DOWNLOAD(USB/UARTR0))
waiting for download
wifi-ble 測試可以用 blufi,包含android apk 和 esp32 sample code.
是利用手機經由 ble 連線後,設定 wifi ssid/password 的example
Android apk 可以用 AndroidStudio build OK
esp32 sample 一樣,用
idf.py set-target esp32s3
idf.py build
idf.py -p /dev/ttyACM0 flash
要build matter app 的話,先參考:
依照他說的,除了上面的 idf 要裝,還要裝
chip environment
猜的,一樣在 ~/esp/ 下:
git clone --recurse-submodules git@github.com:project-chip/connectedhomeip.git