Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@
[submodule "ports/espressif/esp-idf"]
path = ports/espressif/esp-idf
url = https://github.com/adafruit/esp-idf.git
branch = circuitpython-v5.4.1
branch = circuitpython-v5.5.1
[submodule "ports/espressif/esp-protocols"]
path = ports/espressif/esp-protocols
url = https://github.com/adafruit/esp-protocols.git
Expand Down
2 changes: 1 addition & 1 deletion lib/tinyusb
Submodule tinyusb updated 240 files
68 changes: 54 additions & 14 deletions ports/espressif/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ include ../../py/circuitpy_mkenv.mk

ifeq ($(IDF_TARGET),esp32s3)
BT_IDF_TARGET = esp32c3
else ifeq ($(IDF_TARGET),esp32c61)
BT_IDF_TARGET = esp32c6
else
BT_IDF_TARGET = $(IDF_TARGET)
endif
Expand Down Expand Up @@ -64,6 +66,7 @@ INC += \
-isystem esp-idf/components/esp_driver_i2s/include \
-isystem esp-idf/components/esp_driver_$(IDF_TARGET)/include \
-isystem esp-idf/components/esp_driver_ledc/include \
-isystem esp-idf/components/esp_driver_parlio/include \
-isystem esp-idf/components/esp_driver_pcnt/include \
-isystem esp-idf/components/esp_driver_rmt/include \
-isystem esp-idf/components/esp_driver_sdio/include \
Expand Down Expand Up @@ -149,20 +152,26 @@ CFLAGS += -DSTACK_CANARY_VALUE=0xa5a5a5a5
REGISTRATION_FUNCTIONS = \
-u ld_include_highint_hdl \
-u __cxx_fatal_exception \
-u __cxx_init_dummy \
-u __cxa_guard_dummy \
-u esp_app_desc \
-u esp_timer_init_include_func \
-u uart_vfs_include_dev_init \
-u esp_vfs_include_console_register \
-u __ubsan_include \
-u esp_system_include_startup_funcs \
-u esp_efuse_startup_include_func \
-u newlib_include_heap_impl \
-u newlib_include_syscalls_impl \
-u newlib_include_pthread_impl \
-u newlib_include_assert_impl \
-u newlib_include_init_funcs \
-u esp_libc_include_heap_impl \
-u esp_libc_include_reent_syscalls_impl \
-u esp_libc_include_syscalls_impl \
-u esp_libc_include_pthread_impl \
-u esp_libc_include_assert_impl \
-u esp_libc_include_getentropy_impl \
-u esp_libc_include_init_funcs \
-u esp_libc_init_funcs \
-u include_esp_phy_override \
-u vfs_include_syscalls_impl
-u vfs_include_syscalls_impl \
-u esp_vfs_include_nullfs_register


