ESP32-S3開発ボード(またもやTenstar Robot製)を Arduino IDE で使う

AliExpressの100YEN SHOP(※)にて送料無料にするため最後の一品に安めのESP32-S3開発ボードを購入。今度もTENSTAR ROBOT製。しかしこのボードの開発環境が見当たらない。CircuitPythonもArduino IDEのボード情報もない。
ストアの説明では Arduino IDEのボード指定のところで ESP32S3 Dev Module を指定すればよい、と書いているがピン割当とか同じなのだろうか?

※100円ではないが比較的安いものがあり、3つまとめて買うと送料無料になる

👇️TENSTAR ROBOT STORE の ESP32-S3 SuperMiniのページ
https://www.aliexpress.com/item/1005006835920531.html

下記が一番情報が書いてあるサイトだったが、Arduino IDE では使えるGPIOは少ない(ボード設定を何にするかはここには書いていなかった)。

www.espboards.dev

困ったなと思い購入した人はどうしてるかなとレビューを見てみると良さげな情報を発見。 Lolin S3 mini というボードを指定すると良いと書いてある。すばらしい。

👇️S3 mini のページ
https://www.wemos.cc/en/latest/s3/s3_mini.html

ピン配置の比較 (Supermini と S3 mini とで比較)

ESP32-S3 Supermini ピン配置

S3 mini ピン配置

CricuitPython

👇️S3 mini のCircuitPython環境
circuitpython.org

UF2ブートローダー書込手順 (Arduino IDE開発でも必要)

はじめから書き込まれているブートローダーはUF2形式ではないようなので上記のページの Install, Repair, or Update UF2 Bootloader に従ってブートローダーの更新をする。

ざっくり手順:

  1. combine.bin をダウンロードする
  2. BOOTボタンを長押ししながらRSTボタンを押してブートローダーモードに遷移
  3. ESP Web Flasher で bin ファイルを書き込む。下図は書込成功時のスクリーンショット
  4. 書込完了したらRSTボタンを押してリセットさせるとUF2ブートローダーが起動して下図のようにドライブが見えるはず

Arduino IDE で Lチカ

オンボードのフルカラーLED WS2812 を点灯させる。ライブラリは FastLED を使用。
github.com

下記のサンプルコードで白色でチカチカ点滅したので無事 GPIO48 の WS2812 を制御できている模様。

#include <FastLED.h>

#define NUM_LEDS 1
#define DATA_PIN 48
CRGB leds[NUM_LEDS];
void setup() { FastLED.addLeds<NEOPIXEL, DATA_PIN>(leds, NUM_LEDS); }
void loop() {
  leds[0] = CRGB::White; FastLED.show(); delay(30);
  leds[0] = CRGB::Black; FastLED.show(); delay(30);
}

バイナリ書込について

書込設定にてデフォルト設定から変更したもの:
- 書込装置: Esptool
- USB CDC on Boot: Enable

上記設定で UF2ブートローダーモードの状態で書込すれば成功するはず。
参考までに書き込み時のログは👇️。書き込み後のリセットのあとでエラーになるが問題なく書き込めていた。

<AppData>\Local\Arduino15\packages\esp32\tools\esptool_py\4.9.dev3/esptool.exe --chip esp32s3 --port COM12 --baud 921600 --before default_reset --after hard_reset write_flash -z --flash_mode keep --flash_freq keep --flash_size keep 0x0 <AppData>\Local\Temp\arduino_build_618651/NeopixelTest.ino.bootloader.bin 0x8000 <AppData>\Local\Temp\arduino_build_618651/NeopixelTest.ino.partitions.bin 0xe000
<AppData>\Local\Arduino15\packages\esp32\hardware\esp32\3.1.2/tools/partitions/boot_app0.bin 0x10000
<AppData>\Local\Temp\arduino_build_618651/NeopixelTest.ino.bin 
esptool.py v4.8.1
Serial port COM12
Connecting...
Chip is ESP32-S3 (QFN56) (revision v0.2)
Features: WiFi, BLE, Embedded Flash 4MB (XMC), Embedded PSRAM 2MB (AP_3v3)
Crystal is 40MHz
MAC: xx:xx:xx:xx:xx:xx
Uploading stub...
Running stub...
Stub running...
Changing baud rate to 921600
Changed.
Configuring flash size...
Flash will be erased from 0x00000000 to 0x00004fff...
Flash will be erased from 0x00008000 to 0x00008fff...
Flash will be erased from 0x0000e000 to 0x0000ffff...
Flash will be erased from 0x00010000 to 0x00064fff...
Compressed 20160 bytes to 12987...
Writing at 0x00000000... (100 %)
Wrote 20160 bytes (12987 compressed) at 0x00000000 in 0.4 seconds (effective 448.8 kbit/s)...
Hash of data verified.
Compressed 3072 bytes to 146...
Writing at 0x00008000... (100 %)
Wrote 3072 bytes (146 compressed) at 0x00008000 in 0.1 seconds (effective 236.3 kbit/s)...
Hash of data verified.
Compressed 8192 bytes to 47...
Writing at 0x0000e000... (100 %)
Wrote 8192 bytes (47 compressed) at 0x0000e000 in 0.1 seconds (effective 481.8 kbit/s)...
Hash of data verified.
Compressed 346848 bytes to 180703...
Writing at 0x00010000... (8 %)
Writing at 0x0001c2f3... (16 %)
Writing at 0x0002bcc4... (25 %)
Writing at 0x000318aa... (33 %)
Writing at 0x000372d0... (41 %)
Writing at 0x0003cac9... (50 %)
Writing at 0x00042485... (58 %)
Writing at 0x00047cce... (66 %)
Writing at 0x0004f2f0... (75 %)
Writing at 0x0005899d... (83 %)
Writing at 0x0005e274... (91 %)
Writing at 0x00064898... (100 %)
Wrote 346848 bytes (180703 compressed) at 0x00010000 in 3.2 seconds (effective 862.4 kbit/s)...
Hash of data verified.

Leaving...
Hard resetting with RTC WDT...

A serial exception error occurred: Cannot configure port, something went wrong. Original message: PermissionError(13, '�V�X�e���ɐڑ����ꂽ�f�o�C�X���@�\���Ă��܂���B', None, 31)
Note: This error originates from pySerial. It is likely not a problem with esptool, but with the hardware connection or drivers.
For troubleshooting steps visit: https://docs.espressif.com/projects/esptool/en/latest/troubleshooting.html
シリアルポート「For troubleshooting steps visit: https://docs.espressif.com/projects/esptool/en/latest/troubleshooting.html
」が選択されていますが、そのポートは存在しないか、ボードが接続されていません。