Skip to content

Commit a18e015

Browse files
microdev1tannewt
authored andcommitted
update idf to v5.0
1 parent 3032d4e commit a18e015

57 files changed

Lines changed: 262 additions & 2333 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitmodules

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,16 @@
143143
[submodule "ports/espressif/esp-idf"]
144144
path = ports/espressif/esp-idf
145145
url = https://github.com/adafruit/esp-idf.git
146-
branch = release/v4.4-circuitpython
146+
[submodule "ports/espressif/esp-protocols"]
147+
path = ports/espressif/esp-protocols
148+
url = https://github.com/espressif/esp-protocols.git
149+
[submodule "ports/espressif/esp-iot-solution"]
150+
path = ports/espressif/esp-iot-solution
151+
url = https://github.com/espressif/esp-iot-solution.git
152+
[submodule "ports/espressif/esp-camera"]
153+
path = ports/espressif/esp-camera
154+
url = https://github.com/espressif/esp32-camera.git
155+
branch = circuitpython
147156
[submodule "frozen/Adafruit_CircuitPython_ST7789"]
148157
path = frozen/Adafruit_CircuitPython_ST7789
149158
url = https://github.com/adafruit/Adafruit_CircuitPython_ST7789
@@ -297,10 +306,6 @@
297306
[submodule "frozen/circuitpython_picoed"]
298307
path = frozen/circuitpython_picoed
299308
url = https://github.com/elecfreaks/circuitpython_picoed.git
300-
[submodule "ports/espressif/esp32-camera"]
301-
path = ports/espressif/esp32-camera
302-
url = https://github.com/adafruit/esp32-camera/
303-
branch = circuitpython
304309
[submodule "ports/raspberrypi/lib/cyw43-driver"]
305310
path = ports/raspberrypi/lib/cyw43-driver
306311
url = https://github.com/georgerobotics/cyw43-driver.git

ports/espressif/CMakeLists.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
# The following five lines of boilerplate have to be in your project's
22
# CMakeLists in this exact order for cmake to work correctly
3-
cmake_minimum_required(VERSION 3.13)
3+
cmake_minimum_required(VERSION 3.16)
44

55
set(ENV{IDF_PATH} ${CMAKE_SOURCE_DIR}/esp-idf)
66

7-
# The component list here determines what options we get in menuconfig and what the ninja file
8-
# can build.
9-
set(COMPONENTS esptool_py soc driver log main esp-tls mbedtls mdns esp_event esp_adc_cal esp_netif esp_wifi lwip ulp wpa_supplicant freertos bt usb esp32-camera esp_lcd)
7+
# The component list here determines what options we get in menuconfig and what the ninja file can build.
8+
set(COMPONENTS bt driver esp-tls esp_adc_cal esp_event esp_netif esp_psram esp_wifi esptool_py freertos log lwip main mbedtls mdns soc ulp usb wpa_supplicant esp_lcd)
9+
set(EXTRA_COMPONENT_DIRS esp-protocols/components/mdns)
1010

1111
list(APPEND EXTRA_COMPONENT_DIRS "esp32-camera")
1212

ports/espressif/Makefile

