Skip to content

Commit

Permalink
feat: upgrade micropython
Browse files Browse the repository at this point in the history
  • Loading branch information
Mythologyli committed May 24, 2024
1 parent 211f292 commit 066308b
Show file tree
Hide file tree
Showing 8 changed files with 42 additions and 49 deletions.
25 changes: 13 additions & 12 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ jobs:
with:
repository: micropython/micropython
path: micropython
submodules: recursive

- name: Checkout MicroPython ESP32-S3 N16R8
uses: actions/checkout@v3
Expand All @@ -24,14 +25,14 @@ jobs:
sudo apt install -y git wget flex bison gperf python3 python3-pip python3-setuptools cmake ninja-build ccache libffi-dev libssl-dev dfu-util
mkdir ~/esp
cd ~/esp
wget https://dl.espressif.com/github_assets/espressif/esp-idf/releases/download/v4.4.2/esp-idf-v4.4.2.zip
unzip -q esp-idf-v4.4.2.zip && mv esp-idf-v4.4.2 esp-idf
rm -f esp-idf-v4.4.2.zip
wget https://dl.espressif.com/github_assets/espressif/esp-idf/releases/download/v5.0.4/esp-idf-v5.0.4.zip
unzip -q esp-idf-v5.0.4.zip && mv esp-idf-v5.0.4 esp-idf
rm -f esp-idf-v5.0.4.zip
cd ~/esp/esp-idf
./install.sh esp32s3
- name: Copy GENERIC_S3_N16R8 to micropython/ports/esp32/boards
run: cp -r MicroPython-ESP32-S3-N16R8/GENERIC_S3_N16R8 micropython/ports/esp32/boards
- name: Copy ESP32_GENERIC_S3_N16R8 to micropython/ports/esp32/boards
run: cp -r MicroPython-ESP32-S3-N16R8/ESP32_GENERIC_S3_N16R8 micropython/ports/esp32/boards

- name: Install dependencies
run: |
Expand All @@ -41,18 +42,18 @@ jobs:
- name: Build
run: |
cd micropython/ports/esp32
make submodules
make BOARD=ESP32_GENERIC_S3_N16R8 submodules
source ~/esp/esp-idf/export.sh
export IDF_TARGET=esp32s3
make BOARD=GENERIC_S3_N16R8
make BOARD=ESP32_GENERIC_S3_N16R8
- name: Upload firmware
uses: actions/upload-artifact@v3
with:
name: firmware
path: |
micropython/ports/esp32/build-GENERIC_S3_N16R8/firmware.bin
micropython/ports/esp32/build-GENERIC_S3_N16R8/bootloader/bootloader*
micropython/ports/esp32/build-GENERIC_S3_N16R8/partition_table
micropython/ports/esp32/build-GENERIC_S3_N16R8/*flash*
micropython/ports/esp32/build-GENERIC_S3_N16R8/micropython*
micropython/ports/esp32/build-ESP32_GENERIC_S3_N16R8/firmware.bin
micropython/ports/esp32/build-ESP32_GENERIC_S3_N16R8/bootloader/bootloader*
micropython/ports/esp32/build-ESP32_GENERIC_S3_N16R8/partition_table
micropython/ports/esp32/build-ESP32_GENERIC_S3_N16R8/*flash*
micropython/ports/esp32/build-ESP32_GENERIC_S3_N16R8/micropython*
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,15 @@
"docs": "",
"features": [
"BLE",
"External Flash",
"External RAM",
"WiFi"
],
"images": [
"generic_s3.jpg"
],
"mcu": "esp32s3",
"product": "Generic ESP32-S3 (SPIRAM)",
"product": "ESP32-S3",
"thumbnail": "",
"url": "https://www.espressif.com/en/products/modules",
"vendor": "Espressif"
Expand Down
16 changes: 16 additions & 0 deletions ESP32_GENERIC_S3_N16R8/mpconfigboard.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
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_N16R8/sdkconfig.board
boards/sdkconfig.240mhz
boards/sdkconfig.spiram_oct
)

list(APPEND MICROPY_DEF_BOARD
MICROPY_HW_BOARD_NAME="Generic ESP32S3 module with Octal-SPIRAM"
)
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#define MICROPY_HW_BOARD_NAME "ESP32S3 module (spiram)"
#ifndef MICROPY_HW_BOARD_NAME
// Can be set by mpconfigboard.cmake.
#define MICROPY_HW_BOARD_NAME "Generic ESP32S3 module"
#endif
#define MICROPY_HW_MCU_NAME "ESP32S3"

#define MICROPY_PY_BLUETOOTH (0)
#define MICROPY_PY_MACHINE_DAC (0)

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

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
CONFIG_FLASHMODE_QIO=y
CONFIG_ESPTOOLPY_FLASHMODE_QIO=y
CONFIG_ESPTOOLPY_FLASHFREQ_80M=y
CONFIG_ESPTOOLPY_FLASHSIZE_DETECT=y
CONFIG_ESPTOOLPY_AFTER_NORESET=y

CONFIG_SPIRAM_MEMTEST=

CONFIG_ESPTOOLPY_FLASHSIZE_4MB=
CONFIG_ESPTOOLPY_FLASHSIZE_8MB=
CONFIG_ESPTOOLPY_FLASHSIZE_16MB=y
Expand Down
8 changes: 0 additions & 8 deletions GENERIC_S3_N16R8/mpconfigboard.cmake

This file was deleted.

15 changes: 0 additions & 15 deletions GENERIC_S3_N16R8/sdkconfig.spiram_sx

This file was deleted.

10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,23 +20,23 @@ Tested on Ubuntu 22.04.
git clone https://github.com/Mythologyli/MicroPython-ESP32-S3-N16R8.git
```

3. Install esp-idf v4.4:
3. Install esp-idf v5.0.4:

[Link](https://docs.espressif.com/projects/esp-idf/en/latest/esp32/get-started/linux-macos-setup.html)

4. Copy GENERIC_S3_N16R8 to micropython/ports/esp32/boards:
4. Copy ESP32_GENERIC_S3_N16R8 to micropython/ports/esp32/boards:

```bash
cp -r MicroPython-ESP32-S3-N16R8/GENERIC_S3_N16R8 micropython/ports/esp32/boards
cp -r MicroPython-ESP32-S3-N16R8/ESP32_GENERIC_S3_N16R8 micropython/ports/esp32/boards
```

5. Build:

```bash
cd micropython/ports/esp32
make submodules
make BOARD=ESP32_GENERIC_S3_N16R8 submodules
export IDF_TARGET=esp32s3
make BOARD=GENERIC_S3_N16R8
make BOARD=ESP32_GENERIC_S3_N16R8
```

## Reference
Expand Down

0 comments on commit 066308b

Please sign in to comment.