Skip to content

Commit 99726e2

Browse files
committed
Switch to newlib nano
1 parent 18fd004 commit 99726e2

9 files changed

Lines changed: 61 additions & 6 deletions

File tree

ports/espressif/Makefile

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ ifeq ($(DEBUG), 1)
135135
# You may want to enable these flags to make setting breakpoints easier.
136136
# CFLAGS += -fno-inline -fno-ipa-sra
137137
else
138-
CFLAGS += -DNDEBUG -ggdb3
138+
CFLAGS += -DNDEBUG
139139
# RISC-V is larger than xtensa
140140
# Use -Os for RISC-V when it overflows
141141
ifeq ($(IDF_TARGET_ARCH),riscv)
@@ -150,6 +150,11 @@ CFLAGS += $(OPTIMIZATION_FLAGS)
150150

151151
CFLAGS += $(INC) -Werror -Wall -std=gnu11 -Wl,--gc-sections $(BASE_CFLAGS) $(C_DEFS) $(CFLAGS_MOD) $(COPT) -Werror=missing-prototypes
152152

153+
# Most current ESPs have nano versions of newlib in ROM so we use them.
154+
ifneq ($(IDF_TARGET),esp32c6)
155+
CFLAGS += --specs=nano.specs
156+
endif
157+
153158
ifeq ($(IDF_TARGET_ARCH),xtensa)
154159
CFLAGS += -mlongcalls
155160
else ifeq ($(IDF_TARGET_ARCH),riscv)
@@ -412,8 +417,12 @@ endif
412417
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_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
413418
ifneq ($(CIRCUITPY_BLEIO),0)
414419
ESP_IDF_COMPONENTS_LINK += bt
420+
ifeq ($(IDF_TARGET),esp32)
421+
BINARY_BLOBS += esp-idf/components/bt/controller/lib_esp32/$(IDF_TARGET)/libbtdm_app.a
422+
else
415423
BINARY_BLOBS += esp-idf/components/esp_phy/lib/$(IDF_TARGET)/libbtbb.a \
416-
esp-idf/components/bt/controller/lib_esp32c3_family/$(IDF_TARGET)/libbtdm_app.a
424+
esp-idf/components/bt/controller/lib_esp32c3_family/$(IDF_TARGET)/libbtdm_app.a
425+
endif
417426
endif
418427
ifneq ($(CIRCUITPY_ESPULP),0)
419428
ESP_IDF_COMPONENTS_LINK += ulp

ports/espressif/boards/adafruit_esp32s3_camera/sdkconfig

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,13 @@
1010
CONFIG_LWIP_LOCAL_HOSTNAME="espressif-esp32s3"
1111
# end of LWIP
1212

13+
#
14+
# Camera configuration
15+
#
16+
# CONFIG_OV7725_SUPPORT is not set
17+
# CONFIG_OV3660_SUPPORT is not set
18+
# end of Camera configuration
19+
1320
# end of Component config
1421

1522
# end of Espressif IoT Development Framework Configuration

ports/espressif/esp-idf-config/sdkconfig-esp32.defaults

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,12 @@ CONFIG_ESP32_WIFI_CACHE_TX_BUFFER_NUM=16
5656
# CONFIG_ESP_WIFI_STA_DISCONNECTED_PM_ENABLE is not set
5757
# end of Wi-Fi
5858

59+
#
60+
# Newlib
61+
#
62+
CONFIG_NEWLIB_NANO_FORMAT=y
63+
# end of Newlib
64+
5965
#
6066
# SPI Flash driver
6167
#

ports/espressif/esp-idf-config/sdkconfig-esp32c3.defaults

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,12 @@ CONFIG_I2S_SUPPRESS_DEPRECATE_WARN=y
4949

5050
# end of Driver Configurations
5151

52+
#
53+
# Newlib
54+
#
55+
CONFIG_NEWLIB_NANO_FORMAT=y
56+
# end of Newlib
57+
5258
# end of Component config
5359

5460
# end of Espressif IoT Development Framework Configuration

ports/espressif/esp-idf-config/sdkconfig-esp32s2.defaults

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,12 @@ CONFIG_ESP32S2_RTCDATA_IN_FAST_MEM=y
4646