Lines changed: 35 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ INC += \
5151
-isystem esp-idf \
5252
-isystem esp-idf/components/app_update/include \
5353
-isystem esp-idf/components/bootloader_support/include \
54+
-isystem esp-idf/components/bootloader_support/bootloader_flash/include \
5455
-isystem esp-idf/components/bt/include/$(IDF_TARGET)/include \
5556
-isystem esp-idf/components/bt/host/nimble/esp-hci/include \
5657
-isystem esp-idf/components/bt/host/nimble/nimble/nimble/controller/include \
@@ -62,28 +63,31 @@ INC += \
6263
-isystem esp-idf/components/bt/host/nimble/nimble/porting/npl/freertos/include \
6364
-isystem esp-idf/components/bt/host/nimble/port/include \
6465
-isystem esp-idf/components/driver/include \
66+
-isystem esp-idf/components/driver/deprecated \
6567
-isystem esp-idf/components/driver/$(IDF_TARGET)/include \
6668
-isystem esp-idf/components/efuse/include \
6769
-isystem esp-idf/components/efuse/$(IDF_TARGET)/include \
6870
-isystem esp-idf/components/$(IDF_TARGET)/include \
69-
-isystem esp-idf/components/esp_adc_cal/include \
71+
-isystem esp-idf/components/esp_adc/deprecated/include \
72+
-isystem esp-idf/components/esp_app_format/include \
7073
-isystem esp-idf/components/esp_common/include \
7174
-isystem esp-idf/components/esp_event/include \
7275
-isystem esp-idf/components/esp_hw_support/include \
7376
-isystem esp-idf/components/esp_hw_support/include/soc \
74-
-isystem esp-idf/components/esp_ipc/include \
7577
-isystem esp-idf/components/esp_netif/include \
78+
-isystem esp-idf/components/esp_partition/include \
7679
-isystem esp-idf/components/esp_pm/include \
80+
-isystem esp-idf/components/esp_psram/include \
7781
-isystem esp-idf/components/esp_ringbuf/include \
7882
-isystem esp-idf/components/esp_rom/include \
7983
-isystem esp-idf/components/esp_system/include \
8084
-isystem esp-idf/components/esp_timer/include \
8185
-isystem esp-idf/components/esp_wifi/include \
82-
-isystem esp-idf/components/freertos/include \
83-
-isystem esp-idf/components/freertos/include/freertos \
84-
-isystem esp-idf/components/freertos/include/esp_additions \
85-
-isystem esp-idf/components/freertos/include/esp_additions/freertos \
86-
-isystem esp-idf/components/freertos/port/$(IDF_TARGET_ARCH)/include \
86+
-isystem esp-idf/components/freertos/esp_additions/include \
87+
-isystem esp-idf/components/freertos/esp_additions/include/freertos \
88+
-isystem esp-idf/components/freertos/FreeRTOS-Kernel/include \
89+
-isystem esp-idf/components/freertos/FreeRTOS-Kernel/include/freertos \
90+
-isystem esp-idf/components/freertos/FreeRTOS-Kernel/portable/$(IDF_TARGET_ARCH)/include \
8791
-isystem esp-idf/components/hal/include \
8892
-isystem esp-idf/components/hal/$(IDF_TARGET)/include \
8993
-isystem esp-idf/components/hal/platform_port/include \
@@ -100,13 +104,13 @@ INC += \
100104
-isystem esp-idf/components/soc/include \
101105
-isystem esp-idf/components/soc/$(IDF_TARGET)/include \
102106
-isystem esp-idf/components/spi_flash/include \
107+
-isystem esp-idf/components/ulp/include \
108+
-isystem esp-idf/components/ulp/ulp_riscv/include \
109+
-isystem esp-idf/components/ulp/ulp_common/include \
110+
-isystem esp-idf/components/ulp/ulp_common/include/$(IDF_TARGET) \
103111
-isystem esp-idf/components/$(IDF_TARGET_ARCH)/include \
104-
-isystem esp-idf/components/$(IDF_TARGET_ARCH)/$(IDF_TARGET)/include
105-
106-
# See https://github.com/espressif/esp-idf/issues/6906
107-
ifeq ($(IDF_TARGET),esp32c3)
108-
CFLAGS += -include "esp32c3_fix.h"
109-
endif
112+
-isystem esp-idf/components/$(IDF_TARGET_ARCH)/$(IDF_TARGET)/include \
113+
-isystem esp-protocols/components/mdns/include
110114

111115
CFLAGS += \
112116
-DHAVE_CONFIG_H \
@@ -232,23 +236,16 @@ SRC_C += \
232236
peripherals/timer.c \
233237
peripherals/$(IDF_TARGET)/pins.c
234238