#Debugging/Optimization
Expand Down Expand Up @@ -196,7 +205,6 @@ CFLAGS += $(INC) -Werror -Wall -std=gnu11 -Wl,--gc-sections $(BASE_CFLAGS) $(C_D
# Most current ESPs have nano versions of newlib in ROM so we use them.
ifneq ($(IDF_TARGET),esp32c6)
CFLAGS += --specs=nano.specs
LDFLAGS += -T$(IDF_TARGET).rom.newlib-nano.ld
else
LDFLAGS += -T$(IDF_TARGET).rom.newlib-normal.ld
endif
Expand All @@ -222,7 +230,6 @@ else ifeq ($(IDF_TARGET_ARCH),riscv)
-Trom.api.ld
endif

$(BUILD)/lib/tlsf/tlsf.o: CFLAGS += -Wno-cast-align

LDFLAGS += $(CFLAGS) -Wl,-nostdlib -Wl,-Map=$@.map -Wl,-cref -Wl,--undefined=uxTopUsedPriority

Expand All @@ -244,7 +251,9 @@ LDFLAGS += \
ifeq ($(IDF_TARGET),esp32)
LDFLAGS += \
-Tesp32.rom.newlib-data.ld \
-Tesp32.rom.newlib-funcs.ld \
-Tesp32.rom.syscalls.ld \
-Tesp32.rom.libc-funcs.ld \
-Tesp32.rom.newlib-reent-funcs.ld \
-Tesp32.rom.spiflash_legacy.ld

CHIP_COMPONENTS = \
Expand All @@ -254,7 +263,9 @@ else ifeq ($(IDF_TARGET),esp32c2)
LDFLAGS += \
-Tesp32c2.rom.ble.ld \
-Tesp32c2.rom.heap.ld \
-Tesp32c2.rom.libc.ld \
-Tesp32c2.rom.newlib.ld \
-Tesp32c2.rom.newlib-nano.ld \
-Tesp32c2.rom.version.ld \
-Tesp32c2.rom.systimer.ld \
-Tesp32c2.rom.wdt.ld
Expand All @@ -267,6 +278,7 @@ CHIP_COMPONENTS = \
else ifeq ($(IDF_TARGET),esp32c3)
LDFLAGS += \
-Tesp32c3.rom.newlib.ld \
-Tesp32c3.rom.libc.ld \
-Tesp32c3.rom.version.ld \
-Tesp32c3.rom.eco3_bt_funcs.ld \
-Tesp32c3.rom.eco3.ld \
Expand All @@ -280,18 +292,37 @@ LDFLAGS += \
-Tesp32c6.rom.phy.ld \
-Tesp32c6.rom.pp.ld \
-Tesp32c6.rom.net80211.ld \
-Tesp32c6.rom.libc.ld \
-Tesp32c6.rom.newlib.ld \
-Tesp32c6.rom.coexist.ld \
-Tesp32c6.rom.heap.ld \
-Tesp32c6.rom.systimer.ld \
-Tesp32c6.rom.wdt.ld


CHIP_COMPONENTS = \
esp_driver_tsens

else ifeq ($(IDF_TARGET),esp32c61)
LDFLAGS += \
-Tesp32c61.rom.phy.ld \
-Tesp32c61.rom.pp.ld \
-Tesp32c61.rom.net80211.ld \
-Tesp32c61.rom.libc.ld \
-Tesp32c61.rom.newlib.ld \
-Tesp32c61.rom.version.ld \
-Tesp32c61.rom.coexist.ld \
-Tesp32c61.rom.heap.ld \
-Tesp32c61.rom.systimer.ld \
-Tesp32c61.rom.wdt.ld


CHIP_COMPONENTS = \
esp_driver_tsens

else ifeq ($(IDF_TARGET),esp32p4)
LDFLAGS += \
-Tesp32p4.rom.libc.ld \
-Tesp32p4.rom.newlib.ld \
-Tesp32p4.rom.systimer.ld \
-Tesp32p4.rom.wdt.ld
Expand All @@ -303,6 +334,7 @@ CHIP_COMPONENTS = \
else ifeq ($(IDF_TARGET),esp32h2)
LDFLAGS += \
-Tesp32h2.rom.heap.ld \
-Tesp32h2.rom.libc.ld \
-Tesp32h2.rom.newlib.ld \
-Tesp32h2.rom.systimer.ld \
-Tesp32h2.rom.wdt.ld
Expand All @@ -312,8 +344,9 @@ CHIP_COMPONENTS = \

else ifeq ($(IDF_TARGET),esp32s2)
LDFLAGS += \
-Tesp32s2.rom.libc-funcs.ld \
-Tesp32s2.rom.newlib-data.ld \
-Tesp32s2.rom.newlib-funcs.ld \
-Tesp32s2.rom.newlib-reent-funcs.ld \
-Tesp32s2.rom.spiflash_legacy.ld

CHIP_COMPONENTS = \
Expand All @@ -322,6 +355,7 @@ CHIP_COMPONENTS = \

else ifeq ($(IDF_TARGET),esp32s3)
LDFLAGS += \
-Tesp32s3.rom.libc.ld \
-Tesp32s3.rom.newlib.ld \
-Tesp32s3.rom.version.ld \
-Tesp32s3.rom.systimer.ld \
Expand Down Expand Up @@ -350,6 +384,8 @@ else ifeq ($(IDF_TARGET),esp32c3)
CFLAGS += -DCFG_TUSB_MCU=OPT_MCU_ESP32C3
else ifeq ($(IDF_TARGET),esp32c6)
CFLAGS += -DCFG_TUSB_MCU=OPT_MCU_ESP32C6
else ifeq ($(IDF_TARGET),esp32c61)
CFLAGS += -DCFG_TUSB_MCU=OPT_MCU_ESP32C61
else ifeq ($(IDF_TARGET),esp32p4)
CFLAGS += -DCFG_TUSB_MCU=OPT_MCU_ESP32P4
else ifeq ($(IDF_TARGET),esp32h2)
Expand Down Expand Up @@ -662,7 +698,8 @@ ifneq ($(IDF_TARGET),esp32p4)
BINARY_BLOBS = esp-idf/components/esp_phy/lib/$(IDF_TARGET)/libphy.a
endif
ifneq ($(CIRCUITPY_WIFI),0)
BINARY_BLOBS += esp-idf/components/esp_coex/lib/$(IDF_TARGET)/libcoexist.a $(addprefix esp-idf/components/esp_wifi/lib/$(IDF_TARGET)/, $(BINARY_WIFI_BLOBS))
BINARY_BLOBS += $(addprefix esp-idf/components/esp_wifi/lib/$(IDF_TARGET)/, $(BINARY_WIFI_BLOBS))
BINARY_BLOBS += esp-idf/components/esp_coex/lib/$(IDF_TARGET)/libcoexist.a
ifneq ($(IDF_TARGET),esp32c2)
BINARY_BLOBS += $(addprefix esp-idf/components/esp_wifi/lib/$(IDF_TARGET)/, libmesh.a libwapi.a)
endif
Expand All @@ -682,6 +719,7 @@ ifneq ($(CIRCUITPY_BLEIO_NATIVE),0)
BLE_IMPL_esp32c2 := libble
BLE_IMPL_esp32c3 := esp32c3
BLE_IMPL_esp32c6 := libble
BLE_IMPL_esp32c61 := libble
BLE_IMPL_esp32h2 := libble
BLE_IMPL = $(BLE_IMPL_$(IDF_TARGET))

Expand All @@ -700,8 +738,8 @@ ifneq ($(CIRCUITPY_BLEIO_NATIVE),0)

ifeq ($(BLE_IMPL),libble)
BINARY_BLOBS += esp-idf/components/esp_phy/lib/$(IDF_TARGET)/libbtbb.a
ifeq ($(IDF_TARGET),esp32c6)
BINARY_BLOBS += esp-idf/components/bt/controller/lib_$(IDF_TARGET)/$(IDF_TARGET)-bt-lib/$(IDF_TARGET)/libble_app.a
ifeq ($(BT_IDF_TARGET),esp32c6)
BINARY_BLOBS += esp-idf/components/bt/controller/lib_$(BT_IDF_TARGET)/$(BT_IDF_TARGET)-bt-lib/$(IDF_TARGET)/libble_app.a
else
BINARY_BLOBS += esp-idf/components/bt/controller/lib_$(IDF_TARGET)/$(IDF_TARGET)-bt-lib/libble_app.a
endif
Expand Down Expand Up @@ -769,6 +807,8 @@ else ifeq ($(IDF_TARGET),esp32c3)
BOOTLOADER_OFFSET = 0x0
else ifeq ($(IDF_TARGET),esp32c6)
BOOTLOADER_OFFSET = 0x0
else ifeq ($(IDF_TARGET),esp32c61)
BOOTLOADER_OFFSET = 0x0
else ifeq ($(IDF_TARGET),esp32p4)
BOOTLOADER_OFFSET = 0x2000
else ifeq ($(IDF_TARGET),esp32s3)
Expand All @@ -782,7 +822,7 @@ endif

IDF_CMAKE_TARGETS = \
bootloader/bootloader.bin \
esp-idf/esp_system/__ldgen_output_sections.ld \
__ldgen_output_sections.ld \
$(foreach component, $(ESP_IDF_COMPONENTS_LINK), esp-idf/$(component)/lib$(component).a)

PARTITION_TABLE_OFFSET = 0x8000
Expand Down
12 changes: 12 additions & 0 deletions ports/espressif/boards/ai_thinker_esp32-c3s-2m/sdkconfig
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,18 @@
#
# end of LWIP

#
# Wireless Coexistence
#
# CONFIG_ESP_COEX_SW_COEXIST_ENABLE is not set
# end of Wireless Coexistence

#
# LibC
#
# CONFIG_LIBC_OPTIMIZED_MISALIGNED_ACCESS is not set
# end of LibC

# end of Component config

# end of Espressif IoT Development Framework Configuration
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
// This file is part of the CircuitPython project: https://circuitpython.org
//
// SPDX-FileCopyrightText: Copyright (c) 2020 Scott Shawcroft for Adafruit Industries
//
// SPDX-License-Identifier: MIT

#include "supervisor/board.h"

// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here.
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
// This file is part of the CircuitPython project: https://circuitpython.org
//
// SPDX-FileCopyrightText: Copyright (c) 2019 Scott Shawcroft for Adafruit Industries
//
// SPDX-License-Identifier: MIT

#pragma once

// Micropython setup

#define MICROPY_HW_BOARD_NAME "ESP32-C61-DevKitC-1-N8R2"
#define MICROPY_HW_MCU_NAME "ESP32C61"

#define DEFAULT_UART_BUS_RX (&pin_GPIO10)
#define DEFAULT_UART_BUS_TX (&pin_GPIO11)
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
CIRCUITPY_CREATOR_ID = 0x000C303A
CIRCUITPY_CREATION_ID = 0x00C61001

IDF_TARGET = esp32c61
IDF_TARGET_ARCH = riscv

CIRCUITPY_ESP_FLASH_MODE = qio
CIRCUITPY_ESP_FLASH_FREQ = 80m
CIRCUITPY_ESP_FLASH_SIZE = 8MB

CIRCUITPY_ESP_PSRAM_SIZE = 2MB
CIRCUITPY_ESP_PSRAM_MODE = qio
CIRCUITPY_ESP_PSRAM_FREQ = 80m
48 changes: 48 additions & 0 deletions ports/espressif/boards/espressif_esp32c61_devkitc_1_n8r2/pins.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
// This file is part of the CircuitPython project: https://circuitpython.org
//
// SPDX-FileCopyrightText: Copyright (c) 2020 Scott Shawcroft for Adafruit Industries
//
// SPDX-License-Identifier: MIT

#include "shared-bindings/board/__init__.h"

static const mp_rom_map_elem_t board_module_globals_table[] = {
CIRCUITPYTHON_BOARD_DICT_STANDARD_ITEMS

{ MP_ROM_QSTR(MP_QSTR_IO1), MP_ROM_PTR(&pin_GPIO1) },
{ MP_ROM_QSTR(MP_QSTR_IO2), MP_ROM_PTR(&pin_GPIO2) },
{ MP_ROM_QSTR(MP_QSTR_IO3), MP_ROM_PTR(&pin_GPIO3) },
{ MP_ROM_QSTR(MP_QSTR_IO4), MP_ROM_PTR(&pin_GPIO4) },
{ MP_ROM_QSTR(MP_QSTR_IO5), MP_ROM_PTR(&pin_GPIO5) },
{ MP_ROM_QSTR(MP_QSTR_IO6), MP_ROM_PTR(&pin_GPIO6) },
{ MP_ROM_QSTR(MP_QSTR_IO7), MP_ROM_PTR(&pin_GPIO7) },
{ MP_ROM_QSTR(MP_QSTR_IO8), MP_ROM_PTR(&pin_GPIO8) },
{ MP_ROM_QSTR(MP_QSTR_IO9), MP_ROM_PTR(&pin_GPIO9) },
{ MP_ROM_QSTR(MP_QSTR_IO10), MP_ROM_PTR(&pin_GPIO10) },
{ MP_ROM_QSTR(MP_QSTR_IO11), MP_ROM_PTR(&pin_GPIO11) },
{ MP_ROM_QSTR(MP_QSTR_IO12), MP_ROM_PTR(&pin_GPIO12) },
{ MP_ROM_QSTR(MP_QSTR_IO13), MP_ROM_PTR(&pin_GPIO13) },
{ MP_ROM_QSTR(MP_QSTR_IO14), MP_ROM_PTR(&pin_GPIO14) },
{ MP_ROM_QSTR(MP_QSTR_IO15), MP_ROM_PTR(&pin_GPIO15) },
{ MP_ROM_QSTR(MP_QSTR_IO16), MP_ROM_PTR(&pin_GPIO16) },
{ MP_ROM_QSTR(MP_QSTR_IO17), MP_ROM_PTR(&pin_GPIO17) },
{ MP_ROM_QSTR(MP_QSTR_IO18), MP_ROM_PTR(&pin_GPIO18) },
{ MP_ROM_QSTR(MP_QSTR_IO19), MP_ROM_PTR(&pin_GPIO19) },
{ MP_ROM_QSTR(MP_QSTR_IO20), MP_ROM_PTR(&pin_GPIO20) },
{ MP_ROM_QSTR(MP_QSTR_IO21), MP_ROM_PTR(&pin_GPIO21) },
{ MP_ROM_QSTR(MP_QSTR_IO22), MP_ROM_PTR(&pin_GPIO22) },
{ MP_ROM_QSTR(MP_QSTR_IO23), MP_ROM_PTR(&pin_GPIO23) },
{ MP_ROM_QSTR(MP_QSTR_IO24), MP_ROM_PTR(&pin_GPIO24) },
{ MP_ROM_QSTR(MP_QSTR_IO25), MP_ROM_PTR(&pin_GPIO25) },
{ MP_ROM_QSTR(MP_QSTR_IO26), MP_ROM_PTR(&pin_GPIO26) },
{ MP_ROM_QSTR(MP_QSTR_IO27), MP_ROM_PTR(&pin_GPIO27) },
{ MP_ROM_QSTR(MP_QSTR_IO28), MP_ROM_PTR(&pin_GPIO28) },
{ MP_ROM_QSTR(MP_QSTR_IO29), MP_ROM_PTR(&pin_GPIO29) },
{ MP_ROM_QSTR(MP_QSTR_NEOPIXEL), MP_ROM_PTR(&pin_GPIO8) },

{ MP_ROM_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_GPIO11) },
{ MP_ROM_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_GPIO10) },

{ MP_ROM_QSTR(MP_QSTR_UART), MP_ROM_PTR(&board_uart_obj) },
};
MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table);
14 changes: 14 additions & 0 deletions ports/espressif/boards/espressif_esp32c61_devkitc_1_n8r2/sdkconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#
# Espressif IoT Development Framework Configuration
#
#
# Component config
#
#
# LWIP
#
# end of LWIP

# end of Component config

# end of Espressif IoT Development Framework Configuration
Loading