ESP-IDF 快速入门

Simon Leung
Posts: 10
Joined: Tue Jun 25, 2019 1:28 am

ESP-IDF 快速入门

Postby Simon Leung » Tue Jun 25, 2019 9:32 am

您好!

我是一个ESP32的新用家,我在用快速入门去安装ESP-IDF这个开发平台,我现在在用的是ESP32 DEVKIT V1 模块,OS 是Window 10. 我估计在连接ESP32 和 PC 时已有问题,
我在确认串口连接时,在PuTTY Configuration 选了 COM3, 115200 BAUD, 8 Data Bits, 1 Stop Bit, 按 Open 键时没有反应。
我改用了 Tera Term 时,便有以下的一大串信息在 Tera Term 上面打印出来

“rst:0x1 (POWERON_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0x00
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:2
load:0x3fff0008,len:8
load:0x3fff0010,len:3480
load:0x40078000,len:7804
ho 0 tail 12 room 4
load:0x40080000,len:252
entry 0x40080034
I (46) boot: ESP-IDF v2.0-3-gbef9896 2nd stage bootloader
I (46) boot: compile time 05:59:45
I (46) boot: Enabling RNG early entropy source...
I (65) boot: SPI Speed : 40MHz
I (78) boot: SPI Mode : DIO
I (90) boot: SPI Flash Size : 4MB
I (102) boot: Partition Table:
I (114) boot: ## Label Usage Type ST Offset Length
I (136) boot: 0 phy_init RF data 01 01 0000f000 00001000
I (160) boot: 1 otadata OTA data 01 00 00010000 00002000
I (183) boot: 2 nvs WiFi data 01 02 00012000 0000e000
I (206) boot: 3 at_customize unknown 40 00 00020000 000e0000
I (229) boot: 4 ota_0 OTA app 00 10 00100000 00180000
I (252) boot: 5 ota_1 OTA app 00 11 00280000 00180000
I (276) boot: End of partition table
I (289) boot: Disabling RNG early entropy source...
I (306) boot: Loading app partition at offset 00100000
I (1481) boot: segment 0: paddr=0x00100018 vaddr=0x00000000 size=0x0ffe8 ( 65512)
I (1482) boot: segment 1: paddr=0x00110008 vaddr=0x3f400010 size=0x1c5f0 (116208) map
I (1499) boot: segment 2: paddr=0x0012c600 vaddr=0x3ffb0000 size=0x0215c ( 8540) load
I (1529) boot: segment 3: paddr=0x0012e764 vaddr=0x40080000 size=0x00400 ( 1024) load
I (1552) boot: segment 4: paddr=0x0012eb6c vaddr=0x40080400 size=0x1b028 (110632) load
I (1631) boot: segment 5: paddr=0x00149b9c vaddr=0x400c0000 size=0x00034 ( 52) load
I (1632) boot: segment 6: paddr=0x00149bd8 vaddr=0x00000000 size=0x06430 ( 25648)
I (1648) boot: segment 7: paddr=0x00150010 vaddr=0x400d0018 size=0x7a56c (501100) map
I (1676) heap_alloc_caps: Initializing. RAM available for dynamic allocation:
I (1698) heap_alloc_caps: At 3FFBA6B8 len 00025948 (150 KiB): DRAM
I (1719) heap_alloc_caps: At 3FFE8000 len 00018000 (96 KiB): D/IRAM
I (1741) heap_alloc_caps: At 4009B428 len 00004BD8 (18 KiB): IRAM
I (1762) cpu_start: Pro cpu up.
I (1773) cpu_start: Single core mode
I (1786) cpu_start: Pro cpu start user code
I (1847) cpu_start: Starting scheduler on PRO CPU.
I (2086) uart: queue free spaces: 10
Bin version:0.10.0
I (2088) wifi: wifi firmware version: c604573
I (2088) wifi: config NVS flash: enabled
I (2089) wifi: config nano formating: disabled
I (2097) wifi: Init dynamic tx buffer num: 32
I (2098) wifi: wifi driver task: 3ffc4eac, prio:23, stack:3584
I (2103) wifi: Init static rx buffer num: 10
I (2107) wifi: Init dynamic rx buffer num: 0
I (2111) wifi: Init rx ampdu len mblock:7
I (2115) wifi: Init lldesc rx ampdu entry mblock:4
I (2120) wifi: wifi power manager task: 0x3ffca254 prio: 21 stack: 2560
I (2126) wifi: wifi timer task: 3ffcb2d4, prio:22, stack:3584
E (2131) phy_init: PHY data partition validated
I (2154) phy: phy_version: 329, Feb 22 2017, 15:58:07, 0, 0
I (2155) wifi: mode : softAP (a4:cf:12:25:d8:c9)
I (2158) wifi: mode : sta (a4:cf:12:25:d8:c8) + softAP (a4:cf:12:25:d8:c9)
I (2161) wifi: mode : softAP (a4:cf:12:25:d8:c9)“

看起来好像是连接起来啦,然后我输入

cd ~/esp/hello_world
make menuconfig

把 Serial Flasher Config 里头设成为:

(/dev/ttyUSB0) Default serial port │ │
│ │ Default baud rate (115200 baud) ---> │ │
│ │ [*] Use compressed upload │ │
│ │ Flash SPI mode (DIO) ---> │ │
│ │ Flash SPI speed (40 MHz) ---> │ │
│ │ Flash size (4 MB) ---> │ │
│ │ [*] Detect flash size when flashing bootloader │ │
│ │ Before flashing (Reset to bootloader) ---> │ │
│ │ After flashing (Reset after flashing) ---> │ │
│ │ 'make monitor' baud rate (115200 bps) ---> │ │
│ └─────────────────────────────────────────────────────────────


然后输入:
cd ~/esp/hello_world

make flash

ESP-IDF 打印了一串新息如下,看起来好像是端口连接·有问题。

Toolchain path: /opt/xtensa-esp32-elf/bin/xtensa-esp32-elf-gcc
Toolchain version: crosstool-ng-1.22.0-80-g6c4433a5
Compiler version: 5.2.0
Python requirements from C:/msys32/home/kinof/esp/esp-idf/requirements.txt are s atisfied.
Flashing binaries to serial port /dev/ttyUSB0 (app at offset 0x10000)...
esptool.py v2.6
Serial port C:/msys32/dev/ttyUSB0
Traceback (most recent call last):
File "C:/msys32/home/kinof/esp/esp-idf/components/esptool_py/esptool/esptool.p y", line 2959, in <module>
_main()
File "C:/msys32/home/kinof/esp/esp-idf/components/esptool_py/esptool/esptool.p y", line 2952, in _main
main()
File "C:/msys32/home/kinof/esp/esp-idf/components/esptool_py/esptool/esptool.p y", line 2652, in main
esp = chip_class(each_port, initial_baud, args.trace)
File "C:/msys32/home/kinof/esp/esp-idf/components/esptool_py/esptool/esptool.p y", line 222, in __init__
self._port = serial.serial_for_url(port)
File "C:/msys32/mingw32/lib/python2.7/site-packages/serial/__init__.py", line 88, in serial_for_url
instance.open()
File "C:/msys32/mingw32/lib/python2.7/site-packages/serial/serialwin32.py", li ne 62, in open
raise SerialException("could not open port {!r}: {!r}".format(self.portstr, ctypes.WinError()))
serial.serialutil.SerialException: could not open port 'C:/msys32/dev/ttyUSB0': WindowsError(2, 'The system cannot find the file specified.')
make: *** [/home/kinof/esp/esp-idf/components/esptool_py/Makefile.projbuild:63: flash] Error 1

请问估计是哪里出现了问题,应该如何解决?

谢谢!

Who is online

Users browsing this forum: Bing [Bot] and 54 guests