4747
# end of ESP System Settings
4848

49+
#
50+
# Newlib
51+
#
52+
CONFIG_NEWLIB_NANO_FORMAT=y
53+
# end of Newlib
54+
4955
#
5056
# Ultra Low Power (ULP) Co-processor
5157
#

ports/espressif/esp-idf-config/sdkconfig-esp32s3.defaults

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,12 @@ CONFIG_ESP32_WIFI_DYNAMIC_TX_BUFFER_NUM=16
8585
# CONFIG_ESP32_WIFI_NVS_ENABLED is not set
8686
# end of Wi-Fi
8787

88+
#
89+
# Newlib
90+
#
91+
CONFIG_NEWLIB_NANO_FORMAT=y
92+
# end of Newlib
93+
8894
#
8995
# Ultra Low Power (ULP) Co-processor
9096
#
Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,25 @@
11
#
2+
# Espressif IoT Development Framework Configuration
3+
#
4+
#
25
# Serial flasher config
36
#
47
# CONFIG_ESPTOOLPY_FLASHSIZE_1MB is not set
58
# CONFIG_ESPTOOLPY_FLASHSIZE_2MB is not set
69
CONFIG_ESPTOOLPY_FLASHSIZE_4MB=y
710
# CONFIG_ESPTOOLPY_FLASHSIZE_8MB is not set
811
# CONFIG_ESPTOOLPY_FLASHSIZE_16MB is not set
12+
# CONFIG_ESPTOOLPY_FLASHSIZE_32MB is not set
13+
# CONFIG_ESPTOOLPY_FLASHSIZE_64MB is not set
14+
# CONFIG_ESPTOOLPY_FLASHSIZE_128MB is not set
915
CONFIG_ESPTOOLPY_FLASHSIZE="4MB"
10-
CONFIG_ESPTOOLPY_FLASHSIZE_DETECT=y
1116
# end of Serial flasher config
1217

13-
CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="esp-idf-config/partitions-4MB-no-uf2.csv"
1418
#
1519
# Partition Table
1620
#
21+
CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="esp-idf-config/partitions-4MB-no-uf2.csv"
1722
CONFIG_PARTITION_TABLE_FILENAME="esp-idf-config/partitions-4MB-no-uf2.csv"
1823
# end of Partition Table
24+
25+
# end of Espressif IoT Development Framework Configuration
Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,25 @@
11
#
2+
# Espressif IoT Development Framework Configuration
3+
#
4+
#
25
# Serial flasher config
36
#
47
# CONFIG_ESPTOOLPY_FLASHSIZE_1MB is not set
58
# CONFIG_ESPTOOLPY_FLASHSIZE_2MB is not set
69
# CONFIG_ESPTOOLPY_FLASHSIZE_4MB is not set
710
CONFIG_ESPTOOLPY_FLASHSIZE_8MB=y
811
# CONFIG_ESPTOOLPY_FLASHSIZE_16MB is not set
12+
# CONFIG_ESPTOOLPY_FLASHSIZE_32MB is not set
13+
# CONFIG_ESPTOOLPY_FLASHSIZE_64MB is not set
14+
# CONFIG_ESPTOOLPY_FLASHSIZE_128MB is not set
915
CONFIG_ESPTOOLPY_FLASHSIZE="8MB"
10-
CONFIG_ESPTOOLPY_FLASHSIZE_DETECT=y
1116
# end of Serial flasher config
1217

13-
CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="esp-idf-config/partitions-8MB-no-uf2.csv"
1418
#
1519
# Partition Table
1620
#
21+
CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="esp-idf-config/partitions-8MB-no-uf2.csv"
1722
CONFIG_PARTITION_TABLE_FILENAME="esp-idf-config/partitions-8MB-no-uf2.csv"
1823
# end of Partition Table
24+
25+
# end of Espressif IoT Development Framework Configuration

ports/espressif/mpconfigport.mk

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ CIRCUITPY_WIFI ?= 1
4949
ifeq ($(IDF_TARGET),esp32)
5050
# Modules
5151
CIRCUITPY_RGBMATRIX = 0
52+
CIRCUITPY_BLEIO = 0
5253
# Features
5354
CIRCUITPY_USB = 0
5455

0 commit comments

Comments
 (0)