diff --git a/.github/workflows/build_esp32.yml b/.github/workflows/build_esp32.yml index 79e0ea4..866801c 100644 --- a/.github/workflows/build_esp32.yml +++ b/.github/workflows/build_esp32.yml @@ -4,164 +4,142 @@ name: ESP32 on: push: pull_request: - paths-ignore: - - "examples/**" - - "README.md" - - "ci/*unix*.sh" - - ".github/workflows/build_unix.yml" + paths: + - ".github/workflows/build_esp32.yml" + - "micropython-modules/microlite/**" + - "micropython-modules/micropython-camera-driver/**" + jobs: tensorflow_micropython_esp32_build: runs-on: ubuntu-latest steps: - - name: Checkout repository - uses: actions/checkout@v2 - - name: Prepare to Build Tensorflow Micropython Firmware for ESP32 - run: | - git submodule init - git submodule update --recursive - cd micropython - git submodule update --init lib/axtls - git submodule update --init lib/berkeley-db-1.xx - cd ports/esp32 - make BOARD= submodules - cd ../../.. - cd tflm_esp_kernels - git submodule update --init components/esp32-camera - git submodule update --init components/esp-nn - - name: Get Cache Keys - # later get this like this: git ls-remote --heads https://github.com/espressif/esp-idf - # this commit is hard-coded in micropython/tools/ci.sh - run: | - IDF_COMMIT=142bb32c50fa9875b8b69fa539a2d59559460d72 - echo "esp-idf-commit=$IDF_COMMIT" >> $GITHUB_ENV - TFLM_COMMIT=$(git submodule status tensorflow | awk '{print ($1)}') - echo "tflm-commit=$TFLM_COMMIT" >> $GITHUB_ENV - # - name: Cache esp-idf - # id: cache-esp-idf - # uses: actions/cache@v2 - # env: - # cache-name: cache-esp-idf - # with: - # path: ./esp-idf - # key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ env.esp-idf-commit }} - - name: Setup IDF - # if: steps.cache-esp-idf.outputs.cache-hit != 'true' - run: | - source ./micropython/tools/ci.sh && ci_esp32_idf50_setup - - name: Cache tflm - id: cache-tflm - uses: actions/cache@v2 - env: - cache-name: cache-tflm - with: - path: ./micropython-modules/microlite/tflm - key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ env.tflm-commit }} - - name: Setup Build for Tensorflow -# if: steps.cache-tflm.outputs.cache-hit != 'true' + # - name: Checkout repository + # uses: actions/checkout@v4 + # with: + # repository: 'm' + # path: '' + # - uses: actions/setup-python@v2 + # with: + # python-version: '3.9' + # - name: Setup cmake + # uses: jwlawson/actions-setup-cmake@v1.13 + # with: + # cmake-version: '3.18.4' + - name: Get Date + id: get-date run: | + echo "date=$(/bin/date -u "+%Y%m%d")" >> $GITHUB_OUTPUT + shell: bash + # - uses: actions/cache@v3 + # id: cache + # with: + # path: | + # dependencies/** + # esp-idf/** + # key: ${{ steps.get-date.outputs.date }} - source ./esp-idf/export.sh - + - name: Prepare to Build Tensorflow Micropython Firmware for ESP32 + # if: steps.cache.outputs.cache-hit != 'true' + run: | + pwd + echo "working directory" + ls + echo "parent directory" + ls .. + echo "runner files" + find /home/runner/work -ls + python --version + cmake --version + getconf ARG_MAX + which python pip3 install Pillow pip3 install Wave - - echo "Regenerating microlite/tfm directory" - rm -rf ./micropython-modules/microlite/tflm - - cd ./tensorflow - - ../micropython-modules/microlite/prepare-tflm-esp.sh - - - name: Build micropython cross compiler - run: | - source ./esp-idf/export.sh - cd ./micropython - echo "make -C mpy-cross V=1 clean all" - make -C mpy-cross V=1 clean all - - - name: Build standard non-psram 4MB Flash firmware - run: | - source ./esp-idf/export.sh - - echo "cd ./boards/esp32/MICROLITE" - cd ./boards/esp32/MICROLITE - - echo "Building MICROLITE" - rm -rf builds - idf.py clean build - - ../../../micropython-modules/microlite/assemble-unified-image-esp.sh \ - ../../../micropython/ports/esp32 + source ./scripts/build.sh && prepare_dependencies + source ./dependencies/micropython/tools/ci.sh && ci_esp32_idf50_setup + echo "BUILDING MICROLITE" + source ./scripts/build.sh && build_esp32 "MICROLITE" + ./scripts/assemble-unified-image-esp.sh ./dependencies/micropython "MICROLITE" + shell: bash + + # - name: Build standard non-psram 4MB Flash firmware + # run: | + # pip3 install Pillow + # pip3 install Wave + # rm -rf ./dependencies/micropython/ports/esp32/build-MICROLITE + # source ./esp-idf/export.sh + # source ./scripts/build.sh && build_esp32 "MICROLITE" + # ./scripts/assemble-unified-image-esp.sh ./dependencies/micropython/ports/esp32 "MICROLITE" + # shell: bash - name: Archive ESP32-MICROLITE firmware uses: actions/upload-artifact@v2 with: name: microlite-esp32-firmware path: | - boards/esp32/MICROLITE/build/firmware.bin + dependencies/micropython/build-MICROLITE/firmware.bin - - name: Build with psram support and 16MB Flash firmware - run: | - source ./esp-idf/export.sh + # - name: Build with psram support and 16MB Flash firmware + # run: | + # source ./esp-idf/export.sh - echo "cd ./boards/esp32/MICROLITE_SPIRAM_16M" - cd ./boards/esp32/MICROLITE_SPIRAM_16M + # echo "cd ./boards/esp32/MICROLITE_SPIRAM_16M" + # cd ./boards/esp32/MICROLITE_SPIRAM_16M - echo "Building MICROLITE_SPIRAM_16M" - rm -rf build - idf.py clean build + # echo "Building MICROLITE_SPIRAM_16M" + # rm -rf build + # idf.py clean build - ../../../micropython-modules/microlite/assemble-unified-image-esp.sh \ - ../../../micropython/ports/esp32 + # ../../../micropython-modules/microlite/assemble-unified-image-esp.sh \ + # ../../../micropython/ports/esp32 - - name: Archive ESP32-MICROLITE-SPIRAM-16M firmware - uses: actions/upload-artifact@v2 - with: - name: microlite-spiram-16m-esp32-firmware - path: | - boards/esp32/MICROLITE_SPIRAM_16M/build/firmware.bin + # - name: Archive ESP32-MICROLITE-SPIRAM-16M firmware + # uses: actions/upload-artifact@v2 + # with: + # name: microlite-spiram-16m-esp32-firmware + # path: | + # boards/esp32/MICROLITE_SPIRAM_16M/build/firmware.bin - - name: Build with psram support - run: | - source ./esp-idf/export.sh + # - name: Build with psram support + # run: | + # source ./esp-idf/export.sh - echo "cd ./boards/esp32/MICROLITE_SPIRAM" - cd ./boards/esp32/MICROLITE_SPIRAM + # echo "cd ./boards/esp32/MICROLITE_SPIRAM" + # cd ./boards/esp32/MICROLITE_SPIRAM - echo "Building MICROLITE_SPIRAM" - rm -rf build - idf.py clean build + # echo "Building MICROLITE_SPIRAM" + # rm -rf build + # idf.py clean build - ../../../micropython-modules/microlite/assemble-unified-image-esp.sh \ - ../../../micropython/ports/esp32 + # ../../../micropython-modules/microlite/assemble-unified-image-esp.sh \ + # ../../../micropython/ports/esp32 - - name: Archive ESP32-MICROLITE-SPIRAM firmware - uses: actions/upload-artifact@v2 - with: - name: microlite-spiram-esp32-firmware - path: | - boards/esp32/MICROLITE_SPIRAM/build/firmware.bin + # - name: Archive ESP32-MICROLITE-SPIRAM firmware + # uses: actions/upload-artifact@v2 + # with: + # name: microlite-spiram-esp32-firmware + # path: | + # boards/esp32/MICROLITE_SPIRAM/build/firmware.bin - - name: Build MICROLITE_SPIRAM_CAM - run: | + # - name: Build MICROLITE_SPIRAM_CAM + # run: | - source ./esp-idf/export.sh + # source ./esp-idf/export.sh - echo "cd ./boards/esp32/MICROLITE_SPIRAM_CAM" - cd ./boards/esp32/MICROLITE_SPIRAM_CAM + # echo "cd ./boards/esp32/MICROLITE_SPIRAM_CAM" + # cd ./boards/esp32/MICROLITE_SPIRAM_CAM - echo "Building MICROLITE_SPIRAM_CAM" - rm -rf builds - idf.py clean build + # echo "Building MICROLITE_SPIRAM_CAM" + # rm -rf builds + # idf.py clean build - ../../../micropython-modules/microlite/assemble-unified-image-esp.sh \ - ../../../micropython/ports/esp32 + # ../../../micropython-modules/microlite/assemble-unified-image-esp.sh \ + # ../../../micropython/ports/esp32 - - name: Archive ESP32-MICROLITE_SPIRAM_CAM firmware - uses: actions/upload-artifact@v2 - with: - name: microlite-spiram-cam-esp32-firmware - path: | - boards/esp32/MICROLITE_SPIRAM_CAM/build/firmware.bin + # - name: Archive ESP32-MICROLITE_SPIRAM_CAM firmware + # uses: actions/upload-artifact@v2 + # with: + # name: microlite-spiram-cam-esp32-firmware + # path: | + # boards/esp32/MICROLITE_SPIRAM_CAM/build/firmware.bin diff --git a/boards/esp32/MICROLITE/mpconfigboard.cmake b/boards/esp32/MICROLITE/mpconfigboard.cmake index 5daac41..8f73275 100644 --- a/boards/esp32/MICROLITE/mpconfigboard.cmake +++ b/boards/esp32/MICROLITE/mpconfigboard.cmake @@ -1,7 +1,7 @@ set(SDKCONFIG_DEFAULTS boards/sdkconfig.base boards/sdkconfig.ble - ../../../../boards/esp32/ESP32_GENERIC/sdkconfig.partition + ../../../../boards/esp32/MICROLITE/sdkconfig.partition ) if(MICROPY_BOARD_VARIANT STREQUAL "D2WD") @@ -53,6 +53,4 @@ set(USER_C_MODULES ${CMAKE_CURRENT_LIST_DIR}/../../../micropython-modules/micropython.cmake ) -# set (COMPONENTS esp-tflite-micro) -# list(APPEND IDF_COMPONENTS esp-tflite-micro) list(APPEND EXTRA_COMPONENT_DIRS ${CMAKE_CURRENT_LIST_DIR}/../../../dependencies/tflite-micro-esp-examples/components/esp-tflite-micro) \ No newline at end of file diff --git a/boards/esp32/MICROLITE/sdkconfig.partition b/boards/esp32/MICROLITE/sdkconfig.partition index 7bdf94a..ec73dc2 100644 --- a/boards/esp32/MICROLITE/sdkconfig.partition +++ b/boards/esp32/MICROLITE/sdkconfig.partition @@ -4,4 +4,4 @@ #CONFIG_ESPTOOLPY_FLASHSIZE_2MB=y CONFIG_PARTITION_TABLE_CUSTOM=y # move back up from micropython/ports/esp32 to the main project source code -CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="../../../../boards/esp32/ESP32_GENERIC/custom-partitions.csv" +CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="../../../../boards/esp32/MICROLITE/custom-partitions.csv" diff --git a/boards/esp32/MICROLITE_C3/CMakeLists.txt b/boards/esp32/MICROLITE_C3/CMakeLists.txt deleted file mode 100644 index 1fdbb5e..0000000 --- a/boards/esp32/MICROLITE_C3/CMakeLists.txt +++ /dev/null @@ -1,32 +0,0 @@ -# Top-level cmake file for building MicroPython on ESP32. -# Nothing in here needs to be customised, it will work for any board. - -cmake_minimum_required(VERSION 3.12) - -# Set the location of MicroPython, the esp32 port, and the board directory. -get_filename_component(PROJECT_DIR "../../.." ABSOLUTE) -set(MICROPY_PORT_DIR ${PROJECT_DIR}/micropython/ports/esp32) -get_filename_component(MICROPY_BOARD_DIR "." ABSOLUTE) - -message (STATUS "PROJECT_DIR=${PROJECT_DIR}") -message (STATUS "MICROPY_PORT_DIR=${MICROPY_PORT_DIR}") -message (STATUS "MICROPY_BOARD_DIR=${MICROPY_BOARD_DIR}") - -# Define the output sdkconfig so it goes in the build directory. -set(SDKCONFIG ${CMAKE_BINARY_DIR}/sdkconfig) - -# Include board config; this is expected to set SDKCONFIG_DEFAULTS (among other options). -include(${MICROPY_BOARD_DIR}/mpconfigboard.cmake) - -# Concatenate all sdkconfig files into a combined one for the IDF to use. -file(WRITE ${CMAKE_BINARY_DIR}/sdkconfig.combined.in "") -foreach(SDKCONFIG_DEFAULT ${SDKCONFIG_DEFAULTS}) - file(READ ${SDKCONFIG_DEFAULT} CONTENTS) - file(APPEND ${CMAKE_BINARY_DIR}/sdkconfig.combined.in "${CONTENTS}") -endforeach() -configure_file(${CMAKE_BINARY_DIR}/sdkconfig.combined.in ${CMAKE_BINARY_DIR}/sdkconfig.combined COPYONLY) -set(SDKCONFIG_DEFAULTS ${CMAKE_BINARY_DIR}/sdkconfig.combined) - -# Include main IDF cmake file and define the project. -include($ENV{IDF_PATH}/tools/cmake/project.cmake) -project(micropython) \ No newline at end of file diff --git a/boards/esp32/MICROLITE_C3_USB/board.json b/boards/esp32/MICROLITE_C3/board.json similarity index 83% rename from boards/esp32/MICROLITE_C3_USB/board.json rename to boards/esp32/MICROLITE_C3/board.json index 23f9a8e..4a81d22 100644 --- a/boards/esp32/MICROLITE_C3_USB/board.json +++ b/boards/esp32/MICROLITE_C3/board.json @@ -5,14 +5,14 @@ "docs": "", "features": [ "BLE", + "External Flash", "WiFi" ], - "id": "esp32c3-usb", "images": [ "esp32c3_devkitmini.jpg" ], "mcu": "esp32c3", - "product": "ESP32-C3 with USB", + "product": "ESP32-C3", "thumbnail": "", "url": "https://www.espressif.com/en/products/modules", "vendor": "Espressif" diff --git a/boards/esp32/MICROLITE_C3/board.md b/boards/esp32/MICROLITE_C3/board.md new file mode 100644 index 0000000..1604b87 --- /dev/null +++ b/boards/esp32/MICROLITE_C3/board.md @@ -0,0 +1,7 @@ +The following files are firmware images that should work on most +ESP32-C3-based boards with 4MiB of flash, including WROOM and MINI modules, +that use the revision 3 silicon (or newer). + +USB serial/JTAG support is enabled on pin 18 and 19. Note that this +is not a full USB stack, the C3 just provides a CDC/ACM class serial +and JTAG interface. diff --git a/boards/esp32/MICROLITE_C3/main/CMakeLists.txt b/boards/esp32/MICROLITE_C3/main/CMakeLists.txt deleted file mode 100644 index b8bec33..0000000 --- a/boards/esp32/MICROLITE_C3/main/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -# Include MicroPython ESP32 component. - -get_filename_component(CURRENT_DIR "." ABSOLUTE) - -message(STATUS "microlite/main/cmake: CURRENT_DIR=${CURRENT_DIR}") - -get_filename_component(MICROPY_DIR "../../../../micropython" ABSOLUTE) - - -message (STATUS "microlite/main/cmake: MICROPY_DIR=${MICROPY_DIR}") - -set(PROJECT_DIR ${MICROPY_DIR}/ports/esp32) -include(${PROJECT_DIR}/main/CMakeLists.txt) \ No newline at end of file diff --git a/boards/esp32/MICROLITE_C3/mpconfigboard.cmake b/boards/esp32/MICROLITE_C3/mpconfigboard.cmake index b6f6f4b..0a76fdc 100644 --- a/boards/esp32/MICROLITE_C3/mpconfigboard.cmake +++ b/boards/esp32/MICROLITE_C3/mpconfigboard.cmake @@ -1,18 +1,14 @@ -set (IDF_TARGET esp32c3) +set(IDF_TARGET esp32c3) set(SDKCONFIG_DEFAULTS - ${MICROPY_PORT_DIR}/boards/sdkconfig.base - ${MICROPY_PORT_DIR}/boards/sdkconfig.ble - ${MICROPY_BOARD_DIR}/sdkconfig.partition - + boards/sdkconfig.base + boards/sdkconfig.ble + boards/ESP32_GENERIC_C3/sdkconfig.c3usb + ../../../../boards/esp32/MICROLITE_C3/sdkconfig.partition ) -message (STATUS "mpconfigboard.cmake: PROJECT_DIR=${PROJECT_DIR}") - set(USER_C_MODULES - ${PROJECT_DIR}/micropython-modules/micropython.cmake + ${CMAKE_CURRENT_LIST_DIR}/../../../micropython-modules/micropython.cmake ) -if(NOT MICROPY_FROZEN_MANIFEST) - set(MICROPY_FROZEN_MANIFEST ${MICROPY_PORT_DIR}/boards/manifest.py) -endif() +list(APPEND EXTRA_COMPONENT_DIRS ${CMAKE_CURRENT_LIST_DIR}/../../../dependencies/tflite-micro-esp-examples/components/esp-tflite-micro) diff --git a/boards/esp32/MICROLITE_C3/mpconfigboard.h b/boards/esp32/MICROLITE_C3/mpconfigboard.h index 02bad4c..6e2545d 100644 --- a/boards/esp32/MICROLITE_C3/mpconfigboard.h +++ b/boards/esp32/MICROLITE_C3/mpconfigboard.h @@ -1,9 +1,11 @@ // This configuration is for a generic ESP32C3 board with 4MiB (or more) of flash. -#define MICROPY_HW_BOARD_NAME "ESP32C3 module (microlite)" -#define MICROPY_HW_MCU_NAME "ESP32C3" +#define MICROPY_HW_BOARD_NAME "Microlite ESP32C3 module" +#define MICROPY_HW_MCU_NAME "Microlite ESP32C3" #define MICROPY_HW_ENABLE_SDCARD (0) #define MICROPY_PY_MACHINE_DAC (0) -// TODO: early esp-idf's didn't support i2s. check if this still applies #define MICROPY_PY_MACHINE_I2S (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) diff --git a/boards/esp32/MICROLITE_C3/sdkconfig.c3usb b/boards/esp32/MICROLITE_C3/sdkconfig.c3usb new file mode 100644 index 0000000..d9e7c7f --- /dev/null +++ b/boards/esp32/MICROLITE_C3/sdkconfig.c3usb @@ -0,0 +1,7 @@ +CONFIG_ESP32C3_REV_MIN_3=y +CONFIG_ESP32C3_BROWNOUT_DET=y +CONFIG_ESP32C3_BROWNOUT_DET_LVL_SEL_7= +CONFIG_ESP32C3_BROWNOUT_DET_LVL_SEL_4=y +CONFIG_ESP32C3_BROWNOUT_DET_LVL=4 +CONFIG_ESP_CONSOLE_UART_DEFAULT= +CONFIG_ESP_CONSOLE_USB_SERIAL_JTAG=y diff --git a/boards/esp32/MICROLITE_C3/sdkconfig.partition b/boards/esp32/MICROLITE_C3/sdkconfig.partition index 2543d5b..cb13b00 100644 --- a/boards/esp32/MICROLITE_C3/sdkconfig.partition +++ b/boards/esp32/MICROLITE_C3/sdkconfig.partition @@ -4,4 +4,4 @@ #CONFIG_ESPTOOLPY_FLASHSIZE_2MB=y CONFIG_PARTITION_TABLE_CUSTOM=y # move back up from micropython/ports/esp32 to the main project source code -CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="../../../boards/esp32/MICROLITE_C3/custom-partitions.csv" +CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="../../../../boards/esp32/MICROLITE_C3/custom-partitions.csv" diff --git a/boards/esp32/MICROLITE_C3_USB/CMakeLists.txt b/boards/esp32/MICROLITE_C3_USB/CMakeLists.txt deleted file mode 100644 index 1fdbb5e..0000000 --- a/boards/esp32/MICROLITE_C3_USB/CMakeLists.txt +++ /dev/null @@ -1,32 +0,0 @@ -# Top-level cmake file for building MicroPython on ESP32. -# Nothing in here needs to be customised, it will work for any board. - -cmake_minimum_required(VERSION 3.12) - -# Set the location of MicroPython, the esp32 port, and the board directory. -get_filename_component(PROJECT_DIR "../../.." ABSOLUTE) -set(MICROPY_PORT_DIR ${PROJECT_DIR}/micropython/ports/esp32) -get_filename_component(MICROPY_BOARD_DIR "." ABSOLUTE) - -message (STATUS "PROJECT_DIR=${PROJECT_DIR}") -message (STATUS "MICROPY_PORT_DIR=${MICROPY_PORT_DIR}") -message (STATUS "MICROPY_BOARD_DIR=${MICROPY_BOARD_DIR}") - -# Define the output sdkconfig so it goes in the build directory. -set(SDKCONFIG ${CMAKE_BINARY_DIR}/sdkconfig) - -# Include board config; this is expected to set SDKCONFIG_DEFAULTS (among other options). -include(${MICROPY_BOARD_DIR}/mpconfigboard.cmake) - -# Concatenate all sdkconfig files into a combined one for the IDF to use. -file(WRITE ${CMAKE_BINARY_DIR}/sdkconfig.combined.in "") -foreach(SDKCONFIG_DEFAULT ${SDKCONFIG_DEFAULTS}) - file(READ ${SDKCONFIG_DEFAULT} CONTENTS) - file(APPEND ${CMAKE_BINARY_DIR}/sdkconfig.combined.in "${CONTENTS}") -endforeach() -configure_file(${CMAKE_BINARY_DIR}/sdkconfig.combined.in ${CMAKE_BINARY_DIR}/sdkconfig.combined COPYONLY) -set(SDKCONFIG_DEFAULTS ${CMAKE_BINARY_DIR}/sdkconfig.combined) - -# Include main IDF cmake file and define the project. -include($ENV{IDF_PATH}/tools/cmake/project.cmake) -project(micropython) \ No newline at end of file diff --git a/boards/esp32/MICROLITE_C3_USB/custom-partitions.csv b/boards/esp32/MICROLITE_C3_USB/custom-partitions.csv deleted file mode 100644 index a3569b8..0000000 --- a/boards/esp32/MICROLITE_C3_USB/custom-partitions.csv +++ /dev/null @@ -1,10 +0,0 @@ -# Notes: the offset of the partition table itself is set in -# $ESPIDF/components/partition_table/Kconfig.projbuild and the -# offset of the factory/ota_0 partition is set in makeimg.py -# I needed to increase the size of the app partition to fit the tensorflow microlite library -# There is 1/2 as much data partition as with standard micropython on esp32 4MiB. -# Name, Type, SubType, Offset, Size, Flags -nvs, data, nvs, 0x9000, 0x6000, -phy_init, data, phy, 0xf000, 0x1000, -factory, app, factory, 0x10000, 0x280000, -vfs, data, fat, 0x300000, 0x100000, diff --git a/boards/esp32/MICROLITE_C3_USB/main/CMakeLists.txt b/boards/esp32/MICROLITE_C3_USB/main/CMakeLists.txt deleted file mode 100644 index b8bec33..0000000 --- a/boards/esp32/MICROLITE_C3_USB/main/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -# Include MicroPython ESP32 component. - -get_filename_component(CURRENT_DIR "." ABSOLUTE) - -message(STATUS "microlite/main/cmake: CURRENT_DIR=${CURRENT_DIR}") - -get_filename_component(MICROPY_DIR "../../../../micropython" ABSOLUTE) - - -message (STATUS "microlite/main/cmake: MICROPY_DIR=${MICROPY_DIR}") - -set(PROJECT_DIR ${MICROPY_DIR}/ports/esp32) -include(${PROJECT_DIR}/main/CMakeLists.txt) \ No newline at end of file diff --git a/boards/esp32/MICROLITE_C3_USB/mpconfigboard.cmake b/boards/esp32/MICROLITE_C3_USB/mpconfigboard.cmake deleted file mode 100644 index b6f6f4b..0000000 --- a/boards/esp32/MICROLITE_C3_USB/mpconfigboard.cmake +++ /dev/null @@ -1,18 +0,0 @@ -set (IDF_TARGET esp32c3) - -set(SDKCONFIG_DEFAULTS - ${MICROPY_PORT_DIR}/boards/sdkconfig.base - ${MICROPY_PORT_DIR}/boards/sdkconfig.ble - ${MICROPY_BOARD_DIR}/sdkconfig.partition - -) - -message (STATUS "mpconfigboard.cmake: PROJECT_DIR=${PROJECT_DIR}") - -set(USER_C_MODULES - ${PROJECT_DIR}/micropython-modules/micropython.cmake -) - -if(NOT MICROPY_FROZEN_MANIFEST) - set(MICROPY_FROZEN_MANIFEST ${MICROPY_PORT_DIR}/boards/manifest.py) -endif() diff --git a/boards/esp32/MICROLITE_C3_USB/mpconfigboard.h b/boards/esp32/MICROLITE_C3_USB/mpconfigboard.h deleted file mode 100644 index 1622db6..0000000 --- a/boards/esp32/MICROLITE_C3_USB/mpconfigboard.h +++ /dev/null @@ -1,8 +0,0 @@ -// This configuration is for a generic ESP32C3 board with 4MiB (or more) of flash. - -#define MICROPY_HW_BOARD_NAME "ESP32C3 module (microlite)" -#define MICROPY_HW_MCU_NAME "ESP32C3" - -#define MICROPY_HW_ENABLE_SDCARD (0) -#define MICROPY_PY_MACHINE_DAC (0) -#define MICROPY_PY_MACHINE_I2S (0) diff --git a/boards/esp32/MICROLITE_C3_USB/sdkconfig.partition b/boards/esp32/MICROLITE_C3_USB/sdkconfig.partition deleted file mode 100644 index 6d7decd..0000000 --- a/boards/esp32/MICROLITE_C3_USB/sdkconfig.partition +++ /dev/null @@ -1,21 +0,0 @@ -# -- from GENERIC_C3_USB start -- - -CONFIG_ESP32C3_REV_MIN_3=y -CONFIG_ESP32C3_REV_MIN=3 -CONFIG_ESP32C3_BROWNOUT_DET=y -CONFIG_ESP32C3_BROWNOUT_DET_LVL_SEL_7= -CONFIG_ESP32C3_BROWNOUT_DET_LVL_SEL_4=y -CONFIG_ESP32C3_BROWNOUT_DET_LVL=4 -CONFIG_ESP_CONSOLE_UART_DEFAULT= -CONFIG_ESP_CONSOLE_USB_CDC= -CONFIG_ESP_CONSOLE_USB_SERIAL_JTAG=y - -# -- from GENERIC_C3_USB end -- - -# MICROLITE 4M flash partition adjustment -#CONFIG_ESPTOOLPY_FLASHMODE_DIO=y -#CONFIG_ESPTOOLPY_FLASHFREQ_40M=y -#CONFIG_ESPTOOLPY_FLASHSIZE_2MB=y -CONFIG_PARTITION_TABLE_CUSTOM=y -# move back up from micropython/ports/esp32 to the main project source code -CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="../../../boards/esp32/MICROLITE_C3_USB/custom-partitions.csv" diff --git a/scripts/build.sh b/scripts/build.sh index 1ae32e2..7ba7612 100644 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -1,5 +1,13 @@ #!bin/bash +MAKEOPTS= + +# if which nproc > /dev/null; then +# MAKEOPTS="-j$(nproc)" +# else +# MAKEOPTS="-j$(sysctl -n hw.ncpu)" +# fi + function prepare_dependencies { rm -rf dependencies @@ -36,17 +44,40 @@ function prepare_dependencies { # build : # $ cd dependencies/micropython/ports/esp32 # $ - cd micropython - git submodule init - git submodule update --recursive + # cd micropython + # git submodule init + # git submodule update --recursive + + # cd ../.. + cd .. } function build_esp32 { + BOARD=$1 + if test -z "$BOARD"; then + echo "USAGE: build_esp32 " + exit 1; + fi + pwd + python --version + which python + # xargs --show-limits + source esp-idf/export.sh + cd dependencies/micropython + make ${MAKEOPTS} -C mpy-cross + cd ports/esp32 + make ${MAKEOPTS} submodules + + PWD=$(pwd) + echo "make ${MAKEOPTS} V=1 BOARD_DIR=$(pwd)/../../../../boards/esp32/${BOARD} BOARD=${BOARD} FROZEN_MANIFEST=$PWD/boards/manifest.py" + + make ${MAKEOPTS} V=1 \ + BOARD_DIR=$(pwd)/../../../../boards/esp32/${BOARD} \ + BOARD=${BOARD} - cd dependencies/micropython/ports/esp32 - make BOARD_DIR=../../../../boards/esp32/MICROLITE # creates the build into dependencies/micropython/ports/esp32/build-MICROLITE - + # find build-${BOARD} -ls + cd ../.. }