-
-
Notifications
You must be signed in to change notification settings - Fork 7.4k
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
base: master
Are you sure you want to change the base?
esp32c6 support (IDF v5.2) #11869
Conversation
@@ -196,5 +196,9 @@ foreach(comp ${IDF_COMPONENTS}) | |||
micropy_gather_target_properties(${comp}) | |||
endforeach() | |||
|
|||
|
|||
list(APPEND MICROPY_CPP_INC_EXTRA ${IDF_PATH}/components/riscv/include) | |||
list(APPEND MICROPY_CPP_INC_EXTRA ${IDF_PATH}/components/soc/soc/include) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm expecting these lines to not be required for real / merged support, but I've been having issues with the risk-v compiles and this is part of the WIP to get it going.
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.39% 98.39% -0.01%
==========================================
Files 161 161
Lines 21204 21200 -4
==========================================
- Hits 20864 20860 -4
Misses 340 340 ☔ 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 |
Do you have a list of what is working currently and what's not for this board? Is there currently a stable version anyehere - if so, where do I find it? |
I've just added a board definition for the M5Stack NanoC6 (limits the pins to and defines >>> from machine import Pin, I2C
>>> help(Pin.board)
object <class 'board'> is of type type
G1 -- Pin(1)
G2 -- Pin(2)
IR_LED -- Pin(3)
LED_BLUE -- Pin(7)
BUTTON -- Pin(9)
NEOPIXEL_POWER -- Pin(19)
NEOPIXEL -- Pin(20)
>>> I2C(0)
I2C(0, scl=1, sda=2, freq=400000)
>>>
I've tested
It hasn't been merged yet, so builds aren't part of the regular CI system. For now, you ought to build it yourself, though I've attached the my latest build of the > esptool.py --chip esp32c6 erase_flash # Only necessary when the partition layout changes, ie the first time you deploy
> esptool.py --chip esp32c6 --baud 460800 write_flash -z 0x0 esp32_generic_c6_firmware.bin (You may need to use |
I don't know of anything not working at the moment, but I've tested even less that @mattytrentini to be honest! |
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>
This new calibration routine exists for S3 in v5.1.1. It works for all platforms in 5.2.1. Signed-off-by: Andrew Leech <andrew@alelec.net>
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>
does that mean that zigbee is working? |
Oh, I meant all standard micropython features. I don't know of anyone who's written a ZigBee stack / bindings for micropython yet. Same goes for matter and thread. |
Signed-off-by: Matt Trentini <matt.trentini@gmail.com>
I've found an issue with the ADC implementation:
Here's a quick patch:
|
Hmm, it may need a little more work - that C6 ADC peripheral looks different again to the rest of the ESP32 family. Specifically, it has only one 12-bit SAR which can be assigned to seven pins. I think the single ADC channel is unique to the C6? But thanks for the bug report and patch - that helps, a lot! |
For reference, this seems to be the relevant documentation. Indeed, it shows a 12-bit SAR with 7 channels/pins GPIO0 through GPIO6. The fact that 13 bit are enabled in my patch relate to the "Deprecated ADC APIs" being used here, which for some reason don't allow the other bit settings. The API documentation is unclear about all of this, even hinting at 9 through 13 bits being allowed and that there's 2 ADC units and up to 10 channels. Not sure what to make of all of this, but I guess we'd have to fix machine_adc.c and machine_adc_block.c to reflect this, as you already pointed out. |
Signed-off-by: Matt Trentini <matt.trentini@gmail.com>
I'm interested in this development since I have also obtained an ESP32-C6 dev board, but none of the builds work. While all of them flash fine, the only output I get over the serial interface is this:
Flashing other firmwares (e.g. the blink examples) works fine. Does anyone have any idea what I am doing wrong here and/or how to troubleshoot this further? |
Can you please link to the board that you're using? |
Certainly, it is the ESP32-C6-WROOM-1-N8 variant listed here. |
Yes, certainly! Your problem looks like the one I had some days ago, to which I've found the solution. In short: Just use the other USB port on the Dev Kit, the C6 firmware by default does not use the serial aka UART port for its console. EDIT: I've checked the link you sent and your board definitely has two USB ports, albeit they are labelled differently. |
Ah that's interesting, I've got two C6 modules but both are small and only have the USB that's natively handled by the chip itself, they don't have a UART connected. I for one am very happy esp chips are moving towards built in USB rather than needing separate conversion chips. I didn't realise other Dev boards for this chip might still default to a UART converter! |
When I first got the C6 Dev Kit and found that it has two USB ports, I honestly was a bit confused. But at the end of the day, this frees us to use the UART port for other applications; there's quite a few peripherals which work with a serial connection. The fact that the Dev Kit still has a conversion chip and thus a second USB port is probably meant for easier debugging purposes and, well, why not. Meaning to say that I'm fine with the default setting of using the main/integrated USB for the Micropython console, but I still suggest that this should be documented somewhere. |
Thanks for the assistance, this is exactly what is going on! The REPL is available on the second USB port. |
The correct doc links are helpful too, certainly the best path would be to follow those docs and use the newer drivers, moving away from the 4.x deprecated drivers is a slow but desirable goal certainly! |
It would probably be worth making a board definition fit this that enables the UART repl as well to avoid the confusion! |
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.