-
-
Notifications
You must be signed in to change notification settings - Fork 8.4k
esp32c6 support (IDF v5.2) #11869
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
esp32c6 support (IDF v5.2) #11869
Conversation
I've hacked past a bunch of compile flags to get further in the compile, but still not complete. Bluetooth is not working - ADC does not support the legacy api currently being used in idf v5 support.
|
Code size report:
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #11869 +/- ##
=======================================
Coverage 98.57% 98.57%
=======================================
Files 164 164
Lines 21336 21336
=======================================
Hits 21031 21031
Misses 305 305 ☔ View full report in Codecov by Sentry. |
Tried building with the recently-released ESP IDF v5.1.2 (currently aliased to release-v5.1) and the first error appears to be related to sleep modes:
|
I should rebase this on top of #12952 to include everything already fixed there. |
To resolve "error: 'CONFIG_ESP_CONSOLE_UART_BAUDRATE' undeclared" |
Thanks for the suggestion @jschott780 but I made the change and am having exactly the same error! Tried cleaning first too. Puzzling... --- a/ports/esp32/boards/GENERIC_C6/sdkconfig.board
+++ b/ports/esp32/boards/GENERIC_C6/sdkconfig.board
@@ -2,5 +2,5 @@ CONFIG_ESP32C6_BROWNOUT_DET=y
CONFIG_ESP32C6_BROWNOUT_DET_LVL_SEL_7=
CONFIG_ESP32C6_BROWNOUT_DET_LVL_SEL_4=y
CONFIG_ESP32C6_BROWNOUT_DET_LVL=4
CONFIG_ESP_CONSOLE_UART_DEFAULT=
CONFIG_ESP_CONSOLE_USB_SERIAL_JTAG=y
+CONFIG_ESP_CONSOLE_UART_BAUDRATE=115200 |
Maybe its the order in which sdkconfig files are resolved in mpconfigboard.cmake? set(SDKCONFIG_DEFAULTS I dont know if it matters. I seem to remember running into this problem and renaming sdkconfig to sdkconfig.c6usb resolve it. Though totally possible I incidentally resolved it in some other way, and the file name was irrelevant. |
Seems similar here: set(IDF_TARGET esp32c6)
set(SDKCONFIG_DEFAULTS
boards/sdkconfig.base
boards/GENERIC_C6/sdkconfig.board
) Confusing! |
1cd53f4
to
44acb81
Compare
For anyone that is interested, i have a hacked up fork that appears to be working on C6. I havent done any robust testing yet. Use at your own risk. However, it may provide additional insight for the professional devs on here. |
Can you guide me on how can I test your fork? I'm unable to find the proper firmware to esp32-c6 on https://micropython.org/download/?vendor=Espressif. I haven't seen it in your repository either. Where to get it? With my older boards, I was downloading FV from this page and then installing it with 'Thonny' IDE. Is there another way that I should attempt for this board? I use: |
That downloads list are the officially supported builds generated by cicd. To get this to work on C6 you have to build and compile the binaries yourself. You may want to first start with building the main branch by following these instructions. If you get that working, then take a whack at building my forked repo. |
Ok, that sounds doable. But, I need to clarify some things:
|
Take a look at this file. I set the build target and a couple CMake variables such that the build points to the correct sdkconfig files under ports/esp32/boards. Yeah, you have to clone this repo, and follow the build instructions in the README. Yep, you can brick your board. No idea of the limitations yet. I'm about to test my application in the next few weeks. Entirely possible nothing works. |
Please rebase current branch to top of master |
I've finally rebased this up to current master, including a bunch of fixes recently contributed by @IhorNehrutsa |
To build and flash:
This command looks nuts at first glance to be sure... it's starting a temporary docker container from the official esp idf image and running the build commands inside it. There's some mucking around with users (inside the container) so that the build can access the idf files correctly while not breaking the permissions on the micropython code shared into the container. Using docker means though you don't need to install and configure anything esp / idf / compiler related on your PC, just docker. It also makes it easy to switch between different versions of IDF, just pick the appropriate image version! @mattytrentini espressif/esp-idf#11924 - currently still broken in the v5.1 image, v5.1.2 was released ~ 1 week before that fix was merged. There's also compile failures relating to ADC... probably closely related to what @IhorNehrutsa fixed previously which I've likely re-broken in the rebase to master where a lot of changes have been made to consolidate machine/adc functionality across ports. |
I am not sure why you are having such a hard hour getting it to compile properly using IDF5.1.2 Click me to see build log.make clean -j 32 -C lib/micropython/ports/esp32 LV_CFLAGS="-DLV_KCONFIG_IGNORE=1" LV_PORT=esp32 BOARD=ESP32_GENERIC_S3 BOARD_VARIANT=SPIRAM_OCT USER_C_MODULES=../../../../../micropython.cmake FROZEN_MANIFEST="********/new_binding/lvgl_micropython/build/manifest.py"
make: Entering directory '********/new_binding/lvgl_micropython/lib/micropython/ports/esp32'
idf.py -D MICROPY_BOARD=ESP32_GENERIC_S3 -D MICROPY_BOARD_DIR=********/new_binding/lvgl_micropython/lib/micropython/ports/esp32/boards/ESP32_GENERIC_S3 -DUSER_C_MODULES=../../../../../micropython.cmake -D MICROPY_FROZEN_MANIFEST=********/new_binding/lvgl_micropython/build/manifest.py -D MICROPY_BOARD_VARIANT=SPIRAM_OCT -B build-ESP32_GENERIC_S3-SPIRAM_OCT -p /dev/ttyUSB0 -b 460800 fullclean
Executing action: fullclean
Executing action: remove_managed_components
Done
make: Leaving directory '********/new_binding/lvgl_micropython/lib/micropython/ports/esp32'
********/new_binding/lvgl_micropython/driver/display/display_driver_framework.py
********/new_binding/lvgl_micropython/driver/fs_driver.py
********/new_binding/lvgl_micropython/utils/lv_utils.py
make -j 32 -C lib/micropython/ports/esp32 LV_CFLAGS="-DLV_KCONFIG_IGNORE=1" LV_PORT=esp32 BOARD=ESP32_GENERIC_S3 BOARD_VARIANT=SPIRAM_OCT USER_C_MODULES=../../../../../micropython.cmake FROZEN_MANIFEST="********/new_binding/lvgl_micropython/build/manifest.py"
make: Entering directory '********/new_binding/lvgl_micropython/lib/micropython/ports/esp32'
idf.py -D MICROPY_BOARD=ESP32_GENERIC_S3 -D MICROPY_BOARD_DIR=********/new_binding/lvgl_micropython/lib/micropython/ports/esp32/boards/ESP32_GENERIC_S3 -DUSER_C_MODULES=../../../../../micropython.cmake -D MICROPY_FROZEN_MANIFEST=********/new_binding/lvgl_micropython/build/manifest.py -D MICROPY_BOARD_VARIANT=SPIRAM_OCT -B build-ESP32_GENERIC_S3-SPIRAM_OCT build || (echo -e "See \033[1;31mhttps://github.com/micropython/micropython/wiki/Build-Troubleshooting\033[0m"; false)
Executing action: all (aliases: build)
Running cmake in directory ********/new_binding/lvgl_micropython/lib/micropython/ports/esp32/build-ESP32_GENERIC_S3-SPIRAM_OCT
Executing "cmake -G Ninja -DPYTHON_DEPS_CHECKED=1 -DPYTHON=********/.espressif/python_env/idf5.1_py3.10_env/bin/python -DESP_PLATFORM=1 -DMICROPY_BOARD=ESP32_GENERIC_S3 -DMICROPY_BOARD_DIR=********/new_binding/lvgl_micropython/lib/micropython/ports/esp32/boards/ESP32_GENERIC_S3 -DUSER_C_MODULES=../../../../../micropython.cmake -DMICROPY_FROZEN_MANIFEST=********/new_binding/lvgl_micropython/build/manifest.py -DMICROPY_BOARD_VARIANT=SPIRAM_OCT -DCCACHE_ENABLE=0 ********/new_binding/lvgl_micropython/lib/micropython/ports/esp32"...
-- Found Git: /usr/bin/git (found version "2.34.1")
-- The C compiler identification is GNU 12.2.0
-- The CXX compiler identification is GNU 12.2.0
-- The ASM compiler identification is GNU
-- Found assembler: ********/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin/xtensa-esp32s3-elf-gcc
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: ********/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin/xtensa-esp32s3-elf-gcc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: ********/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin/xtensa-esp32s3-elf-g++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Building ESP-IDF components for target esp32s3
Manifest files have changed, solving dependencies.
.......Updating lock file at ********/new_binding/lvgl_micropython/lib/micropython/ports/esp32/dependencies.lock
Processing 4 dependencies:
[1/4] espressif/esp_tinyusb (1.0.3)
[2/4] espressif/mdns (1.1.0)
[3/4] espressif/tinyusb (0.15.0~4)
[4/4] idf (5.1.2)
-- Project sdkconfig file ********/new_binding/lvgl_micropython/lib/micropython/ports/esp32/build-ESP32_GENERIC_S3-SPIRAM_OCT/sdkconfig
Loading defaults file ********/new_binding/lvgl_micropython/lib/micropython/ports/esp32/build-ESP32_GENERIC_S3-SPIRAM_OCT/sdkconfig.combined...
********/new_binding/lvgl_micropython/lib/micropython/ports/esp32/build-ESP32_GENERIC_S3-SPIRAM_OCT/sdkconfig.combined:100 CONFIG_ESP32_WIFI_IRAM_OPT was replaced with CONFIG_ESP_WIFI_IRAM_OPT
********/new_binding/lvgl_micropython/lib/micropython/ports/esp32/build-ESP32_GENERIC_S3-SPIRAM_OCT/sdkconfig.combined:101 CONFIG_ESP32_WIFI_RX_IRAM_OPT was replaced with CONFIG_ESP_WIFI_RX_IRAM_OPT
/tmp/kconfgen_tmpt99ihbsm:162 line was updated to CONFIG_ESPTOOLPY_FLASHSIZE_4MB=n
/tmp/kconfgen_tmpt99ihbsm:164 line was updated to CONFIG_ESPTOOLPY_FLASHSIZE_16MB=n
/tmp/kconfgen_tmpt99ihbsm:168 line was updated to CONFIG_ESP_DEFAULT_CPU_FREQ_MHZ_40=n
/tmp/kconfgen_tmpt99ihbsm:169 line was updated to CONFIG_ESP_DEFAULT_CPU_FREQ_MHZ_80=n
/tmp/kconfgen_tmpt99ihbsm:170 line was updated to CONFIG_ESP_DEFAULT_CPU_FREQ_MHZ_160=n
/tmp/kconfgen_tmpt99ihbsm:174 line was updated to CONFIG_SPIRAM_MODE_QUAD=n
-- Looking for sys/types.h
-- Looking for sys/types.h - found
-- Looking for stdint.h
-- Looking for stdint.h - found
-- Looking for stddef.h
-- Looking for stddef.h - found
-- Check size of time_t
-- Check size of time_t - done
-- Found Python3: ********/.espressif/python_env/idf5.1_py3.10_env/bin/python (found version "3.10.12") found components: Interpreter
-- Performing Test C_COMPILER_SUPPORTS_WFORMAT_SIGNEDNESS
-- Performing Test C_COMPILER_SUPPORTS_WFORMAT_SIGNEDNESS - Success
-- App "micropython" version: v1.22.1-dirty
-- Adding linker script ********/new_binding/lvgl_micropython/lib/micropython/ports/esp32/build-ESP32_GENERIC_S3-SPIRAM_OCT/esp-idf/esp_system/ld/memory.ld
-- Adding linker script ********/esp-idf-v5.1.2/components/esp_system/ld/esp32s3/sections.ld.in
-- Adding linker script ********/esp-idf-v5.1.2/components/esp_rom/esp32s3/ld/esp32s3.rom.ld
-- Adding linker script ********/esp-idf-v5.1.2/components/esp_rom/esp32s3/ld/esp32s3.rom.api.ld
-- Adding linker script ********/esp-idf-v5.1.2/components/esp_rom/esp32s3/ld/esp32s3.rom.libgcc.ld
-- Adding linker script ********/esp-idf-v5.1.2/components/esp_rom/esp32s3/ld/esp32s3.rom.newlib.ld
-- Adding linker script ********/esp-idf-v5.1.2/components/esp_rom/esp32s3/ld/esp32s3.rom.version.ld
-- Adding linker script ********/esp-idf-v5.1.2/components/soc/esp32s3/ld/esp32s3.peripherals.ld
-- Components: app_trace app_update bootloader bootloader_support bt cmock console cxx driver efuse esp-tls esp_adc esp_app_format esp_coex esp_common esp_eth esp_event esp_gdbstub esp_hid esp_http_client esp_http_server esp_https_ota esp_https_server esp_hw_support esp_lcd esp_local_ctrl esp_mm esp_netif esp_netif_stack esp_partition esp_phy esp_pm esp_psram esp_ringbuf esp_rom esp_system esp_timer esp_wifi espcoredump espressif__esp_tinyusb espressif__mdns espressif__tinyusb esptool_py fatfs freertos hal heap http_parser idf_test ieee802154 json log lwip main_esp32s3 mbedtls mqtt newlib nvs_flash openthread partition_table perfmon protobuf-c protocomm pthread sdmmc soc spi_flash spiffs tcp_transport touch_element ulp unity usb vfs wear_levelling wifi_provisioning wpa_supplicant xtensa
-- Component paths: ********/esp-idf-v5.1.2/components/app_trace ********/esp-idf-v5.1.2/components/app_update ********/esp-idf-v5.1.2/components/bootloader ********/esp-idf-v5.1.2/components/bootloader_support ********/esp-idf-v5.1.2/components/bt ********/esp-idf-v5.1.2/components/cmock ********/esp-idf-v5.1.2/components/console ********/esp-idf-v5.1.2/components/cxx ********/esp-idf-v5.1.2/components/driver ********/esp-idf-v5.1.2/components/efuse ********/esp-idf-v5.1.2/components/esp-tls ********/esp-idf-v5.1.2/components/esp_adc ********/esp-idf-v5.1.2/components/esp_app_format ********/esp-idf-v5.1.2/components/esp_coex ********/esp-idf-v5.1.2/components/esp_common ********/esp-idf-v5.1.2/components/esp_eth ********/esp-idf-v5.1.2/components/esp_event ********/esp-idf-v5.1.2/components/esp_gdbstub ********/esp-idf-v5.1.2/components/esp_hid ********/esp-idf-v5.1.2/components/esp_http_client ********/esp-idf-v5.1.2/components/esp_http_server ********/esp-idf-v5.1.2/components/esp_https_ota ********/esp-idf-v5.1.2/components/esp_https_server ********/esp-idf-v5.1.2/components/esp_hw_support ********/esp-idf-v5.1.2/components/esp_lcd ********/esp-idf-v5.1.2/components/esp_local_ctrl ********/esp-idf-v5.1.2/components/esp_mm ********/esp-idf-v5.1.2/components/esp_netif ********/esp-idf-v5.1.2/components/esp_netif_stack ********/esp-idf-v5.1.2/components/esp_partition ********/esp-idf-v5.1.2/components/esp_phy ********/esp-idf-v5.1.2/components/esp_pm ********/esp-idf-v5.1.2/components/esp_psram ********/esp-idf-v5.1.2/components/esp_ringbuf ********/esp-idf-v5.1.2/components/esp_rom ********/esp-idf-v5.1.2/components/esp_system ********/esp-idf-v5.1.2/components/esp_timer ********/esp-idf-v5.1.2/components/esp_wifi ********/esp-idf-v5.1.2/components/espcoredump ********/new_binding/lvgl_micropython/lib/micropython/ports/esp32/managed_components/espressif__esp_tinyusb ********/new_binding/lvgl_micropython/lib/micropython/ports/esp32/managed_components/espressif__mdns ********/new_binding/lvgl_micropython/lib/micropython/ports/esp32/managed_components/espressif__tinyusb ********/esp-idf-v5.1.2/components/esptool_py ********/esp-idf-v5.1.2/components/fatfs ********/esp-idf-v5.1.2/components/freertos ********/esp-idf-v5.1.2/components/hal ********/esp-idf-v5.1.2/components/heap ********/esp-idf-v5.1.2/components/http_parser ********/esp-idf-v5.1.2/components/idf_test ********/esp-idf-v5.1.2/components/ieee802154 ********/esp-idf-v5.1.2/components/json ********/esp-idf-v5.1.2/components/log ********/esp-idf-v5.1.2/components/lwip ********/new_binding/lvgl_micropython/lib/micropython/ports/esp32/main_esp32s3 ********/esp-idf-v5.1.2/components/mbedtls ********/esp-idf-v5.1.2/components/mqtt ********/esp-idf-v5.1.2/components/newlib ********/esp-idf-v5.1.2/components/nvs_flash ********/esp-idf-v5.1.2/components/openthread ********/esp-idf-v5.1.2/components/partition_table ********/esp-idf-v5.1.2/components/perfmon ********/esp-idf-v5.1.2/components/protobuf-c ********/esp-idf-v5.1.2/components/protocomm ********/esp-idf-v5.1.2/components/pthread ********/esp-idf-v5.1.2/components/sdmmc ********/esp-idf-v5.1.2/components/soc ********/esp-idf-v5.1.2/components/spi_flash ********/esp-idf-v5.1.2/components/spiffs ********/esp-idf-v5.1.2/components/tcp_transport ********/esp-idf-v5.1.2/components/touch_element ********/esp-idf-v5.1.2/components/ulp ********/esp-idf-v5.1.2/components/unity ********/esp-idf-v5.1.2/components/usb ********/esp-idf-v5.1.2/components/vfs ********/esp-idf-v5.1.2/components/wear_levelling ********/esp-idf-v5.1.2/components/wifi_provisioning ********/esp-idf-v5.1.2/components/wpa_supplicant ********/esp-idf-v5.1.2/components/xtensa
-- Configuring done
-- Generating done
-- Build files have been written to: ********/new_binding/lvgl_micropython/lib/micropython/ports/esp32/build-ESP32_GENERIC_S3-SPIRAM_OCT
Running ninja in directory ********/new_binding/lvgl_micropython/lib/micropython/ports/esp32/build-ESP32_GENERIC_S3-SPIRAM_OCT
Executing "ninja all"...
[1/1893] Generating project_elf_src_esp32s3.c
[2/1893] Generating memory.ld linker script...
[3/1893] Building C object esp-idf/main_esp32s3/CMakeFiles/micropy_extmod_btree.dir********/new_binding/lvgl_micropython/lib/micropython/lib/berkeley-db-1.xx/btree/bt_debug.c.obj
....
[28/1893] Building C object esp-idf/driver/CMakeFiles/__idf_driver.dir/gptimer/gptimer_priv.c.obj
[29/1893] Generating ../../partition_table/partition-table.bin
Partition table binary generated. Contents:
*******************************************************************************
# ESP-IDF Partition Table
# Name, Type, SubType, Offset, Size, Flags
nvs,data,nvs,0x9000,24K,
phy_init,data,phy,0xf000,4K,
factory,app,factory,0x10000,2444K,
vfs,data,fat,0x273000,5684K,
*******************************************************************************
[30/1893] Building C object esp-idf/mbedtls/mbedtls/library/CMakeFiles/mbedcrypto.dir/base64.c.obj
....
[1055/1893] Linking C static library esp-idf/esp_app_format/libesp_app_format.a
[1056/1893] Generating ********/new_binding/lvgl_micropython/lib/micropython/mpy-cross/build/mpy-cross
make[1]: Entering directory '********/new_binding/lvgl_micropython/lib/micropython/ports/esp32/build-ESP32_GENERIC_S3-SPIRAM_OCT/esp-idf/main_esp32s3'
make[1]: warning: jobserver unavailable: using -j1. Add '+' to parent make rule.
Use make V=1 or set BUILD_VERBOSE in your environment to increase build verbosity.
GEN build/genhdr/mpversion.h
CC ../py/modsys.c
CC main.c
LINK build/mpy-cross
text data bss dec hex filename
326534 13784 872 341190 534c6 build/mpy-cross
make[1]: Leaving directory '********/new_binding/lvgl_micropython/lib/micropython/mpy-cross'
[1057/1893] Linking CXX static library esp-idf/mbedtls/mbedtls/library/libmbedtls.a
....
[1061/1893] Linking CXX static library esp-idf/mbedtls/mbedtls/3rdparty/everest/libeverest.a
[1062/1893] Linking C static library esp-idf/esp_pm/libesp_pm.a
....
[1088/1893] Linking C static library esp-idf/wifi_provisioning/libwifi_provisioning.a
[1089/1893] Generating ../../genhdr/qstr.i.last
[1090/1893] Building C object esp-idf/espressif__mdns/CMakeFiles/__idf_espressif__mdns.dir/mdns.c.obj
[1091/1893] Linking C static library esp-idf/espressif__mdns/libespressif__mdns.a
[1092/1893] Linking C static library esp-idf/esp_local_ctrl/libesp_local_ctrl.a
[1093/1893] Generating ../../genhdr/qstr.split
[1094/1893] Generating ../../genhdr/qstrdefs.collected.h
QSTR updated
[1095/1893] Generating ../../genhdr/qstrdefs.preprocessed.h
[1096/1893] Generating ../../genhdr/qstrdefs.generated.h
[1097/1893] Generating ../../genhdr/root_pointers.split
[1098/1893] Generating ../../genhdr/root_pointers.collected
Root pointer registrations updated
[1099/1893] Generating ../../genhdr/root_pointers.h
[1100/1893] Performing configure step for 'bootloader'
-- Found Git: /usr/bin/git (found version "2.34.1")
-- The C compiler identification is GNU 12.2.0
-- The CXX compiler identification is GNU 12.2.0
-- The ASM compiler identification is GNU
-- Found assembler: ********/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin/xtensa-esp32s3-elf-gcc
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: ********/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin/xtensa-esp32s3-elf-gcc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: ********/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin/xtensa-esp32s3-elf-g++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Building ESP-IDF components for target esp32s3
-- Project sdkconfig file ********/new_binding/lvgl_micropython/lib/micropython/ports/esp32/build-ESP32_GENERIC_S3-SPIRAM_OCT/sdkconfig
Compiler supported targets: xtensa-esp32s3-elf
-- Looking for sys/types.h
-- Looking for sys/types.h - found
-- Looking for stdint.h
-- Looking for stdint.h - found
-- Looking for stddef.h
-- Looking for stddef.h - found
-- Check size of time_t
-- Check size of time_t - done
-- Adding linker script ********/esp-idf-v5.1.2/components/soc/esp32s3/ld/esp32s3.peripherals.ld
-- App "bootloader" version: v5.1.2
-- Adding linker script ********/esp-idf-v5.1.2/components/esp_rom/esp32s3/ld/esp32s3.rom.ld
-- Adding linker script ********/esp-idf-v5.1.2/components/esp_rom/esp32s3/ld/esp32s3.rom.api.ld
-- Adding linker script ********/esp-idf-v5.1.2/components/esp_rom/esp32s3/ld/esp32s3.rom.libgcc.ld
-- Adding linker script ********/esp-idf-v5.1.2/components/esp_rom/esp32s3/ld/esp32s3.rom.newlib.ld
-- Adding linker script ********/esp-idf-v5.1.2/components/bootloader/subproject/main/ld/esp32s3/bootloader.ld
-- Adding linker script ********/esp-idf-v5.1.2/components/bootloader/subproject/main/ld/esp32s3/bootloader.rom.ld
-- Components: bootloader bootloader_support efuse esp_app_format esp_common esp_hw_support esp_rom esp_system esptool_py freertos hal log main micro-ecc newlib partition_table soc spi_flash xtensa
-- Component paths: ********/esp-idf-v5.1.2/components/bootloader ********/esp-idf-v5.1.2/components/bootloader_support ********/esp-idf-v5.1.2/components/efuse ********/esp-idf-v5.1.2/components/esp_app_format ********/esp-idf-v5.1.2/components/esp_common ********/esp-idf-v5.1.2/components/esp_hw_support ********/esp-idf-v5.1.2/components/esp_rom ********/esp-idf-v5.1.2/components/esp_system ********/esp-idf-v5.1.2/components/esptool_py ********/esp-idf-v5.1.2/components/freertos ********/esp-idf-v5.1.2/components/hal ********/esp-idf-v5.1.2/components/log ********/esp-idf-v5.1.2/components/bootloader/subproject/main ********/esp-idf-v5.1.2/components/bootloader/subproject/components/micro-ecc ********/esp-idf-v5.1.2/components/newlib ********/esp-idf-v5.1.2/components/partition_table ********/esp-idf-v5.1.2/components/soc ********/esp-idf-v5.1.2/components/spi_flash ********/esp-idf-v5.1.2/components/xtensa
-- Configuring done
-- Generating done
-- Build files have been written to: ********/new_binding/lvgl_micropython/lib/micropython/ports/esp32/build-ESP32_GENERIC_S3-SPIRAM_OCT/bootloader
[1101/1893] cd ********/new_binding/lvgl_micropython/lib/micropython/ports/esp32/build-ESP32_GENERIC_S3-SPIRAM_OCT/esp-idf/main_esp32s3 && ********/.espressif/python_env/idf5.1_py3.10_env/bin/python ********/new_binding/lvgl_micropython/lib/micropython/tools/makemanifest.py -o ********/new_binding/lvgl_micropython/lib/micropython/ports/esp32/build-ESP32_GENERIC_S3-SPIRAM_OCT/frozen_content.c -v BOARD_DIR=********/new_binding/lvgl_micropython/lib/micropython/ports/esp32/boards/ESP32_GENERIC_S3 -v MPY_DIR=********/new_binding/lvgl_micropython/lib/micropython -v MPY_LIB_DIR=********/new_binding/lvgl_micropython/lib/micropython/lib/micropython-lib -v PORT_DIR=********/new_binding/lvgl_micropython/lib/micropython/ports/esp32 -b ********/new_binding/lvgl_micropython/lib/micropython/ports/esp32/build-ESP32_GENERIC_S3-SPIRAM_OCT -f-march=xtensawin --mpy-tool-flags= ********/new_binding/lvgl_micropython/build/manifest.py
MPY apa106.py
MPY _boot.py
MPY flashbdev.py
MPY inisetup.py
MPY espnow.py
MPY asyncio/__init__.py
MPY asyncio/core.py
MPY asyncio/event.py
MPY asyncio/funcs.py
MPY asyncio/lock.py
MPY asyncio/stream.py
MPY uasyncio.py
MPY requests/__init__.py
MPY mip/__init__.py
MPY ntptime.py
MPY webrepl.py
MPY webrepl_setup.py
MPY urequests.py
MPY aioespnow.py
MPY dht.py
MPY onewire.py
MPY ds18x20.py
MPY neopixel.py
MPY umqtt/robust.py
MPY umqtt/simple.py
MPY upysh.py
MPY display_driver_framework.py
MPY fs_driver.py
MPY lv_utils.py
GEN ********/new_binding/lvgl_micropython/lib/micropython/ports/esp32/build-ESP32_GENERIC_S3-SPIRAM_OCT/frozen_content.c
[1102/1893] Performing build step for 'bootloader'
[1/110] Generating project_elf_src_esp32s3.c
[2/110] Building C object esp-idf/xtensa/CMakeFiles/__idf_xtensa.dir/eri.c.obj
....
[60/110] Building C object esp-idf/efuse/CMakeFiles/__idf_efuse.dir/src/esp_efuse_fields.c.obj
[61/110] Building ASM object esp-idf/esp_rom/CMakeFiles/__idf_esp_rom.dir/patches/esp_rom_longjmp.S.obj
[62/110] Building C object esp-idf/esp_system/CMakeFiles/__idf_esp_system.dir/esp_err.c.obj
[63/110] Building C object esp-idf/efuse/CMakeFiles/__idf_efuse.dir/esp32s3/esp_efuse_rtc_calib.c.obj
[64/110] Building ASM object esp-idf/esp_rom/CMakeFiles/__idf_esp_rom.dir/patches/esp_rom_cache_writeback_esp32s3.S.obj
[65/110] Building C object esp-idf/esp_common/CMakeFiles/__idf_esp_common.dir/src/esp_err_to_name.c.obj
....
[108/110] Linking C executable bootloader.elf
[109/110] Generating binary image from built executable
esptool.py v4.7.0
Creating esp32s3 image...
Merged 1 ELF section
Successfully created esp32s3 image.
Generated ********/new_binding/lvgl_micropython/lib/micropython/ports/esp32/build-ESP32_GENERIC_S3-SPIRAM_OCT/bootloader/bootloader.bin
[110/110] cd ********/new_binding/lvgl_micropython/lib/micropython/ports/esp32/build-ESP32_GENERIC_S3-SPIRAM_OCT/bootloader/esp-idf/esptool_py && ********/.espressif/python_env/idf5.1_py3.10_env/bin/python ********/esp-idf-v5.1.2/components/partition_table/check_sizes.py --offset 0x8000 bootloader 0x0 ********/new_binding/lvgl_micropython/lib/micropython/ports/esp32/build-ESP32_GENERIC_S3-SPIRAM_OCT/bootloader/bootloader.bin
Bootloader binary size 0x4a20 bytes. 0x35e0 bytes (42%) free.
[1103/1893] No install step for 'bootloader'
[1104/1893] Completed 'bootloader'
[1105/1893] Generating ../../genhdr/moduledefs.split
[1106/1893] Generating ../../genhdr/moduledefs.collected
Module registrations updated
[1107/1893] Generating ../../genhdr/moduledefs.h
[1108/1893] Building C object esp-idf/main_esp32s3/CMakeFiles/__idf_main_esp32s3.dir********/new_binding/lvgl_micropython/lib/micropython/py/asmthumb.c.obj
....
[1611/1893] Linking C static library esp-idf/main_esp32s3/libmain_esp32s3.a
[1612/1893] Generating ld/sections.ld
[1613/1893] Building C object CMakeFiles/micropython.elf.dir/project_elf_src_esp32s3.c.obj
....
[1891/1893] Linking CXX executable micropython.elf
[1892/1893] Generating binary image from built executable
esptool.py v4.7.0
Creating esp32s3 image...
Merged 3 ELF sections
Successfully created esp32s3 image.
Generated ********/new_binding/lvgl_micropython/lib/micropython/ports/esp32/build-ESP32_GENERIC_S3-SPIRAM_OCT/micropython.bin
[1893/1893] cd ********/new_binding/lvgl_micropython/lib/micropython/ports/esp32/build-ESP32_GENERIC_S3-SPIRAM_OCT/esp-idf/esptool_py && ********/.espressif/python_env/idf5.1_py3.10_env/bin/python ********/esp-idf-v5.1.2/components/partition_table/check_sizes.py --offset 0x8000 partition --type app ********/new_binding/lvgl_micropython/lib/micropython/ports/esp32/build-ESP32_GENERIC_S3-SPIRAM_OCT/partition_table/partition-table.bin ********/new_binding/lvgl_micropython/lib/micropython/ports/esp32/build-ESP32_GENERIC_S3-SPIRAM_OCT/micropython.bin
micropython.bin binary size 0x23cb70 bytes. Smallest app partition is 0x263000 bytes. 0x26490 bytes (6%) free.
Project build complete. To flash, run this command:
********/.espressif/python_env/idf5.1_py3.10_env/bin/python ../../../../../../esp-idf-v5.1.2/components/esptool_py/esptool/esptool.py -p (PORT) -b 460800 --before default_reset --after no_reset --chip esp32s3 write_flash --flash_mode dio --flash_size 8MB --flash_freq 80m 0x0 build-ESP32_GENERIC_S3-SPIRAM_OCT/bootloader/bootloader.bin 0x8000 build-ESP32_GENERIC_S3-SPIRAM_OCT/partition_table/partition-table.bin 0x10000 build-ESP32_GENERIC_S3-SPIRAM_OCT/micropython.bin
or run 'idf.py -p (PORT) flash'
bootloader @0x000000 18976 ( 13792 remaining)
partitions @0x008000 3072 ( 1024 remaining)
application @0x010000 2345840 ( 156816 remaining)
total 2411376
make: Leaving directory '********/new_binding/lvgl_micropython/lib/micropython/ports/esp32'
Compiler supported targets: xtensa-esp32s3-elf
Including User C Module(s) from ../../../../../micropython.cmake
Found User C Module(s): usermod_lcd_bus, usermod_heap_caps, usermod_lvgl, lvgl_interface note the I know I am not compiling for the C6 is the ESP-IDF API different for the C6 vs the S3? |
Yes. Some APIs are deprecated but still supported (as legacy) on the S3 and other micros. Those legacy APIs don't exist for the C6. So some components need to be rewritten. |
ahhh OK. That makes sense then. |
I was able to compile micropython using the code from: #11869 (andrewleech:esp32c6) and fix ADC calibration and a problem with UART name. The code is here: https://github.com/mancausoft/micropython/tree/esp32c6 I also have the image to test here: https://github.com/mancausoft/micropython/releases/tag/0.0.0 EDIT: I forgot to say that I'm using idf 5.2.0 to compile it |
It may even be required for compliance reasons in certain scenarios.
Even so, I think that's going to be tricky to solve properly. If the chip really doesn't allow overlapping PMP regions then there are two options: either make the region permissions overridable and weaken the overall security (the flags they use only allow to write to those registers once), or make a section of IRAM executable whose size is set at compile time (less than ideal for applications like MicroPython, where the maximum size for such a region is not known at compile time). For the detail-inclined, more information about this feature is here: https://github.com/riscv/riscv-isa-manual/blob/main/src/machine.adoc#physical-memory-protection |
Yes, I think for now we can disable Then provide a way to easily reenable that option which also automatically disables the native emitter. That should be easy, just a few lines it #if CONFIG_ESP_SYSTEM_PMP_IDRAM_SPLIT
#define MICROPY_EMIT_RV32 (0)
#else
#define MICROPY_EMIT_RV32 (1)
#endif And also: #if CONFIG_IDF_TARGET_ESP32C6
// On this target all RAM is executable so no need for a custom commit function.
#else
void *esp_native_code_commit(void *, size_t, void *);
#define MP_PLAT_COMMIT_EXEC(buf, len, reloc) esp_native_code_commit(buf, len, reloc)
#endif |
I've added a commit to disable along with the other suggestions @dpgeorge thanks. I made this change in the base With the change as pushed the test suite is looking reasonable
|
Thanks @andrewleech , this looks good now. Can you please rebase on master, because there are conflicts with the recent TinyUSB changes. |
That's fixed now thanks @dpgeorge |
This commit adds general support for ESP32-C6 SoCs. Signed-off-by: Andrew Leech <andrew@alelec.net>
Signed-off-by: IhorNehrutsa <IhorNehrutsa@gmail.com>
Signed-off-by: IhorNehrutsa <Ihor.Nehrutsa@gmail.com>
Signed-off-by: IhorNehrutsa <Ihor.Nehrutsa@gmail.com>
Signed-off-by: Andrew Leech <andrew@alelec.net>
Signed-off-by: Andrew Leech <andrew@alelec.net>
In idf v5.2.1 if the port flag is set it's validated even on jobs that don't access hardware like clean. This causes the job to fail if device isn't connected. Signed-off-by: Andrew Leech <andrew@alelec.net>
Signed-off-by: Andrew Leech <andrew@alelec.net>
Signed-off-by: Matt Trentini <matt.trentini@gmail.com>
Signed-off-by: Matt Trentini <matt.trentini@gmail.com>
Signed-off-by: Andrew Leech <andrew@alelec.net>
Signed-off-by: Damien George <damien@micropython.org>
I tested again on C3 and C6 and the test suite (and new Merged!! |
Workarounds for stack guard are still needed on C6. #15771 only covers C3 boards. |
@mzakharocsc are you able to reproduce the stack pointer issue on a C6 board? |
Thanks to everone here who contributed to the commits in the MR along with all the testing and discussions! |
My original issue submission was discovered on C6 board. #15667. As per https://github.com/espressif/esp-idf/releases/tag/v5.2, stack guard is enabled by default on esp32c2/esp32c3/esp32c6/esp32h2 targets. So yes, C6 needs a fix as well. |
OK, let's reopen that issue and continue the discussion there. |
Does anyone know why ESP32-C6 build is so much bigger than ESP32-C3?
|
Good question... looks like the Wi-Fi and Bluetooth stacks on the C6 are both a bit bigger (makes particular sense for Wi-Fi given the Wi-Fi 6 support). Building some ESP-IDF examples with
So that's +124KB for the Wi-Fi/Bluetooth peripheral coexistence example, compared to +175KB for MicroPython. MicroPython probably pulls in even more of each stack, though, due to supporting more functions at runtime. C6 is new so Espressif might get this number down over time, it might even be lower in ESP-IDF master branch (these numbers are from v5.2.2 as used in MicroPython). |
The is esp32c6 officially supported in IDF v5.1 but requires a number of changes to work...
Pulling together changes and generic board support needed here.