Skip to content
Closed
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
6 changes: 3 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@
url = https://github.com/adafruit/nrfx.git
[submodule "lib/tinyusb"]
path = lib/tinyusb
url = https://github.com/hathach/tinyusb.git
branch = master
url = https://github.com/tannewt/tinyusb.git
branch = esp32c5_c61
fetchRecurseSubmodules = false
[submodule "tools/huffman"]
path = tools/huffman
Expand Down 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
[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
22 changes: 13 additions & 9 deletions ports/espressif/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,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 @@ -156,11 +157,13 @@ REGISTRATION_FUNCTIONS = \
-u __ubsan_include \
-u esp_system_include_startup_funcs \
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems that both this and bt pull in coex now. Not sure if coex is worth including for everything but just a heads up since h2 and p4 chips have wifi disabled. I just OR'd the configs in my branch to make sure when testing just bluetooth without wifi that everything gets linked but either way I think it will require some additional casing to handle the p4 which lacks both.

-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 include_esp_phy_override \
-u vfs_include_syscalls_impl

Expand Down Expand Up @@ -222,7 +225,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 +246,8 @@ LDFLAGS += \
ifeq ($(IDF_TARGET),esp32)
LDFLAGS += \
-Tesp32.rom.newlib-data.ld \
-Tesp32.rom.newlib-funcs.ld \
-Tesp32.rom.libc-funcs.ld \
-Tesp32.rom.newlib-reent-funcs.ld \
-Tesp32.rom.spiflash_legacy.ld

CHIP_COMPONENTS = \
Expand Down Expand Up @@ -312,8 +315,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 Down Expand Up @@ -782,7 +786,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
2 changes: 2 additions & 0 deletions ports/espressif/common-hal/alarm/pin/PinAlarm.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,12 @@

#include "esp_sleep.h"
#include "hal/gpio_ll.h"
#include "driver/gpio.h"
#include "esp_debug_helpers.h"

#ifdef SOC_PM_SUPPORT_EXT0_WAKEUP
#include "soc/rtc_cntl_reg.h"
#include "soc/rtc_io_reg.h"
#endif

#include "driver/rtc_io.h"
Expand Down
6 changes: 0 additions & 6 deletions ports/espressif/common-hal/analogio/AnalogIn.c
Original file line number Diff line number Diff line change
Expand Up @@ -86,10 +86,8 @@ uint16_t common_hal_analogio_analogin_get_value(analogio_analogin_obj_t *self) {

adc_cali_scheme_ver_t supported_schemes;
adc_cali_check_scheme(&supported_schemes);
#ifndef CONFIG_IDF_TARGET_ESP32P4
adc_cali_scheme_ver_t calibration_scheme = 0;
adc_cali_handle_t calibration;
#endif
#if defined(ADC_CALI_SCHEME_CURVE_FITTING_SUPPORTED) && ADC_CALI_SCHEME_CURVE_FITTING_SUPPORTED
adc_cali_curve_fitting_config_t config = {
.unit_id = self->pin->adc_index,
Expand Down Expand Up @@ -137,11 +135,7 @@ uint16_t common_hal_analogio_analogin_get_value(analogio_analogin_obj_t *self) {

// This corrects non-linear regions of the ADC range with a LUT, so it's a better reading than raw
int voltage;
#ifdef CONFIG_IDF_TARGET_ESP32P4
voltage = 0;
#else
adc_cali_raw_to_voltage(calibration, adc_reading, &voltage);
#endif

#if defined(ADC_CALI_SCHEME_CURVE_FITTING_SUPPORTED) && ADC_CALI_SCHEME_CURVE_FITTING_SUPPORTED
if (calibration_scheme == ADC_CALI_SCHEME_VER_CURVE_FITTING) {
Expand Down
2 changes: 1 addition & 1 deletion ports/espressif/common-hal/espnow/ESPNow.c
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ typedef struct {
// Callback triggered when a sent packet is acknowledged by the peer (or not).
// Just count the number of responses and number of failures.
// These are used in the send() logic.
static void send_cb(const uint8_t *mac, esp_now_send_status_t status) {
static void send_cb(const esp_now_send_info_t *tx_info, esp_now_send_status_t status) {
espnow_obj_t *self = MP_STATE_PORT(espnow_singleton);
if (status == ESP_NOW_SEND_SUCCESS) {
self->send_success++;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
#include "common-hal/microcontroller/Pin.h"
#include "py/runtime.h"

#include "driver/gpio.h"
#include <driver/gpio.h>

/*
* Current pin limitations for ESP32-S2 ParallelBus:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

#include "common-hal/digitalio/DigitalInOut.h"

#include "esp-idf/components/esp_lcd/include/esp_lcd_panel_io.h"
#include <esp-idf/components/esp_lcd/include/esp_lcd_panel_io.h>

typedef struct {
mp_obj_base_t base;
Expand Down
2 changes: 1 addition & 1 deletion ports/espressif/esp-idf
Submodule esp-idf updated 6782 files
6 changes: 6 additions & 0 deletions ports/espressif/esp-idf-config/sdkconfig.defaults
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,12 @@ CONFIG_GPTIMER_CTRL_FUNC_IN_IRAM=y
CONFIG_GPTIMER_ISR_IRAM_SAFE=y
# end of GPTimer Configuration

#
# Touch Configuration
#
CONFIG_TOUCH_SUPPRESS_DEPRECATE_WARN=y
# end of Touch Configuration

# end of Driver Configurations

#
Expand Down
2 changes: 2 additions & 0 deletions ports/espressif/mpconfigport.mk
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ CIRCUITPY_HASHLIB_MBEDTLS_ONLY = 0

CIRCUITPY_PORT_SERIAL = 1

CIRCUITPY_LIB_TLSF = 0

# These modules are implemented in ports/<port>/common-hal:
CIRCUITPY__EVE ?= 1
CIRCUITPY_ALARM ?= 1
Expand Down
2 changes: 1 addition & 1 deletion ports/espressif/peripherals/pins.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

#include "components/hal/include/hal/gpio_types.h"
#include "components/hal/include/hal/adc_types.h"
#include "components/hal/include/hal/touch_sensor_types.h"
#include "components/hal/include/hal/touch_sensor_legacy_types.h"

typedef struct {
mp_obj_base_t base;
Expand Down
4 changes: 4 additions & 0 deletions py/circuitpy_mpconfig.mk
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,10 @@ CFLAGS += -DCIRCUITPY_FULL_BUILD=$(CIRCUITPY_FULL_BUILD)
# increased build time
CIRCUITPY_MESSAGE_COMPRESSION_LEVEL ?= 9

# By default, use our copy of TLSF. Some vendor SDKs may provide their own
# implementation of TLSF, which can be used instead by setting CIRCUITPY_LIB_TLSF=0.
CIRCUITPY_LIB_TLSF ?= 1

# Reduce the size of in-flash properties. Requires support in the .ld linker
# file, so not enabled by default.
CIRCUITPY_OPTIMIZE_PROPERTY_FLASH_SIZE ?= 0
Expand Down
5 changes: 4 additions & 1 deletion supervisor/supervisor.mk
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
SRC_SUPERVISOR = \
main.c \
lib/tlsf/tlsf.c \
supervisor/port.c \
supervisor/shared/background_callback.c \
supervisor/shared/board.c \
Expand All @@ -20,6 +19,10 @@ SRC_SUPERVISOR = \
supervisor/shared/translate/translate.c \
supervisor/shared/workflow.c \

ifeq ($(CIRCUITPY_LIB_TLSF),1)
SRC_SUPERVISOR += lib/tlsf/tlsf.c
endif

# For tlsf
CFLAGS += -D_DEBUG=0

Expand Down