235-
ifneq ($(IDF_TARGET),esp32c3)
236-
SRC_C += \
237-
peripherals/pcnt.c \
238-
peripherals/touch.c
239-
ifeq ($(IDF_TARGET),esp32s2)
240-
SRC_C += \
241-
i2s_lcd_esp32s2_driver.c
242-
endif
243-
endif
239+
SRC_C += $(wildcard common-hal/espidf/*.c)
244240

245241
ifeq ($(IDF_TARGET),esp32c3)
242+
SRC_C += supervisor/usb_serial_jtag.c
243+
else
246244
SRC_C += \
247-
supervisor/usb_serial_jtag.c
245+
peripherals/pcnt.c \
246+
peripherals/touch.c
248247
endif
249248

250-
$(BUILD)/i2s_lcd_esp32s2_driver.o: CFLAGS += -Wno-sign-compare
251-
252249
ifneq ($(CIRCUITPY_USB),0)
253250
SRC_C += lib/tinyusb/src/portable/espressif/esp32sx/dcd_esp32sx.c
254251
endif
@@ -257,6 +254,17 @@ ifneq ($(CIRCUITPY_BLEIO),0)
257254
SRC_C += common-hal/_bleio/ble_events.c
258255
endif
259256

257+
ifneq ($(CIRCUITPY_PARALLELDISPLAY),0)
258+
ifeq ($(IDF_TARGET),esp32s3)
259+
LCD_SRC = 8080_lcd_$(IDF_TARGET)
260+
else
261+
LCD_SRC = i2s_lcd_$(IDF_TARGET)_driver
262+
endif
263+
SRC_C += esp-iot-solution/components/bus/$(LCD_SRC).c
264+
$(BUILD)/esp-iot-solution/components/bus/$(LCD_SRC).o: CFLAGS += -Wno-sign-compare
265+
CFLAGS += -isystem esp-iot-solution/components/bus/include
266+
endif
267+
260268
ifneq ($(CIRCUITPY_DOTCLOCKFRAMEBUFFER),0)
261269
CFLAGS += -isystem esp-idf/components/esp_lcd/include
262270
CFLAGS += -isystem esp-idf/components/esp_lcd/interface
@@ -290,8 +298,6 @@ SRC_ULP := \
290298
$(wildcard common-hal/espulp/*.c) \
291299
$(wildcard bindings/espulp/*.c)
292300
SRC_C += $(SRC_ULP)
293-
CFLAGS += -isystem esp-idf/components/ulp/include
294-
CFLAGS += -isystem esp-idf/components/ulp/ulp_riscv/include
295301
endif
296302

297303
SRC_COMMON_HAL_EXPANDED = \
@@ -389,7 +395,7 @@ ifeq ($(IDF_TARGET),esp32)
389395
BINARY_BLOBS += esp-idf/components/esp_phy/lib/$(IDF_TARGET)/librtc.a
390396
endif
391397

392-
ESP_IDF_COMPONENTS_LINK = $(IDF_TARGET_ARCH) app_update bootloader_support driver efuse esp_adc_cal esp_common esp_event esp_hw_support esp_ipc esp_netif esp_pm esp_phy esp_ringbuf esp_rom esp_system esp_timer esp-tls esp_wifi freertos hal heap log lwip mbedtls mdns newlib nvs_flash pthread soc spi_flash vfs wpa_supplicant
398+
ESP_IDF_COMPONENTS_LINK = $(IDF_TARGET_ARCH) app_update bootloader_support driver efuse esp_adc esp_app_format esp_common esp_event esp_hw_support esp_netif esp_partition esp_phy esp_pm esp_psram esp_ringbuf esp_rom esp_system esp_timer esp-tls esp_wifi freertos hal heap log lwip mbedtls mdns newlib nvs_flash pthread soc spi_flash vfs wpa_supplicant
393399
ifneq ($(CIRCUITPY_BLEIO),0)
394400
ESP_IDF_COMPONENTS_LINK += bt
395401
BINARY_BLOBS += esp-idf/components/esp_phy/lib/$(IDF_TARGET)/libbtbb.a \
@@ -440,8 +446,6 @@ IDF_CMAKE_TARGETS = \
440446
PARTITION_TABLE_OFFSET = 0x8000
441447
FIRMWARE_OFFSET = 0x10000
442448

443-
ESP_AUTOGEN_LD = $(BUILD)/esp-idf/esp-idf/$(IDF_TARGET)/$(IDF_TARGET)_out.ld $(BUILD)/esp-idf/esp-idf/$(IDF_TARGET)/ld/$(IDF_TARGET).project.ld
444-
445449
FLASH_FLAGS = --flash_mode $(CIRCUITPY_ESP_FLASH_MODE) --flash_freq $(CIRCUITPY_ESP_FLASH_FREQ) --flash_size $(CIRCUITPY_ESP_FLASH_SIZE)
446450

447451
ESPTOOL_FLAGS ?= --before=default_reset --after=no_reset --baud 921600
@@ -460,7 +464,7 @@ esp-idf-stamp: $(BUILD)/esp-idf/config/sdkconfig.h
460464

461465
$(BUILD)/firmware.elf: $(OBJ) | esp-idf-stamp $(IDF_CMAKE_TARGETS)
462466
$(STEPECHO) "LINK $@"
463-
$(Q)$(CC) -o $@ $(LDFLAGS) $^ -Wl,--start-group $(ESP_IDF_COMPONENTS_EXPANDED) $(BINARY_BLOBS) $(MBEDTLS_COMPONENTS_LINK_EXPANDED) $(BUILD)/esp-idf/esp-idf/newlib/libnewlib.a -Wl,--end-group -u newlib_include_pthread_impl -u ld_include_highint_hdl -Wl,--start-group $(LIBS) -Wl,--end-group $(BUILD)/esp-idf/esp-idf/pthread/libpthread.a -u __cxx_fatal_exception
467+
$(Q)$(CC) -o $@ $(LDFLAGS) $^ -Wl,--start-group $(ESP_IDF_COMPONENTS_EXPANDED) $(BINARY_BLOBS) $(MBEDTLS_COMPONENTS_LINK_EXPANDED) $(LIBS) -Wl,--end-group -u newlib_include_pthread_impl -u ld_include_highint_hdl -u __cxx_fatal_exception
464468

465469
$(BUILD)/circuitpython-firmware.bin: $(BUILD)/firmware.elf | tools/build_memory_info.py
466470
$(STEPECHO) "Create $@"

ports/espressif/README.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Support Status:
99
.. csv-table::
1010
:header: SoC, Status
1111

12-
ESP, "beta"
12+
ESP32, "beta"
1313
ESP32-C3, "beta"
1414
ESP32-S2, "stable"
1515
ESP32-S3, "beta"

ports/espressif/common-hal/_bleio/Adapter.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,6 @@ void common_hal_bleio_adapter_set_enabled(bleio_adapter_obj_t *self, bool enable
9595
}
9696

9797
if (enabled) {
98-
esp_nimble_hci_and_controller_init();
9998
nimble_port_init();
10099
// ble_hs_cfg.reset_cb = blecent_on_reset;
101100
ble_hs_cfg.sync_cb = _on_sync;

ports/espressif/common-hal/alarm/pin/PinAlarm.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@
3636
#include "hal/gpio_ll.h"
3737
#include "esp_debug_helpers.h"
3838

39-
#include "components/driver/include/driver/rtc_io.h"
40-
#include "components/freertos/include/freertos/FreeRTOS.h"
39+
#include "driver/rtc_io.h"
40+
#include "freertos/FreeRTOS.h"
4141

4242
void common_hal_alarm_pin_pinalarm_construct(alarm_pin_pinalarm_obj_t *self, const mcu_pin_obj_t *pin, bool value, bool edge, bool pull) {
4343
if (edge) {

ports/espressif/common-hal/analogio/AnalogIn.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,9 @@
3030
#include "py/runtime.h"
3131
#include "supervisor/shared/translate/translate.h"
3232

33-
#include "components/driver/include/driver/adc_common.h"
34-
#include "components/esp_adc_cal/include/esp_adc_cal.h"
33+
#include "driver/adc.h"
34+
#include "driver/gpio.h"
35+
#include "esp_adc_cal.h"
3536

3637
#include "shared-bindings/microcontroller/Pin.h"
3738

@@ -54,7 +55,7 @@
5455

5556
void common_hal_analogio_analogin_construct(analogio_analogin_obj_t *self,
5657
const mcu_pin_obj_t *pin) {
57-
if (pin->adc_index == 0 || pin->adc_channel == ADC_CHANNEL_MAX) {
58+
if (pin->adc_index == 0 || pin->adc_channel == NO_ADC_CHANNEL) {
5859
raise_ValueError_invalid_pin();
5960
}
6061
common_hal_mcu_pin_claim(pin);

ports/espressif/common-hal/audiobusio/__init__.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,9 @@
3737

3838
#define I2S_QUEUE_SIZE (3)
3939

40-
static i2s_t *i2s_instance[I2S_NUM_MAX];
41-
static QueueHandle_t i2s_queues[I2S_NUM_MAX];
42-
static TaskHandle_t i2s_tasks[I2S_NUM_MAX];
40+
static i2s_t *i2s_instance[I2S_NUM_AUTO];
41+
static QueueHandle_t i2s_queues[I2S_NUM_AUTO];
42+
static TaskHandle_t i2s_tasks[I2S_NUM_AUTO];
4343

4444
void port_i2s_allocate_i2s0(void) {
4545
if (!i2s_instance[0]) {
@@ -64,7 +64,7 @@ static int8_t port_i2s_allocate(void) {
6464
}
6565

6666
void port_i2s_reset_instance(int i) {
67-
assert(i >= 0 && i < I2S_NUM_MAX);
67+
assert(i >= 0 && i < I2S_NUM_AUTO);
6868
if (i2s_tasks[i]) {
6969
vTaskDelete(i2s_tasks[i]);
7070
}
@@ -75,15 +75,15 @@ void port_i2s_reset_instance(int i) {
7575
}
7676

7777
void i2s_reset(void) {
78-
for (int i = 0; i < I2S_NUM_MAX; i++) {
78+
for (int i = 0; i < I2S_NUM_AUTO; i++) {
7979
port_i2s_reset_instance(i);
8080
}
8181
}
8282

8383
#define I2S_WRITE_DELAY pdMS_TO_TICKS(1)
8484

8585
static void i2s_fill_buffer(i2s_t *self) {
86-
if (self->instance < 0 || self->instance >= I2S_NUM_MAX) {
86+
if (self->instance < 0 || self->instance >= I2S_NUM_AUTO) {
8787
return;
8888
}
8989
#define STACK_BUFFER_SIZE (4096)

ports/espressif/common-hal/busio/SPI.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
#include "shared-bindings/busio/SPI.h"
3131
#include "shared-bindings/microcontroller/Pin.h"
3232

33-
#include "driver/spi_common_internal.h"
33+
#include "esp_private/spi_common_internal.h"
3434

3535
#define SPI_MAX_DMA_BITS (SPI_MAX_DMA_LEN * 8)
3636
#define MAX_SPI_TRANSACTIONS 10

ports/espressif/common-hal/countio/Counter.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@
3131
#include "py/runtime.h"
3232
#include "supervisor/shared/translate/translate.h"
3333

34+
#include "driver/gpio.h"
35+
3436
void common_hal_countio_counter_construct(countio_counter_obj_t *self,
3537
const mcu_pin_obj_t *pin, countio_edge_t edge, digitalio_pull_t pull) {
3638
claim_pin(pin);

0 commit comments

Comments
 (0)