diff --git a/boards.txt b/boards.txt index 894995cd..722a6639 100644 --- a/boards.txt +++ b/boards.txt @@ -39,8 +39,10 @@ esp32.build.defines= esp32.menu.PSRAM.disabled=Disabled esp32.menu.PSRAM.disabled.build.defines= +esp32.menu.PSRAM.disabled.build.extra_libs= esp32.menu.PSRAM.enabled=Enabled esp32.menu.PSRAM.enabled.build.defines=-DBOARD_HAS_PSRAM -mfix-esp32-psram-cache-issue +esp32.menu.PSRAM.enabled.build.extra_libs=-lc-psram-workaround -lm-psram-workaround esp32.menu.PartitionScheme.default=Default 4MB with spiffs (1.2MB APP/1.5MB SPIFFS) esp32.menu.PartitionScheme.default.build.partitions=default @@ -174,6 +176,7 @@ esp32wrover.build.flash_mode=dio esp32wrover.build.boot=dio esp32wrover.build.partitions=default esp32wrover.build.defines=-DBOARD_HAS_PSRAM -mfix-esp32-psram-cache-issue +esp32wrover.build.extra_libs=-lc-psram-workaround -lm-psram-workaround esp32wrover.menu.PartitionScheme.default=Default 4MB with spiffs (1.2MB APP/1.5MB SPIFFS) esp32wrover.menu.PartitionScheme.default.build.partitions=default @@ -373,8 +376,10 @@ tinypico.menu.FlashFreq.40.build.flash_freq=40m tinypico.menu.PSRAM.enabled=Enabled tinypico.menu.PSRAM.enabled.build.defines=-DBOARD_HAS_PSRAM -mfix-esp32-psram-cache-issue +tinypico.menu.PSRAM.enabled.build.extra_libs=-lc-psram-workaround -lm-psram-workaround tinypico.menu.PSRAM.disabled=Disabled tinypico.menu.PSRAM.disabled.build.defines= +tinypico.menu.PSRAM.disabled.build.extra_libs= tinypico.menu.DebugLevel.none=None tinypico.menu.DebugLevel.none.build.code_debug=0 @@ -1408,8 +1413,10 @@ d32_pro.build.defines= d32_pro.menu.PSRAM.disabled=Disabled d32_pro.menu.PSRAM.disabled.build.defines= +d32_pro.menu.PSRAM.disabled.build.extra_libs= d32_pro.menu.PSRAM.enabled=Enabled d32_pro.menu.PSRAM.enabled.build.defines=-DBOARD_HAS_PSRAM -mfix-esp32-psram-cache-issue +d32_pro.menu.PSRAM.enabled.build.extra_libs=-lc-psram-workaround -lm-psram-workaround d32_pro.menu.PartitionScheme.default=Default d32_pro.menu.PartitionScheme.default.build.partitions=default @@ -2868,8 +2875,10 @@ m5stack-fire.build.defines= m5stack-fire.menu.PSRAM.enabled=Enabled m5stack-fire.menu.PSRAM.enabled.build.defines=-DBOARD_HAS_PSRAM -mfix-esp32-psram-cache-issue +m5stack-fire.menu.PSRAM.enabled.build.extra_libs=-lc-psram-workaround -lm-psram-workaround m5stack-fire.menu.PSRAM.disabled=Disabled m5stack-fire.menu.PSRAM.disabled.build.defines= +m5stack-fire.menu.PSRAM.disabled.build.extra_libs= m5stack-fire.menu.PartitionScheme.default=Default (2 x 6.5 MB app, 3.6 MB SPIFFS) m5stack-fire.menu.PartitionScheme.default.build.partitions=default_16MB @@ -3056,8 +3065,10 @@ m5stack-core2.build.defines= m5stack-core2.menu.PSRAM.enabled=Enabled m5stack-core2.menu.PSRAM.enabled.build.defines=-DBOARD_HAS_PSRAM -mfix-esp32-psram-cache-issue +m5stack-core2.menu.PSRAM.enabled.build.extra_libs=-lc-psram-workaround -lm-psram-workaround m5stack-core2.menu.PSRAM.disabled=Disabled m5stack-core2.menu.PSRAM.disabled.build.defines= +m5stack-core2.menu.PSRAM.disabled.build.extra_libs= m5stack-core2.menu.PartitionScheme.default=Default (2 x 6.5 MB app, 3.6 MB SPIFFS) m5stack-core2.menu.PartitionScheme.default.build.partitions=default_16MB @@ -3155,8 +3166,10 @@ m5stack-timer-cam.build.defines= m5stack-timer-cam.menu.PSRAM.enabled=Enabled m5stack-timer-cam.menu.PSRAM.enabled.build.defines=-DBOARD_HAS_PSRAM -mfix-esp32-psram-cache-issue +m5stack-timer-cam.menu.PSRAM.enabled.build.extra_libs=-lc-psram-workaround -lm-psram-workaround m5stack-timer-cam.menu.PSRAM.disabled=Disabled m5stack-timer-cam.menu.PSRAM.disabled.build.defines= +m5stack-timer-cam.menu.PSRAM.disabled.build.extra_libs= m5stack-timer-cam.menu.PartitionScheme.default=Default(3MB No OTA/1MB SPIFFS) m5stack-timer-cam.menu.PartitionScheme.default.build.partitions=huge_app @@ -3306,6 +3319,7 @@ odroid_esp32.build.flash_mode=dio odroid_esp32.build.boot=dio odroid_esp32.build.partitions=default odroid_esp32.build.defines=-DBOARD_HAS_PSRAM -mfix-esp32-psram-cache-issue +odroid_esp32.build.extra_libs=-lc-psram-workaround -lm-psram-workaround odroid_esp32.menu.FlashMode.qio=QIO odroid_esp32.menu.FlashMode.qio.build.flash_mode=dio @@ -3391,8 +3405,10 @@ heltec_wifi_kit_32.build.LoRaWanDebugLevel=0 heltec_wifi_kit_32.menu.PSRAM.disabled=Disabled heltec_wifi_kit_32.menu.PSRAM.disabled.build.defines= +heltec_wifi_kit_32.menu.PSRAM.disabled.build.extra_libs= heltec_wifi_kit_32.menu.PSRAM.enabled=Enabled heltec_wifi_kit_32.menu.PSRAM.enabled.build.defines=-DBOARD_HAS_PSRAM -mfix-esp32-psram-cache-issue +heltec_wifi_kit_32.menu.PSRAM.enabled.build.extra_libs=-lc-psram-workaround -lm-psram-workaround heltec_wifi_kit_32.menu.CPUFreq.240=240MHz (WiFi/BT) heltec_wifi_kit_32.menu.CPUFreq.240.build.f_cpu=240000000L @@ -3455,9 +3471,11 @@ heltec_wifi_lora_32.build.partitions=default heltec_wifi_lora_32.build.defines=-D{build.band} -DLoRaWAN_DEBUG_LEVEL={build.LoRaWanDebugLevel} -DACTIVE_REGION=LORAMAC_{build.band} {build.psram} heltec_wifi_lora_32.menu.PSRAM.disabled=Disabled -heltec_wifi_lora_32.menu.PSRAM.disabled.build.psram= +heltec_wifi_lora_32.menu.PSRAM.disabled.build.defines= +heltec_wifi_lora_32.menu.PSRAM.disabled.build.extra_libs= heltec_wifi_lora_32.menu.PSRAM.enabled=Enabled -heltec_wifi_lora_32.menu.PSRAM.enabled.build.psram=-DBOARD_HAS_PSRAM -mfix-esp32-psram-cache-issue +heltec_wifi_lora_32.menu.PSRAM.enabled.build.defines=-DBOARD_HAS_PSRAM -mfix-esp32-psram-cache-issue +heltec_wifi_lora_32.menu.PSRAM.enabled.build.extra_libs=-lc-psram-workaround -lm-psram-workaround heltec_wifi_lora_32.menu.CPUFreq.240=240MHz (WiFi/BT) heltec_wifi_lora_32.menu.CPUFreq.240.build.f_cpu=240000000L @@ -3550,9 +3568,11 @@ heltec_wifi_lora_32_V2.build.partitions=default_8MB heltec_wifi_lora_32_V2.build.defines=-D{build.band} -DLoRaWAN_DEBUG_LEVEL={build.LoRaWanDebugLevel} -DACTIVE_REGION=LORAMAC_{build.band} {build.psram} heltec_wifi_lora_32_V2.menu.PSRAM.disabled=Disabled -heltec_wifi_lora_32_V2.menu.PSRAM.disabled.build.psram= +heltec_wifi_lora_32_V2.menu.PSRAM.disabled.build.defines= +heltec_wifi_lora_32_V2.menu.PSRAM.disabled.build.extra_libs= heltec_wifi_lora_32_V2.menu.PSRAM.enabled=Enabled -heltec_wifi_lora_32_V2.menu.PSRAM.enabled.build.psram=-DBOARD_HAS_PSRAM -mfix-esp32-psram-cache-issue +heltec_wifi_lora_32_V2.menu.PSRAM.enabled.build.defines=-DBOARD_HAS_PSRAM -mfix-esp32-psram-cache-issue +heltec_wifi_lora_32_V2.menu.PSRAM.enabled.build.extra_libs=-lc-psram-workaround -lm-psram-workaround heltec_wifi_lora_32_V2.menu.CPUFreq.240=240MHz (WiFi/BT) heltec_wifi_lora_32_V2.menu.CPUFreq.240.build.f_cpu=240000000L @@ -3645,9 +3665,11 @@ heltec_wireless_stick.build.partitions=default_8MB heltec_wireless_stick.build.defines=-D{build.band} -DLoRaWAN_DEBUG_LEVEL={build.LoRaWanDebugLevel} -DACTIVE_REGION=LORAMAC_{build.band} {build.psram} heltec_wireless_stick.menu.PSRAM.disabled=Disabled -heltec_wireless_stick.menu.PSRAM.disabled.build.psram= +heltec_wireless_stick.menu.PSRAM.disabled.build.defines= +heltec_wireless_stick.menu.PSRAM.disabled.build.extra_libs= heltec_wireless_stick.menu.PSRAM.enabled=Enabled -heltec_wireless_stick.menu.PSRAM.enabled.build.psram=-DBOARD_HAS_PSRAM -mfix-esp32-psram-cache-issue +heltec_wireless_stick.menu.PSRAM.enabled.build.defines=-DBOARD_HAS_PSRAM -mfix-esp32-psram-cache-issue +heltec_wireless_stick.menu.PSRAM.enabled.build.extra_libs=-lc-psram-workaround -lm-psram-workaround heltec_wireless_stick.menu.CPUFreq.240=240MHz (WiFi/BT) heltec_wireless_stick.menu.CPUFreq.240.build.f_cpu=240000000L @@ -3740,9 +3762,11 @@ heltec_wireless_stick_lite.build.partitions=default heltec_wireless_stick_lite.build.defines=-D{build.band} -DLoRaWAN_DEBUG_LEVEL={build.LoRaWanDebugLevel} -DACTIVE_REGION=LORAMAC_{build.band} {build.psram} heltec_wireless_stick_lite.menu.PSRAM.disabled=Disabled -heltec_wireless_stick_lite.menu.PSRAM.disabled.build.psram= +heltec_wireless_stick_lite.menu.PSRAM.disabled.build.defines= +heltec_wireless_stick_lite.menu.PSRAM.disabled.build.extra_libs= heltec_wireless_stick_lite.menu.PSRAM.enabled=Enabled -heltec_wireless_stick_lite.menu.PSRAM.enabled.build.psram=-DBOARD_HAS_PSRAM -mfix-esp32-psram-cache-issue +heltec_wireless_stick_lite.menu.PSRAM.enabled.build.defines=-DBOARD_HAS_PSRAM -mfix-esp32-psram-cache-issue +heltec_wireless_stick_lite.menu.PSRAM.enabled.build.extra_libs=-lc-psram-workaround -lm-psram-workaround heltec_wireless_stick_lite.menu.CPUFreq.240=240MHz (WiFi/BT) heltec_wireless_stick_lite.menu.CPUFreq.240.build.f_cpu=240000000L @@ -3911,8 +3935,10 @@ CoreESP32.build.defines= CoreESP32.menu.PSRAM.disabled=Disabled CoreESP32.menu.PSRAM.disabled.build.defines= +CoreESP32.menu.PSRAM.disabled.build.extra_libs= CoreESP32.menu.PSRAM.enabled=Enabled CoreESP32.menu.PSRAM.enabled.build.defines=-DBOARD_HAS_PSRAM -mfix-esp32-psram-cache-issue +CoreESP32.menu.PSRAM.enabled.build.extra_libs=-lc-psram-workaround -lm-psram-workaround CoreESP32.menu.PartitionScheme.default=Default CoreESP32.menu.PartitionScheme.default.build.partitions=default @@ -3988,8 +4014,10 @@ alksesp32.build.defines= alksesp32.menu.PSRAM.disabled=Disabled alksesp32.menu.PSRAM.disabled.build.defines= +alksesp32.menu.PSRAM.disabled.build.extra_libs= alksesp32.menu.PSRAM.enabled=Enabled alksesp32.menu.PSRAM.enabled.build.defines=-DBOARD_HAS_PSRAM -mfix-esp32-psram-cache-issue +alksesp32.menu.PSRAM.enabled.build.extra_libs=-lc-psram-workaround -lm-psram-workaround alksesp32.menu.PartitionScheme.default=Default 4MB with spiffs (1.2MB APP/1.5MB SPIFFS) alksesp32.menu.PartitionScheme.default.build.partitions=default @@ -4273,8 +4301,10 @@ t-beam.build.partitions=default t-beam.menu.PSRAM.disabled=Disabled t-beam.menu.PSRAM.disabled.build.defines= +t-beam.menu.PSRAM.disabled.build.extra_libs= t-beam.menu.PSRAM.enabled=Enabled t-beam.menu.PSRAM.enabled.build.defines=-DBOARD_HAS_PSRAM -mfix-esp32-psram-cache-issue +t-beam.menu.PSRAM.enabled.build.extra_libs=-lc-psram-workaround -lm-psram-workaround t-beam.menu.FlashFreq.80=80MHz t-beam.menu.FlashFreq.80.build.flash_freq=80m @@ -4461,8 +4491,10 @@ lopy4.build.partitions=default lopy4.menu.PSRAM.disabled=Disabled lopy4.menu.PSRAM.disabled.build.defines= +lopy4.menu.PSRAM.disabled.build.extra_libs= lopy4.menu.PSRAM.enabled=Enabled lopy4.menu.PSRAM.enabled.build.defines=-DBOARD_HAS_PSRAM -mfix-esp32-psram-cache-issue +lopy4.menu.PSRAM.enabled.build.extra_libs=-lc-psram-workaround -lm-psram-workaround lopy4.menu.FlashFreq.80=80MHz lopy4.menu.FlashFreq.80.build.flash_freq=80m @@ -4642,8 +4674,10 @@ frogboard.build.defines= frogboard.menu.PSRAM.disabled=Disabled frogboard.menu.PSRAM.disabled.build.defines= +frogboard.menu.PSRAM.disabled.build.extra_libs= frogboard.menu.PSRAM.enabled=Enabled frogboard.menu.PSRAM.enabled.build.defines=-DBOARD_HAS_PSRAM -mfix-esp32-psram-cache-issue +frogboard.menu.PSRAM.enabled.build.extra_libs=-lc-psram-workaround -lm-psram-workaround frogboard.menu.PartitionScheme.default=Default frogboard.menu.PartitionScheme.default.build.partitions=default @@ -4726,6 +4760,7 @@ esp32cam.build.board=ESP32_DEV esp32cam.build.flash_size=4MB esp32cam.build.partitions=huge_app esp32cam.build.defines=-DBOARD_HAS_PSRAM -mfix-esp32-psram-cache-issue +esp32cam.build.extra_libs=-lc-psram-workaround -lm-psram-workaround esp32cam.build.code_debug=0 esp32cam.menu.CPUFreq.240=240MHz (WiFi/BT) @@ -4868,8 +4903,10 @@ twatch.build.defines= twatch.menu.PSRAM.enabled=Enabled twatch.menu.PSRAM.enabled.build.defines=-DBOARD_HAS_PSRAM -mfix-esp32-psram-cache-issue +twatch.menu.PSRAM.enabled.build.extra_libs=-lc-psram-workaround -lm-psram-workaround twatch.menu.PSRAM.disabled=Disabled twatch.menu.PSRAM.disabled.build.defines= +twatch.menu.PSRAM.disabled.build.extra_libs= twatch.menu.PartitionScheme.default=Default (2 x 6.5 MB app, 3.6 MB SPIFFS) twatch.menu.PartitionScheme.default.build.partitions=default_16MB @@ -5209,8 +5246,10 @@ mgbot-iotik32a.build.defines= mgbot-iotik32a.menu.PSRAM.disabled=Disabled mgbot-iotik32a.menu.PSRAM.disabled.build.defines= +mgbot-iotik32a.menu.PSRAM.disabled.build.extra_libs= mgbot-iotik32a.menu.PSRAM.enabled=Enabled mgbot-iotik32a.menu.PSRAM.enabled.build.defines=-DBOARD_HAS_PSRAM -mfix-esp32-psram-cache-issue +mgbot-iotik32a.menu.PSRAM.enabled.build.extra_libs=-lc-psram-workaround -lm-psram-workaround mgbot-iotik32a.menu.PartitionScheme.default=Default 4MB with spiffs (1.2MB APP/1.5MB SPIFFS) mgbot-iotik32a.menu.PartitionScheme.default.build.partitions=default @@ -5347,8 +5386,10 @@ mgbot-iotik32b.build.defines= mgbot-iotik32b.menu.PSRAM.disabled=Disabled mgbot-iotik32b.menu.PSRAM.disabled.build.defines= +mgbot-iotik32b.menu.PSRAM.disabled.build.extra_libs= mgbot-iotik32b.menu.PSRAM.enabled=Enabled mgbot-iotik32b.menu.PSRAM.enabled.build.defines=-DBOARD_HAS_PSRAM -mfix-esp32-psram-cache-issue +mgbot-iotik32b.menu.PSRAM.enabled.build.extra_libs=-lc-psram-workaround -lm-psram-workaround mgbot-iotik32b.menu.PartitionScheme.default=Default 4MB with spiffs (1.2MB APP/1.5MB SPIFFS) mgbot-iotik32b.menu.PartitionScheme.default.build.partitions=default @@ -5719,8 +5760,10 @@ mPython.build.defines= mPython.menu.PSRAM.disabled=Disabled mPython.menu.PSRAM.disabled.build.defines= +mPython.menu.PSRAM.disabled.build.extra_libs= mPython.menu.PSRAM.enabled=Enabled mPython.menu.PSRAM.enabled.build.defines=-DBOARD_HAS_PSRAM -mfix-esp32-psram-cache-issue +mPython.menu.PSRAM.enabled.build.extra_libs=-lc-psram-workaround -lm-psram-workaround mPython.menu.PartitionScheme.huge_app=Huge APP (3MB No OTA/1MB SPIFFS) mPython.menu.PartitionScheme.huge_app.build.partitions=huge_app diff --git a/platform.txt b/platform.txt index 3677e1ee..38793b8f 100644 --- a/platform.txt +++ b/platform.txt @@ -34,7 +34,7 @@ compiler.S.cmd=xtensa-esp32-elf-gcc compiler.S.flags=-c -g3 -x assembler-with-cpp -MMD -mlongcalls compiler.c.elf.cmd=xtensa-esp32-elf-gcc -compiler.c.elf.flags=-nostdlib "-L{compiler.sdk.path}/lib" "-L{compiler.sdk.path}/ld" -T esp32_out.ld -T esp32.project.ld -T esp32.rom.ld -T esp32.peripherals.ld -T esp32.rom.libgcc.ld -T esp32.rom.spiram_incompatible_fns.ld -u ld_include_panic_highint_hdl -u call_user_start_cpu0 -Wl,--gc-sections -Wl,-static -Wl,--undefined=uxTopUsedPriority -u __cxa_guard_dummy -u __cxx_fatal_exception +compiler.c.elf.flags=-nostdlib "-L{compiler.sdk.path}/lib" "-L{compiler.sdk.path}/ld" -T esp32_out.ld -T esp32.project.ld -T esp32.rom.ld -T esp32.peripherals.ld -T esp32.rom.libgcc.ld -T esp32.rom.spiram_incompatible_fns.ld -u esp_app_desc -u ld_include_panic_highint_hdl -u call_user_start_cpu0 -Wl,--gc-sections -Wl,-static -Wl,--undefined=uxTopUsedPriority -u __cxa_guard_dummy -u __cxx_fatal_exception compiler.c.elf.libs=-lgcc -lopenssl -lbtdm_app -lfatfs -lwps -lcoexist -lwear_levelling -lesp_http_client -lprotobuf-c -lhal -lnewlib -ldriver -lbootloader_support -lpp -lfreemodbus -lmesh -lsmartconfig -ljsmn -lwpa -lethernet -lphy -lapp_trace -lconsole -lulp -lwpa_supplicant -lfreertos -lbt -lmicro-ecc -lesp32-camera -lcxx -lxtensa-debug-module -ltcp_transport -lod -lmdns -ldetection -lvfs -lpe -lesp_websocket_client -lespcoredump -lesp_ringbuf -lsoc -lcore -lfb_gfx -lsdmmc -llibsodium -lcoap -ltcpip_adapter -lprotocomm -lesp_event -limage_util -lc_nano -lesp-tls -lasio -lrtc -lspi_flash -lwpa2 -lwifi_provisioning -lesp32 -lface_recognition -lapp_update -lnghttp -ldl -lspiffs -lface_detection -lefuse -lunity -lesp_https_server -lespnow -lnvs_flash -lesp_adc_cal -llog -ldetection_cat_face -lsmartconfig_ack -lexpat -lm -lfr -lmqtt -lc -lheap -lmbedtls -llwip -lnet80211 -lesp_http_server -lpthread -ljson -lesp_https_ota -lfd -lstdc++ compiler.as.cmd=xtensa-esp32-elf-as @@ -53,6 +53,7 @@ build.boot=bootloader build.code_debug=0 build.defines= build.extra_flags=-DESP32 -DCORE_DEBUG_LEVEL={build.code_debug} {build.defines} +build.extra_libs= # These can be overridden in platform.local.txt compiler.c.extra_flags= @@ -84,7 +85,7 @@ recipe.S.o.pattern="{compiler.path}{compiler.c.cmd}" {compiler.cpreprocessor.fla recipe.ar.pattern="{compiler.path}{compiler.ar.cmd}" {compiler.ar.flags} {compiler.ar.extra_flags} "{archive_file_path}" "{object_file}" ## Combine gc-sections, archives, and objects -recipe.c.combine.pattern="{compiler.path}{compiler.c.elf.cmd}" {compiler.c.elf.flags} {compiler.c.elf.extra_flags} {compiler.libraries.ldflags} -Wl,--start-group {object_files} "{archive_file_path}" {compiler.c.elf.libs} -Wl,--end-group -Wl,-EL -o "{build.path}/{build.project_name}.elf" +recipe.c.combine.pattern="{compiler.path}{compiler.c.elf.cmd}" {compiler.c.elf.flags} {compiler.c.elf.extra_flags} {compiler.libraries.ldflags} -Wl,--start-group {object_files} "{archive_file_path}" {compiler.c.elf.libs} {build.extra_libs} -Wl,--end-group -Wl,-EL -o "{build.path}/{build.project_name}.elf" ## Create partitions.bin recipe.objcopy.partitions.bin.pattern={tools.gen_esp32part.cmd} -q "{build.path}/partitions.csv" "{build.path}/{build.project_name}.partitions.bin" diff --git a/tools/sdk/lib/libc-psram-workaround.a b/tools/sdk/lib/libc-psram-workaround.a new file mode 100644 index 00000000..a0bbafd9 Binary files /dev/null and b/tools/sdk/lib/libc-psram-workaround.a differ diff --git a/tools/sdk/lib/libm-psram-workaround.a b/tools/sdk/lib/libm-psram-workaround.a new file mode 100644 index 00000000..a361baa3 Binary files /dev/null and b/tools/sdk/lib/libm-psram-workaround.a differ