Skip to content

Commit 7bad82a

Browse files
committed
C6 compiles, runs but wifi crashes
1 parent e22eefa commit 7bad82a

57 files changed

Lines changed: 811 additions & 122 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: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@
152152
url = https://github.com/espressif/esp-iot-solution.git
153153
[submodule "ports/espressif/esp-camera"]
154154
path = ports/espressif/esp-camera
155-
url = https://github.com/espressif/esp32-camera.git
155+
url = https://github.com/adafruit/esp32-camera.git
156156
branch = circuitpython
157157
[submodule "frozen/Adafruit_CircuitPython_ST7789"]
158158
path = frozen/Adafruit_CircuitPython_ST7789

ports/espressif/Makefile

Lines changed: 48 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@ include ../../py/circuitpy_mkenv.mk
2727
ifeq ($(IDF_TARGET),esp32c3)
2828
IDF_TARGET_ARCH = riscv
2929
CROSS_COMPILE = riscv32-esp-elf-
30+
else ifeq ($(IDF_TARGET),esp32c6)
31+
IDF_TARGET_ARCH = riscv
32+
CROSS_COMPILE = riscv32-esp-elf-
3033
else
3134
IDF_TARGET_ARCH = xtensa
3235
CROSS_COMPILE = xtensa-$(IDF_TARGET)-elf-
@@ -84,7 +87,8 @@ INC += \
8487
-isystem esp-idf/components/efuse/include \
8588
-isystem esp-idf/components/efuse/$(IDF_TARGET)/include \
8689
-isystem esp-idf/components/$(IDF_TARGET)/include \
87-
-isystem esp-idf/components/esp_adc/deprecated/include \
90+
-isystem esp-idf/components/esp_adc/include \
91+
-isystem esp-idf/components/esp_adc/$(IDF_TARGET)/include \
8892
-isystem esp-idf/components/esp_app_format/include \
8993
-isystem esp-idf/components/esp_common/include \
9094
-isystem esp-idf/components/esp_event/include \
@@ -172,6 +176,7 @@ CFLAGS += $(INC) -Werror -Wall -std=gnu11 -Wl,--gc-sections $(BASE_CFLAGS) $(C_D
172176
# Most current ESPs have nano versions of newlib in ROM so we use them.
173177
ifneq ($(IDF_TARGET),esp32c6)
174178
CFLAGS += --specs=nano.specs
179+
LDFLAGS += -T$(IDF_TARGET).rom.newlib-nano.ld
175180
endif
176181

177182
ifeq ($(IDF_TARGET_ARCH),xtensa)
@@ -192,7 +197,6 @@ LDFLAGS += \
192197
-T$(IDF_TARGET).rom.ld \
193198
-T$(IDF_TARGET).rom.api.ld \
194199
-T$(IDF_TARGET).rom.libgcc.ld \
195-
-T$(IDF_TARGET).rom.newlib-nano.ld \
196200
-Wl,-Bstatic \
197201
-Wl,--no-warn-mismatch \
198202
-Wl,--build-id=none \
@@ -208,6 +212,15 @@ LDFLAGS += \
208212
-Tesp32c3.rom.newlib.ld \
209213
-Tesp32c3.rom.version.ld \
210214
-Tesp32c3.rom.eco3.ld
215+
else ifeq ($(IDF_TARGET),esp32c6)
216+
LDFLAGS += \
217+
-Tesp32c6.rom.phy.ld \
218+
-Tesp32c6.rom.pp.ld \
219+
-Tesp32c6.rom.net80211.ld \
220+
-Tesp32c6.rom.newlib.ld \
221+
-Tesp32c6.rom.coexist.ld \
222+
-Tesp32c6.rom.heap.ld \
223+
-Tesp32c6.rom.wdt.ld
211224
else ifeq ($(IDF_TARGET),esp32s2)
212225
LDFLAGS += \
213226
-T$(IDF_TARGET).rom.newlib-data.ld \
@@ -222,7 +235,7 @@ endif
222235
LIBS := -lgcc -lc -lstdc++
223236

224237
# Use toolchain libm if we're not using our own.
225-
ifndef INTERNAL_LIBM
238+
ifneq ($(INTERNAL_LIBM),1)
226239
LIBS += -lm
227240
endif
228241

@@ -262,12 +275,16 @@ SRC_C += \
262275

263276
SRC_C += $(wildcard common-hal/espidf/*.c)
264277

265-
ifeq ($(IDF_TARGET),esp32c3)
278+
ifneq ($(CIRCUITPY_ESP_USB_SERIAL_JTAG),0)
266279
SRC_C += supervisor/usb_serial_jtag.c
267-
else
268-
SRC_C += \
269-
peripherals/pcnt.c \
270-
peripherals/touch.c
280+
endif
281+
282+
ifneq ($(CIRCUITPY_COUNTIO),0)
283+
SRC_C += peripherals/pcnt.c
284+
endif
285+
286+
ifneq ($(CIRCUITPY_TOUCHIO_USE_NATIVE),0)
287+
SRC_C += peripherals/touch.c
271288
endif
272289

273290
ifneq ($(CIRCUITPY_USB),0)
@@ -435,13 +452,28 @@ endif
435452

436453
ESP_IDF_COMPONENTS_LINK = $(IDF_TARGET_ARCH) app_update bootloader_support driver efuse esp_adc esp_app_format esp_coex esp_common esp_event esp_hw_support esp_mm esp_netif esp_partition esp_phy esp_pm 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
437454
ifneq ($(CIRCUITPY_BLEIO),0)
455+
BLE_IMPL_esp32 := esp32
456+
BLE_IMPL_esp32s3 := esp32c3
457+
BLE_IMPL_esp32c2 := libble
458+
BLE_IMPL_esp32c3 := esp32c3
459+
BLE_IMPL_esp32c6 := libble
460+
BLE_IMPL_esp32h2 := libble
461+
BLE_IMPL = $(BLE_IMPL_$(IDF_TARGET))
462+
438463
ESP_IDF_COMPONENTS_LINK += bt
439-
ifeq ($(IDF_TARGET),esp32)
440-
BINARY_BLOBS += esp-idf/components/bt/controller/lib_esp32/$(IDF_TARGET)/libbtdm_app.a
441-
else
464+
ifeq ($(BLE_IMPL),esp32)
465+
BINARY_BLOBS += esp-idf/components/bt/controller/lib_esp32/$(IDF_TARGET)/libbtdm_app.a
466+
endif
467+
468+
ifeq ($(BLE_IMPL),esp32c3)
442469
BINARY_BLOBS += esp-idf/components/esp_phy/lib/$(IDF_TARGET)/libbtbb.a \
443470
esp-idf/components/bt/controller/lib_esp32c3_family/$(IDF_TARGET)/libbtdm_app.a
444471
endif
472+
473+
ifeq ($(BLE_IMPL),libble)
474+
BINARY_BLOBS += esp-idf/components/esp_phy/lib/$(IDF_TARGET)/libbtbb.a \
475+
esp-idf/components/bt/controller/lib_$(IDF_TARGET)/$(IDF_TARGET)-bt-lib/libble_app.a
476+
endif
445477
endif
446478
ifneq ($(CIRCUITPY_ESPULP),0)
447479
ESP_IDF_COMPONENTS_LINK += ulp
@@ -469,11 +501,16 @@ ESP_IDF_COMPONENTS_EXPANDED += $(BUILD)/esp-idf/esp-idf/esp-camera/libesp-camera
469501
endif
470502

471503
ifneq ($(VALID_BOARD),)
504+
# From esp-idf/components/bootloader/Kconfig.projbuild
472505
# BOOTLOADER_OFFSET is determined by chip type, based on the ROM bootloader, and is not changeable.
473506
ifeq ($(IDF_TARGET),esp32)
474507
BOOTLOADER_OFFSET = 0x1000
508+
else ifeq ($(IDF_TARGET),esp32h2)
509+
BOOTLOADER_OFFSET = 0x0
475510
else ifeq ($(IDF_TARGET),esp32c3)
476511
BOOTLOADER_OFFSET = 0x0
512+
else ifeq ($(IDF_TARGET),esp32c6)
513+
BOOTLOADER_OFFSET = 0x0
477514
else ifeq ($(IDF_TARGET),esp32s3)
478515
BOOTLOADER_OFFSET = 0x0
479516
else ifeq ($(IDF_TARGET),esp32s2)

ports/espressif/boards/01space_lcd042_esp32c3/mpconfigboard.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,5 +36,3 @@
3636

3737
// For entering safe mode
3838
#define CIRCUITPY_BOOT_BUTTON (&pin_GPIO9)
39-
40-
#define CIRCUITPY_ESP_USB_SERIAL_JTAG (1)

ports/espressif/boards/01space_lcd042_esp32c3/mpconfigboard.mk

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,5 @@ IDF_TARGET = esp32c3
66
CIRCUITPY_ESP_FLASH_MODE = dio
77
CIRCUITPY_ESP_FLASH_FREQ = 80m
88
CIRCUITPY_ESP_FLASH_SIZE = 4MB
9+
10+
CIRCUITPY_ESP_USB_SERIAL_JTAG = 1

ports/espressif/boards/adafruit_qtpy_esp32c3/mpconfigboard.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,5 +43,3 @@
4343

4444
// For entering safe mode
4545
#define CIRCUITPY_BOOT_BUTTON (&pin_GPIO9)
46-
47-
#define CIRCUITPY_ESP_USB_SERIAL_JTAG (1)

ports/espressif/boards/adafruit_qtpy_esp32c3/mpconfigboard.mk

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,5 @@ IDF_TARGET = esp32c3
66
CIRCUITPY_ESP_FLASH_MODE = dio
77
CIRCUITPY_ESP_FLASH_FREQ = 80m
88
CIRCUITPY_ESP_FLASH_SIZE = 4MB
9+
10+
CIRCUITPY_ESP_USB_SERIAL_JTAG = 1

ports/espressif/boards/ai_thinker_esp32-c3s-2m/mpconfigboard.mk

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,5 @@ CIRCUITPY_ESP_FLASH_FREQ = 80m
88
CIRCUITPY_ESP_FLASH_SIZE = 2MB
99

1010
CIRCUITPY_DUALBANK = 0
11+
12+
CIRCUITPY_ESP_USB_SERIAL_JTAG = 0

ports/espressif/boards/ai_thinker_esp32-c3s/mpconfigboard.mk

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,5 @@ IDF_TARGET = esp32c3
66
CIRCUITPY_ESP_FLASH_MODE = qio
77
CIRCUITPY_ESP_FLASH_FREQ = 80m
88
CIRCUITPY_ESP_FLASH_SIZE = 4MB
9+
10+
CIRCUITPY_ESP_USB_SERIAL_JTAG = 0

ports/espressif/boards/beetle-esp32-c3/mpconfigboard.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,5 +40,3 @@
4040

4141
#define CIRCUITPY_BOARD_UART (1)
4242
#define CIRCUITPY_BOARD_UART_PIN {{.tx = &pin_GPIO21, .rx = &pin_GPIO20}}
43-
44-
#define CIRCUITPY_ESP_USB_SERIAL_JTAG (1)

ports/espressif/boards/beetle-esp32-c3/mpconfigboard.mk

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,5 @@ IDF_TARGET = esp32c3
77
CIRCUITPY_ESP_FLASH_MODE=qio
88
CIRCUITPY_ESP_FLASH_FREQ=80m
99
CIRCUITPY_ESP_FLASH_SIZE=4MB
10+
11+
CIRCUITPY_ESP_USB_SERIAL_JTAG = 1

0 commit comments

Comments
 (0)