Waveshare ESP32-S3 Pico

The Waveshare ESP32-S3 Pico would fit the Pico Calc form factor.

I have one but haven’t done much with it. I was trying to create a USB soundcard with a Pico, then discovered that the audio would not be lossless due to the limitation of the USB port. Bought the Waveshare but struggled getting the code to work, then got busy.

I got one from Aliexpress that doesn’t claim to be Waveshare, but I think it might be a compatible knockoff. It should be arriving about the time my PicoCalc does (in a couple of days), and I’m hoping to adapt the WalnutPi configuration from github that was already posted on the forum. I suspect all these ESP32-S3 Pico boards are similar, except maybe with some GPIO pins swapped. (And they might have slightly different amounts of flash and RAM, etc.)

https://www.aliexpress.us/item/3256806257819459.html


Rather than using it to run MicroPython, I’m planning to use PlatofrmIO and get some existing code running on it. I figure with it inside the PicoCalc it’s essentially like one of those M5Stack Cardputer kits, except with a much nicer keyboard, much nicer screen, and ridiculously long battery life.

I’m probably going to wish I got a second PicoCalc since I also want to put the LuckFox Lyra in it. But I’m hoping the soldering on the connector can take some swapping back and forth of modules. Also got a Pico 2W for it. I wanted to try to cover all the bases since there’s no telling where the most interesting community activity will be for this, and the modules are pretty cheap.

Who knows, maybe some hardware wizard will come up with a switchable multiple pico adapter that could be plugged in and support multiple Pico devices at once, with a switch to determine which one is active. Hehe.

I saw I have successfully ported MicroPython to the PicoCalc.
and bought ESP32-S3-Pico because I wanted to run micropython on PicoCalc(not arrived yet!).
Since micropython requires the ST7789 module, I built the firmware.
Here are the steps I took to build the firmware.

I don’t usually use ESP32 at all and I don’t have PicoCalc So I am not sure if it will work.

Sorry if it doesn’t work.
Hope it works well…

Environment

  • WSL2 on Ubuntu-24.02.
  • esptool on Windows.

1. Setting up ESP-IDF and the build environment

Runs on Ubuntu.

sudo apt update
sudo apt install -y build-essential libusb-1.0-0-dev libffi-dev git pkg-config python3 python3-venv cmake virtualenv python3-pip python3-virtualenv
mkdir esp32
cd esp32
git clone -b v5.2.2 --recursive https://github.com/espressif/esp-idf.git
cd esp-idf
git checkout v5.2.2
git submodule update --init --recursive
./install.sh esp32
source export.sh

2. Building the firmware with “st7789_mpy” module

2.1 Clone and setting

cd ~/esp32
git clone https://github.com/micropython/micropython.git
git clone https://github.com/russhughes/st7789_mpy.git
git clone https://github.com/Mythologyli/MicroPython-ESP32-S3-N16R8.git
cp -r MicroPython-ESP32-S3-N16R8/ESP32_GENERIC_S3_N16R8 micropython/ports/esp32/boards/ESP32_GENERIC_S3_N16R2
cd micropython/ports/esp32/boards/ESP32_GENERIC_S3_N16R2

and edit 2files(include option).

(1) mpconfigboard.cmake

set(IDF_TARGET esp32s3)

set(SDKCONFIG_DEFAULTS
    boards/sdkconfig.base
    ${SDKCONFIG_IDF_VERSION_SPECIFIC}
    boards/sdkconfig.usb
    boards/sdkconfig.ble
    boards/sdkconfig.spiram_sx
    boards/ESP32_GENERIC_S3_N16R2/sdkconfig.board
    boards/sdkconfig.240mhz
)

list(APPEND MICROPY_DEF_BOARD
        MICROPY_HW_BOARD_NAME="Generic Board:16MB-FLASH & 2MB-PSRAM. Built-in russhughesi/ST7789_mpy module"
)

(2) (option) mpconfigboard.h

Not mandatory
#ifndef MICROPY_HW_BOARD_NAME
// Can be set by mpconfigboard.cmake.
#define MICROPY_HW_BOARD_NAME                   "ESP32-S3-Pico"
#endif
#define MICROPY_HW_MCU_NAME                     "ESP32S3R2"
#define MICROPY_PY_NETWORK_HOSTNAME_DEFAULT     "ESP32S3Pico"

// Enable UART REPL for modules that have an external USB-UART and don't use native USB.
#define MICROPY_HW_ENABLE_UART_REPL         (1)

#define MICROPY_HW_I2C0_SCL                 (9)
#define MICROPY_HW_I2C0_SDA                 (8)

2.2 (option)Copy to st7789_mpy python module.

If you don’t understand the “frozon_module”, DON’T do this option.

e.g.

cd ~/esp32/micropython/ports/esp32/
cp ../../../st7789_mpy/fonts/bitmap/vga1_16x16.py modules
cp ../../../st7789_mpy/fonts/truetype/NotoSans_32.py modules
cp ../../../st7789_mpy/fonts/vector/scripts.py modules
and so on...

Copy only those modules for which freeze is “yes”.
Refer to “Readme.md” under “st7789_mpy/fonts” directories.

bitmap/README.md  truetype/README.md  vector/README.md

2.3 Build

cd ~/esp32/micropython/
git submodule update --init
cd ports/esp32
make BOARD=ESP32_GENERIC_S3_N16R2 submodules
export IDF_TARGET=esp32s3
make BOARD=ESP32_GENERIC_S3_N16R2 USER_C_MODULES=../../../../st7789_mpy/st7789/micropython.cmake

After firmware has been built, run the following command.

cd build-ESP32_GENERIC_S3_N16R2
explore.exe .

Explore will open a folder and copy the “firmware.bin” to a directory where esptool can run.

2.4 Write firmware to ESP32-S3-Pico

My ESP32-S3-Pico is COM5, so run the following command.

.\esptool.exe --port COM5 --chip esp32s3 -b 460800 --before default_reset --after no_reset write_flash --flash_mode dio --flash_size 16MB --flash_freq 80m 0x0 firmware.bin

And re-connect USB.

1 Like

(Appendix) Rebuild

First, delete the firmware directory.

cd ~/esp32/micropython/ports/esp32
rm -rf build-ESP32_GENERIC_S3_N16R2

Next, restart Ubuntu and run the following command.

cd ~/esp32/espidf
source ./export.sh
cd ~/esp32/micropython/
make BOARD=ESP32_GENERIC_S3_N16R2 submodules
export IDF_TARGET=esp32s3
make BOARD=ESP32_GENERIC_S3_N16R2 USER_C_MODULES=../../../../st7789_mpy/st7789/micropython.cmake

Thanks.

Although this is only for Pico and Pico2W, it looks like some good work is being done over here too. (Found on discord buried in a thread.) Hopefully this might be adapted to teh Waveshare and other boards.

1 Like

I have just got mine this morning is anything booting on this board yet.


1 Like