ESP 32 Environment Setup

来自个人维基
2020年2月24日 (一) 01:00free6d1823讨论 | 贡献的版本

跳转至: 导航搜索

My EVB board: ESP-EYE DevKit v2.1
CHIP: esp32-D0WD
Camera:RYS-2640-M7

For Windows10 64-bits

Refer to this guide:
https://docs.espressif.com/projects/esp-idf/en/stable/get-started
https://docs.espressif.com/projects/esp-idf/en/latest/get-started/windows-setup-update.html


目录

ESP-IDF Tools Installer

download https://dl.espressif.com/dl/esp-idf-tools-setup-2.2.exe
run it
The installer includes the cross-compilers, OpenOCD, cmake and Ninja build tool. The installer can also download and run installers for Python 3.7 and Git For Windows if they are not already installed on the computer.

Updating ESP-IDF tools on Windows:
cd c:/esp-idf
install.bat
Add ESP-IDF tools to PATH using an export script:
export



Build project

xcopy /e /i %IDF_PATH%\examples\get-started\hello_world hello_world

cd <projects>\hello_world
idf.py menuconfig


SDK Configuration/compiler toolchain path/prefix = xtensa-esp32-elf

idf.py build


Generated C:/esp-idf/exercise/hello_world/build/hello-world.bin


To flash, run this command:

run 'idf.py -p COM13 flash'


Compressed 3072 bytes to 103...
Wrote 3072 bytes (103 compressed) at 0x00008000 in 0.0 seconds (effective 2239.7 kbit/s)...
Hash of data verified.
Compressed 25280 bytes to 14946...
Wrote 25280 bytes (14946 compressed) at 0x00001000 in 0.3 seconds (effective 589.0 kbit/s)...
Hash of data verified.
Compressed 146832 bytes to 76497...
Wrote 146832 bytes (76497 compressed) at 0x00010000 in 1.8 seconds (effective 664.2 kbit/s)...
Hash of data verified.

Note:
仅构建应用程序
idf.py app

仅烧写应用程序
idf.py -p COM13 app-flash


Check print out

idf.py -p COM13 monitor


rst:0xc (SW_CPU_RESET),boot:0x12 (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:DIO, clock div:2
load:0x3fff0018,len:4
load:0x3fff001c,len:6804
load:0x40078000,len:14076
load:0x40080400,len:4304
entry 0x400806e8
I (71) boot: Chip Revision: 1
I (71) boot_comm: chip revision: 1, min. bootloader chip revision: 0
I (39) boot: ESP-IDF v4.0-dirty 2nd stage bootloader
I (39) boot: compile time 18:08:08
I (40) boot: Enabling RNG early entropy source...
I (45) boot: SPI Speed  : 40MHz
I (49) boot: SPI Mode  : DIO
I (53) boot: SPI Flash Size : 2MB
I (57) boot: Partition Table:
I (60) boot: ## Label Usage Type ST Offset Length
I (68) boot: 0 nvs WiFi data 01 02 00009000 00006000
I (75) boot: 1 phy_init RF data 01 01 0000f000 00001000
I (83) boot: 2 factory factory app 00 00 00010000 00100000
I (90) boot: End of partition table
I (94) boot_comm: chip revision: 1, min. application chip revision: 0
I (101) esp_image: segment 0: paddr=0x00010020 vaddr=0x3f400020 size=0x056c4 ( 22212) map
I (118) esp_image: segment 1: paddr=0x000156ec vaddr=0x3ffb0000 size=0x020dc ( 8412) load
I (123) esp_image: segment 2: paddr=0x000177d0 vaddr=0x40080000 size=0x00400 ( 1024) load
0x40080000: _WindowOverflow4 at C:/esp-idf/components/freertos/xtensa_vectors.S:1778

I (129) esp_image: segment 3: paddr=0x00017bd8 vaddr=0x40080400 size=0x08438 ( 33848) load
I (151) esp_image: segment 4: paddr=0x00020018 vaddr=0x400d0018 size=0x12c20 ( 76832) map
0x400d0018: _stext at ??:?

I (179) esp_image: segment 5: paddr=0x00032c40 vaddr=0x40088838 size=0x01120 ( 4384) load
0x40088838: vTaskDelay at C:/esp-idf/components/freertos/tasks.c:1454 (discriminator 2)

I (187) boot: Loaded app from partition at offset 0x10000
I (188) boot: Disabling RNG early entropy source...
I (189) cpu_start: Pro cpu up.
I (192) cpu_start: Application information:
I (197) cpu_start: Project name: hello-world
I (202) cpu_start: App version: v4.0-dirty
I (208) cpu_start: Compile time: Feb 23 2020 18:07:34
I (214) cpu_start: ELF file SHA256: 8b1bc9f14e6b1066...
I (220) cpu_start: ESP-IDF: v4.0-dirty
I (225) cpu_start: Starting app cpu, entry point is 0x40080fdc
0x40080fdc: call_start_cpu1 at C:/esp-idf/components/esp32/cpu_start.c:272

I (212) cpu_start: App cpu up.
I (235) heap_init: Initializing. RAM available for dynamic allocation:
I (242) heap_init: At 3FFAE6E0 len 00001920 (6 KiB): DRAM
I (248) heap_init: At 3FFB30D8 len 0002CF28 (179 KiB): DRAM
I (255) heap_init: At 3FFE0440 len 00003AE0 (14 KiB): D/IRAM
I (261) heap_init: At 3FFE4350 len 0001BCB0 (111 KiB): D/IRAM
I (267) heap_init: At 40089958 len 000166A8 (89 KiB): IRAM
I (274) cpu_start: Pro cpu start user code
I (292) spi_flash: detected chip: generic
I (292) spi_flash: flash io: dio
W (292) spi_flash: Detected size(4096k) larger than the size in the binary image header(2048k). Using the size in the binary image header.
I (303) cpu_start: Starting scheduler on PRO CPU.
I (0) cpu_start: Starting scheduler on APP CPU.
Hello world!
This is ESP32 chip with 2 CPU cores, WiFi/BT/BLE, silicon revision 1, 2MB external flash
Restarting in 10 seconds...
...

API Doc

====

https://docs.espressif.com/projects/esp-idf/en/latest/api-reference/index.html