Skip to content

Commit 265a235

Browse files
committed
Exclude LWIP_FEATURES and float printf/scanf
1 parent 5e15a05 commit 265a235

File tree

2 files changed

+21
-3
lines changed

2 files changed

+21
-3
lines changed

src/python/build_flags.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,26 @@ def get_version():
176176
target_name != "NATIVE":
177177
build_flags = [f for f in build_flags if "Regulatory_Domain_ISM_2400" not in f]
178178

179+
# Slim down the ESP8266 targets by not force-including float in scanf/printf
180+
if env.get('PIOPLATFORM', '') == 'espressif8266':
181+
env.Replace(LINKFLAGS=[
182+
"-Os",
183+
"-nostdlib",
184+
"-Wl,--no-check-sections",
185+
"-Wl,-static",
186+
"-Wl,--gc-sections",
187+
"-Wl,-wrap,system_restart_local",
188+
"-Wl,-wrap,spi_flash_read",
189+
"-u", "app_entry",
190+
#"-u", "_printf_float",
191+
#"-u", "_scanf_float",
192+
"-u", "_DebugExceptionVector",
193+
"-u", "_DoubleExceptionVector",
194+
"-u", "_KernelExceptionVector",
195+
"-u", "_NMIExceptionVector",
196+
"-u", "_UserExceptionVector"
197+
])
198+
179199
env['OPTIONS_JSON'] = json_flags
180200
env['BUILD_FLAGS'] = build_flags
181201
sys.stdout.write("\nbuild flags: %s\n\n" % build_flags)

src/targets/common.ini

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -139,9 +139,7 @@ build_flags =
139139
-D PLATFORM_ESP8266=1
140140
-D VTABLES_IN_FLASH=1
141141
-D PIO_FRAMEWORK_ARDUINO_MMU_CACHE16_IRAM48
142-
-D CONFIG_TCPIP_LWIP=1
143-
-D BEARSSL_SSL_BASIC
144-
-O2
142+
-D PIO_FRAMEWORK_ARDUINO_LWIP2_LOW_MEMORY_LOW_FLASH
145143
-I ${PROJECTSRC_DIR}/hal
146144
board_build.f_cpu = 160000000L
147145
board_build.ldscript = eagle.flash.1m.ld

0 commit comments

Comments
 (0)