ESP32S3快速上手

随着群友一声“乐鑫淘宝店开卖ESP32S3开发板了”,我也在第一时间下单并且拿到了ESP32S3 DevKitC开发板。

和以往塑料泡沫包裹的开发板不同,这回ESP32S3的开发板有了自己的包装,看起来逼格一下子就上去了,从曾经的淘宝大路货变成了创客产品。包装上还印上了快速入门的二维码。

https://img.yuanze.wang/posts/esp32s3-get-started/esp32s3-devkitc-package.jpg
开发板的包装

打开包装盒,开发板安静的躺在里面。由于ESP32S3的IO相比ESP32多了许多,开发板为了容纳这些多出的管脚也相应的变长了一些。

https://img.yuanze.wang/posts/esp32s3-get-started/esp32s3-devkitc.jpg
ESP32S3 DevKitC开发板

https://img.yuanze.wang/posts/esp32s3-get-started/esp32s3-devkitc-inhand.jpg
ESP32S3 DevKitC开发板

除此之外,开发板的宽度也比以前缩小了400mil,这使得开发板可以很容易地被插入面包板,不再像以前一样需要横跨两块面包板。插入面包板后,开发板两侧各有2个孔位可供接线。也正因此,开发板上引脚标号移到了排针焊盘的间隙位置。在这里还是要表扬一下乐鑫,即使板子做窄了,仍然坚持把引脚标号做到了正面,接线的时候非常方便。某信可的ESP32C3开发板把引脚标号印到了背面,每次插线都要打开手册对照,强烈差评。

通过手册可以得知,这次ESP32S3的strapping pin终于没有放到GPIO矩阵都没法改变的复用GPIO上了,设计电路的时候应该会从容很多。

将开发板上电,板子中烧录的是一个LED流水灯的程序,只可惜开发板上的WS2812只有一颗,根本看不出来流水的效果,只能看到灯以不同的颜色闪烁。从log中可以看到,我手上的这个芯片是V0版本的,估计还有不少bug,等到官方量产V1版的芯片之后我再去考虑用它做设计。并且目前的esp-idf对ESP32S3的支持还不是很完善,从log中可以看到许多关于暂未支持和未来将会改动的warning信息。

新的电子设备到手,要做的第一件事肯定就是跑分(笑)。从GitHub上拉下CoreMark跑分项目master分支的esp-idf4.4,设置target为esp32s3,一次编译成功。单核心跑分571分,相比同频的ESP32提升了大约15%。下面是esp-idf的配置与完整的log。

https://img.yuanze.wang/posts/esp32s3-get-started/esp-idf-menuconfig.png
esp-idf的配置

ESP-ROM:esp32s3-20210327
Build:Mar 27 2021
rst:0x1 (POWERON),boot:0x8 (SPI_FAST_FLASH_BOOT)
SPIWP:0xee
mode:DIO, clock div:1
load:0x3fcd0108,len:0x185c
load:0x403b6000,len:0xb74
load:0x403ba000,len:0x3010
entry 0x403b61ec
I (24) boot: ESP-IDF v4.4-dev-3042-g220590d599-dirty 2nd stage bootloader
I (25) boot: compile time 19:16:42
I (25) boot: chip revision: 0
I (28) qio_mode: Enabling default flash chip QIO
I (34) boot.esp32s3: Boot SPI Speed : 80MHz
I (39) boot.esp32s3: SPI Mode       : QIO
I (43) boot.esp32s3: SPI Flash Size : 8MB
I (48) boot: Enabling RNG early entropy source...
W (53) bootloader_random: RNG for ESP32-S3 not currently supported
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 (79) boot:  1 phy_init         RF data          01 01 0000f000 00001000
I (86) boot:  2 factory          factory app      00 00 00010000 00100000
I (94) boot: End of partition table
I (98) esp_image: segment 0: paddr=00010020 vaddr=3c020020 size=06e00h ( 28160) map
I (110) esp_image: segment 1: paddr=00016e28 vaddr=3fc93a40 size=025e8h (  9704) load
I (116) esp_image: segment 2: paddr=00019418 vaddr=40378000 size=06c00h ( 27648) load
I (128) esp_image: segment 3: paddr=00020020 vaddr=42000020 size=15f60h ( 89952) map
I (145) esp_image: segment 4: paddr=00035f88 vaddr=4037ec00 size=04e34h ( 20020) load
I (149) esp_image: segment 5: paddr=0003adc4 vaddr=50000000 size=00010h (    16) load
I (156) boot: Loaded app from partition at offset 0x10000
I (157) boot: Disabling RNG early entropy source...
W (163) bootloader_random: RNG for ESP32-S3 not currently supported
W (181) FLASH: DO NOT USE FOR MASS PRODUCTION! Timing parameters will be updated in future IDF version.
I (181) cpu_start: Pro cpu up.
I (183) cpu_start: Starting app cpu, entry point is 0x4037905c
0x4037905c: call_start_cpu1 at D:/code/esp-idf/components/esp_system/port/cpu_start.c:155

I (0) cpu_start: App cpu up.
I (205) cpu_start: Pro cpu start user code
I (205) cpu_start: cpu freq: 240000000
I (205) cpu_start: Application information:
I (208) cpu_start: Project name:     coremark
I (213) cpu_start: App version:      8ff21c7-dirty
I (218) cpu_start: Compile time:     Sep 19 2021 19:19:05
I (224) cpu_start: ELF file SHA256:  ad35818d05aed7df...
I (230) cpu_start: ESP-IDF:          v4.4-dev-3042-g220590d599-dirty
I (237) heap_init: Initializing. RAM available for dynamic allocation:
I (244) heap_init: At 3FC96A08 len 000495F8 (293 KiB): D/IRAM
I (251) heap_init: At 3FCE0000 len 0000EE34 (59 KiB): STACK/DRAM
I (258) heap_init: At 3FCF0000 len 00008000 (32 KiB): DRAM
I (264) spi_flash: detected chip: generic
I (269) spi_flash: flash io: qio
I (273) cpu_start: Starting scheduler on PRO CPU.
I (0) cpu_start: Starting scheduler on APP CPU.
2K performance run parameters for coremark.
CoreMark Size    : 666
Total ticks      : 17490
Total time (secs): 17.490000
Iterations/Sec   : 571.755289
Iterations       : 10000
Compiler version : GCC8.4.0
Compiler flags   : -O3
Memory location  : STACK
seedcrc          : 0xe9f5
[0]crclist       : 0xe714
[0]crcmatrix     : 0x1fd7
[0]crcstate      : 0x8e3a
[0]crcfinal      : 0x988c
Correct operation validated. See README.md for run and reporting rules.
CoreMark 1.0 : 571.755289 / GCC8.4.0 -O3 / STACK