From d0f7293491d75b64fae513e26865f53cf19ecb9e Mon Sep 17 00:00:00 2001 From: david gauchard Date: Sun, 12 Nov 2023 23:53:39 +0100 Subject: [PATCH] optionally move float emulation code into iram (#8958) * optionally move float emulation code into iram allows doing float operation in iram suitable for libraries like AccelStepper when called from ISR * proposed changes for pio from @mcspr --- boards.txt | 153 ++++++++++++++++++ doc/ideoptions.rst | 6 + .../package_esp8266com_index.template.json | 2 +- platform.txt | 9 +- tools/boards.txt.py | 14 ++ tools/platformio-build.py | 16 +- tools/sdk/ld/eagle.app.v6.common.ld.h | 10 ++ 7 files changed, 201 insertions(+), 9 deletions(-) diff --git a/boards.txt b/boards.txt index 35a4b5ad71..a1fdd6125d 100644 --- a/boards.txt +++ b/boards.txt @@ -24,6 +24,7 @@ menu.exception=C++ Exceptions menu.stacksmash=Stack Protection menu.wipe=Erase Flash menu.sdk=NONOS SDK Version +menu.iramfloat=Floating Point operations menu.ssl=SSL Support menu.mmu=MMU menu.non32xfer=Non-32-Bit Access @@ -496,6 +497,10 @@ generic.menu.eesz.autoflash.build.flash_size=16M generic.menu.eesz.autoflash.build.flash_ld=eagle.flash.auto.ld generic.menu.eesz.autoflash.build.extra_flags=-DFLASH_MAP_SUPPORT=1 generic.menu.eesz.autoflash.upload.maximum_size=1044464 +generic.menu.iramfloat.no=in IROM +generic.menu.iramfloat.no.build.iramfloat=-DFP_IN_IROM +generic.menu.iramfloat.yes=allowed in ISR +generic.menu.iramfloat.yes.build.iramfloat=-DFP_IN_IRAM ############################################################## esp8285.name=Generic ESP8285 Module @@ -848,6 +853,10 @@ esp8285.menu.eesz.autoflash.build.flash_size=16M esp8285.menu.eesz.autoflash.build.flash_ld=eagle.flash.auto.ld esp8285.menu.eesz.autoflash.build.extra_flags=-DFLASH_MAP_SUPPORT=1 esp8285.menu.eesz.autoflash.upload.maximum_size=1044464 +esp8285.menu.iramfloat.no=in IROM +esp8285.menu.iramfloat.no.build.iramfloat=-DFP_IN_IROM +esp8285.menu.iramfloat.yes=allowed in ISR +esp8285.menu.iramfloat.yes.build.iramfloat=-DFP_IN_IRAM ############################################################## gen4iod.name=4D Systems gen4 IoD Range @@ -1123,6 +1132,10 @@ gen4iod.menu.eesz.autoflash.build.flash_size=16M gen4iod.menu.eesz.autoflash.build.flash_ld=eagle.flash.auto.ld gen4iod.menu.eesz.autoflash.build.extra_flags=-DFLASH_MAP_SUPPORT=1 gen4iod.menu.eesz.autoflash.upload.maximum_size=1044464 +gen4iod.menu.iramfloat.no=in IROM +gen4iod.menu.iramfloat.no.build.iramfloat=-DFP_IN_IROM +gen4iod.menu.iramfloat.yes=allowed in ISR +gen4iod.menu.iramfloat.yes.build.iramfloat=-DFP_IN_IRAM ############################################################## huzzah.name=Adafruit Feather HUZZAH ESP8266 @@ -1342,6 +1355,10 @@ huzzah.menu.eesz.autoflash.build.flash_size=16M huzzah.menu.eesz.autoflash.build.flash_ld=eagle.flash.auto.ld huzzah.menu.eesz.autoflash.build.extra_flags=-DFLASH_MAP_SUPPORT=1 huzzah.menu.eesz.autoflash.upload.maximum_size=1044464 +huzzah.menu.iramfloat.no=in IROM +huzzah.menu.iramfloat.no.build.iramfloat=-DFP_IN_IROM +huzzah.menu.iramfloat.yes=allowed in ISR +huzzah.menu.iramfloat.yes.build.iramfloat=-DFP_IN_IRAM ############################################################## wifi_slot.name=Amperka WiFi Slot @@ -1655,6 +1672,10 @@ wifi_slot.menu.eesz.autoflash.build.flash_size=16M wifi_slot.menu.eesz.autoflash.build.flash_ld=eagle.flash.auto.ld wifi_slot.menu.eesz.autoflash.build.extra_flags=-DFLASH_MAP_SUPPORT=1 wifi_slot.menu.eesz.autoflash.upload.maximum_size=1044464 +wifi_slot.menu.iramfloat.no=in IROM +wifi_slot.menu.iramfloat.no.build.iramfloat=-DFP_IN_IROM +wifi_slot.menu.iramfloat.yes=allowed in ISR +wifi_slot.menu.iramfloat.yes.build.iramfloat=-DFP_IN_IRAM ############################################################## arduino-esp8266.name=Arduino @@ -1886,6 +1907,10 @@ arduino-esp8266.menu.eesz.autoflash.build.flash_size=16M arduino-esp8266.menu.eesz.autoflash.build.flash_ld=eagle.flash.auto.ld arduino-esp8266.menu.eesz.autoflash.build.extra_flags=-DFLASH_MAP_SUPPORT=1 arduino-esp8266.menu.eesz.autoflash.upload.maximum_size=1044464 +arduino-esp8266.menu.iramfloat.no=in IROM +arduino-esp8266.menu.iramfloat.no.build.iramfloat=-DFP_IN_IROM +arduino-esp8266.menu.iramfloat.yes=allowed in ISR +arduino-esp8266.menu.iramfloat.yes.build.iramfloat=-DFP_IN_IRAM ############################################################## espmxdevkit.name=DOIT ESP-Mx DevKit (ESP8285) @@ -2138,6 +2163,10 @@ espmxdevkit.menu.eesz.autoflash.build.flash_size=16M espmxdevkit.menu.eesz.autoflash.build.flash_ld=eagle.flash.auto.ld espmxdevkit.menu.eesz.autoflash.build.extra_flags=-DFLASH_MAP_SUPPORT=1 espmxdevkit.menu.eesz.autoflash.upload.maximum_size=1044464 +espmxdevkit.menu.iramfloat.no=in IROM +espmxdevkit.menu.iramfloat.no.build.iramfloat=-DFP_IN_IROM +espmxdevkit.menu.iramfloat.yes=allowed in ISR +espmxdevkit.menu.iramfloat.yes.build.iramfloat=-DFP_IN_IRAM ############################################################## oak.name=Digistump Oak @@ -2358,6 +2387,10 @@ oak.menu.eesz.autoflash.build.flash_size=16M oak.menu.eesz.autoflash.build.flash_ld=eagle.flash.auto.ld oak.menu.eesz.autoflash.build.extra_flags=-DFLASH_MAP_SUPPORT=1 oak.menu.eesz.autoflash.upload.maximum_size=1044464 +oak.menu.iramfloat.no=in IROM +oak.menu.iramfloat.no.build.iramfloat=-DFP_IN_IROM +oak.menu.iramfloat.yes=allowed in ISR +oak.menu.iramfloat.yes.build.iramfloat=-DFP_IN_IRAM ############################################################## espduino.name=ESPDuino (ESP-13 Module) @@ -2585,6 +2618,10 @@ espduino.menu.eesz.autoflash.build.flash_size=16M espduino.menu.eesz.autoflash.build.flash_ld=eagle.flash.auto.ld espduino.menu.eesz.autoflash.build.extra_flags=-DFLASH_MAP_SUPPORT=1 espduino.menu.eesz.autoflash.upload.maximum_size=1044464 +espduino.menu.iramfloat.no=in IROM +espduino.menu.iramfloat.no.build.iramfloat=-DFP_IN_IROM +espduino.menu.iramfloat.yes=allowed in ISR +espduino.menu.iramfloat.yes.build.iramfloat=-DFP_IN_IRAM ############################################################## espectro.name=ESPectro Core @@ -2804,6 +2841,10 @@ espectro.menu.eesz.autoflash.build.flash_size=16M espectro.menu.eesz.autoflash.build.flash_ld=eagle.flash.auto.ld espectro.menu.eesz.autoflash.build.extra_flags=-DFLASH_MAP_SUPPORT=1 espectro.menu.eesz.autoflash.upload.maximum_size=1044464 +espectro.menu.iramfloat.no=in IROM +espectro.menu.iramfloat.no.build.iramfloat=-DFP_IN_IROM +espectro.menu.iramfloat.yes=allowed in ISR +espectro.menu.iramfloat.yes.build.iramfloat=-DFP_IN_IRAM ############################################################## espino.name=ESPino (ESP-12 Module) @@ -3026,6 +3067,10 @@ espino.menu.eesz.autoflash.build.flash_size=16M espino.menu.eesz.autoflash.build.flash_ld=eagle.flash.auto.ld espino.menu.eesz.autoflash.build.extra_flags=-DFLASH_MAP_SUPPORT=1 espino.menu.eesz.autoflash.upload.maximum_size=1044464 +espino.menu.iramfloat.no=in IROM +espino.menu.iramfloat.no.build.iramfloat=-DFP_IN_IROM +espino.menu.iramfloat.yes=allowed in ISR +espino.menu.iramfloat.yes.build.iramfloat=-DFP_IN_IRAM ############################################################## espresso_lite_v1.name=ESPresso Lite 1.0 @@ -3248,6 +3293,10 @@ espresso_lite_v1.menu.eesz.autoflash.build.flash_size=16M espresso_lite_v1.menu.eesz.autoflash.build.flash_ld=eagle.flash.auto.ld espresso_lite_v1.menu.eesz.autoflash.build.extra_flags=-DFLASH_MAP_SUPPORT=1 espresso_lite_v1.menu.eesz.autoflash.upload.maximum_size=1044464 +espresso_lite_v1.menu.iramfloat.no=in IROM +espresso_lite_v1.menu.iramfloat.no.build.iramfloat=-DFP_IN_IROM +espresso_lite_v1.menu.iramfloat.yes=allowed in ISR +espresso_lite_v1.menu.iramfloat.yes.build.iramfloat=-DFP_IN_IRAM ############################################################## espresso_lite_v2.name=ESPresso Lite 2.0 @@ -3470,6 +3519,10 @@ espresso_lite_v2.menu.eesz.autoflash.build.flash_size=16M espresso_lite_v2.menu.eesz.autoflash.build.flash_ld=eagle.flash.auto.ld espresso_lite_v2.menu.eesz.autoflash.build.extra_flags=-DFLASH_MAP_SUPPORT=1 espresso_lite_v2.menu.eesz.autoflash.upload.maximum_size=1044464 +espresso_lite_v2.menu.iramfloat.no=in IROM +espresso_lite_v2.menu.iramfloat.no.build.iramfloat=-DFP_IN_IROM +espresso_lite_v2.menu.iramfloat.yes=allowed in ISR +espresso_lite_v2.menu.iramfloat.yes.build.iramfloat=-DFP_IN_IRAM ############################################################## sonoff.name=ITEAD Sonoff @@ -3730,6 +3783,10 @@ sonoff.menu.eesz.autoflash.build.flash_size=16M sonoff.menu.eesz.autoflash.build.flash_ld=eagle.flash.auto.ld sonoff.menu.eesz.autoflash.build.extra_flags=-DFLASH_MAP_SUPPORT=1 sonoff.menu.eesz.autoflash.upload.maximum_size=1044464 +sonoff.menu.iramfloat.no=in IROM +sonoff.menu.iramfloat.no.build.iramfloat=-DFP_IN_IROM +sonoff.menu.iramfloat.yes=allowed in ISR +sonoff.menu.iramfloat.yes.build.iramfloat=-DFP_IN_IRAM ############################################################## inventone.name=Invent One @@ -3949,6 +4006,10 @@ inventone.menu.eesz.autoflash.build.flash_size=16M inventone.menu.eesz.autoflash.build.flash_ld=eagle.flash.auto.ld inventone.menu.eesz.autoflash.build.extra_flags=-DFLASH_MAP_SUPPORT=1 inventone.menu.eesz.autoflash.upload.maximum_size=1044464 +inventone.menu.iramfloat.no=in IROM +inventone.menu.iramfloat.no.build.iramfloat=-DFP_IN_IROM +inventone.menu.iramfloat.yes=allowed in ISR +inventone.menu.iramfloat.yes.build.iramfloat=-DFP_IN_IRAM ############################################################## d1_wroom_02.name=LOLIN(WEMOS) D1 ESP-WROOM-02 @@ -4184,6 +4245,10 @@ d1_wroom_02.menu.eesz.autoflash.build.flash_size=16M d1_wroom_02.menu.eesz.autoflash.build.flash_ld=eagle.flash.auto.ld d1_wroom_02.menu.eesz.autoflash.build.extra_flags=-DFLASH_MAP_SUPPORT=1 d1_wroom_02.menu.eesz.autoflash.upload.maximum_size=1044464 +d1_wroom_02.menu.iramfloat.no=in IROM +d1_wroom_02.menu.iramfloat.no.build.iramfloat=-DFP_IN_IROM +d1_wroom_02.menu.iramfloat.yes=allowed in ISR +d1_wroom_02.menu.iramfloat.yes.build.iramfloat=-DFP_IN_IRAM ############################################################## d1_mini.name=LOLIN(WEMOS) D1 R2 & mini @@ -4403,6 +4468,10 @@ d1_mini.menu.eesz.autoflash.build.flash_size=16M d1_mini.menu.eesz.autoflash.build.flash_ld=eagle.flash.auto.ld d1_mini.menu.eesz.autoflash.build.extra_flags=-DFLASH_MAP_SUPPORT=1 d1_mini.menu.eesz.autoflash.upload.maximum_size=1044464 +d1_mini.menu.iramfloat.no=in IROM +d1_mini.menu.iramfloat.no.build.iramfloat=-DFP_IN_IROM +d1_mini.menu.iramfloat.yes=allowed in ISR +d1_mini.menu.iramfloat.yes.build.iramfloat=-DFP_IN_IRAM ############################################################## d1_mini_clone.name=LOLIN(WEMOS) D1 mini (clone) @@ -4639,6 +4708,10 @@ d1_mini_clone.menu.eesz.autoflash.build.flash_size=16M d1_mini_clone.menu.eesz.autoflash.build.flash_ld=eagle.flash.auto.ld d1_mini_clone.menu.eesz.autoflash.build.extra_flags=-DFLASH_MAP_SUPPORT=1 d1_mini_clone.menu.eesz.autoflash.upload.maximum_size=1044464 +d1_mini_clone.menu.iramfloat.no=in IROM +d1_mini_clone.menu.iramfloat.no.build.iramfloat=-DFP_IN_IROM +d1_mini_clone.menu.iramfloat.yes=allowed in ISR +d1_mini_clone.menu.iramfloat.yes.build.iramfloat=-DFP_IN_IRAM ############################################################## d1_mini_lite.name=LOLIN(WEMOS) D1 mini Lite @@ -4890,6 +4963,10 @@ d1_mini_lite.menu.eesz.autoflash.build.flash_size=16M d1_mini_lite.menu.eesz.autoflash.build.flash_ld=eagle.flash.auto.ld d1_mini_lite.menu.eesz.autoflash.build.extra_flags=-DFLASH_MAP_SUPPORT=1 d1_mini_lite.menu.eesz.autoflash.upload.maximum_size=1044464 +d1_mini_lite.menu.iramfloat.no=in IROM +d1_mini_lite.menu.iramfloat.no.build.iramfloat=-DFP_IN_IROM +d1_mini_lite.menu.iramfloat.yes=allowed in ISR +d1_mini_lite.menu.iramfloat.yes.build.iramfloat=-DFP_IN_IRAM ############################################################## d1_mini_pro.name=LOLIN(WEMOS) D1 mini Pro @@ -5101,6 +5178,10 @@ d1_mini_pro.menu.eesz.autoflash.build.flash_size=16M d1_mini_pro.menu.eesz.autoflash.build.flash_ld=eagle.flash.auto.ld d1_mini_pro.menu.eesz.autoflash.build.extra_flags=-DFLASH_MAP_SUPPORT=1 d1_mini_pro.menu.eesz.autoflash.upload.maximum_size=1044464 +d1_mini_pro.menu.iramfloat.no=in IROM +d1_mini_pro.menu.iramfloat.no.build.iramfloat=-DFP_IN_IROM +d1_mini_pro.menu.iramfloat.yes=allowed in ISR +d1_mini_pro.menu.iramfloat.yes.build.iramfloat=-DFP_IN_IRAM ############################################################## d1.name=LOLIN(WeMos) D1 R1 @@ -5320,6 +5401,10 @@ d1.menu.eesz.autoflash.build.flash_size=16M d1.menu.eesz.autoflash.build.flash_ld=eagle.flash.auto.ld d1.menu.eesz.autoflash.build.extra_flags=-DFLASH_MAP_SUPPORT=1 d1.menu.eesz.autoflash.upload.maximum_size=1044464 +d1.menu.iramfloat.no=in IROM +d1.menu.iramfloat.no.build.iramfloat=-DFP_IN_IROM +d1.menu.iramfloat.yes=allowed in ISR +d1.menu.iramfloat.yes.build.iramfloat=-DFP_IN_IRAM ############################################################## agruminolemon.name=Lifely Agrumino Lemon v4 @@ -5555,6 +5640,10 @@ agruminolemon.menu.eesz.autoflash.build.flash_size=16M agruminolemon.menu.eesz.autoflash.build.flash_ld=eagle.flash.auto.ld agruminolemon.menu.eesz.autoflash.build.extra_flags=-DFLASH_MAP_SUPPORT=1 agruminolemon.menu.eesz.autoflash.upload.maximum_size=1044464 +agruminolemon.menu.iramfloat.no=in IROM +agruminolemon.menu.iramfloat.no.build.iramfloat=-DFP_IN_IROM +agruminolemon.menu.iramfloat.yes=allowed in ISR +agruminolemon.menu.iramfloat.yes.build.iramfloat=-DFP_IN_IRAM ############################################################## nodemcu.name=NodeMCU 0.9 (ESP-12 Module) @@ -5774,6 +5863,10 @@ nodemcu.menu.eesz.autoflash.build.flash_size=16M nodemcu.menu.eesz.autoflash.build.flash_ld=eagle.flash.auto.ld nodemcu.menu.eesz.autoflash.build.extra_flags=-DFLASH_MAP_SUPPORT=1 nodemcu.menu.eesz.autoflash.upload.maximum_size=1044464 +nodemcu.menu.iramfloat.no=in IROM +nodemcu.menu.iramfloat.no.build.iramfloat=-DFP_IN_IROM +nodemcu.menu.iramfloat.yes=allowed in ISR +nodemcu.menu.iramfloat.yes.build.iramfloat=-DFP_IN_IRAM ############################################################## nodemcuv2.name=NodeMCU 1.0 (ESP-12E Module) @@ -5997,6 +6090,10 @@ nodemcuv2.menu.eesz.autoflash.build.flash_size=16M nodemcuv2.menu.eesz.autoflash.build.flash_ld=eagle.flash.auto.ld nodemcuv2.menu.eesz.autoflash.build.extra_flags=-DFLASH_MAP_SUPPORT=1 nodemcuv2.menu.eesz.autoflash.upload.maximum_size=1044464 +nodemcuv2.menu.iramfloat.no=in IROM +nodemcuv2.menu.iramfloat.no.build.iramfloat=-DFP_IN_IROM +nodemcuv2.menu.iramfloat.yes=allowed in ISR +nodemcuv2.menu.iramfloat.yes.build.iramfloat=-DFP_IN_IRAM ############################################################## modwifi.name=Olimex MOD-WIFI-ESP8266(-DEV) @@ -6247,6 +6344,10 @@ modwifi.menu.eesz.autoflash.build.flash_size=16M modwifi.menu.eesz.autoflash.build.flash_ld=eagle.flash.auto.ld modwifi.menu.eesz.autoflash.build.extra_flags=-DFLASH_MAP_SUPPORT=1 modwifi.menu.eesz.autoflash.upload.maximum_size=1044464 +modwifi.menu.iramfloat.no=in IROM +modwifi.menu.iramfloat.no.build.iramfloat=-DFP_IN_IROM +modwifi.menu.iramfloat.yes=allowed in ISR +modwifi.menu.iramfloat.yes.build.iramfloat=-DFP_IN_IRAM ############################################################## phoenix_v1.name=Phoenix 1.0 @@ -6469,6 +6570,10 @@ phoenix_v1.menu.eesz.autoflash.build.flash_size=16M phoenix_v1.menu.eesz.autoflash.build.flash_ld=eagle.flash.auto.ld phoenix_v1.menu.eesz.autoflash.build.extra_flags=-DFLASH_MAP_SUPPORT=1 phoenix_v1.menu.eesz.autoflash.upload.maximum_size=1044464 +phoenix_v1.menu.iramfloat.no=in IROM +phoenix_v1.menu.iramfloat.no.build.iramfloat=-DFP_IN_IROM +phoenix_v1.menu.iramfloat.yes=allowed in ISR +phoenix_v1.menu.iramfloat.yes.build.iramfloat=-DFP_IN_IRAM ############################################################## phoenix_v2.name=Phoenix 2.0 @@ -6691,6 +6796,10 @@ phoenix_v2.menu.eesz.autoflash.build.flash_size=16M phoenix_v2.menu.eesz.autoflash.build.flash_ld=eagle.flash.auto.ld phoenix_v2.menu.eesz.autoflash.build.extra_flags=-DFLASH_MAP_SUPPORT=1 phoenix_v2.menu.eesz.autoflash.upload.maximum_size=1044464 +phoenix_v2.menu.iramfloat.no=in IROM +phoenix_v2.menu.iramfloat.no.build.iramfloat=-DFP_IN_IROM +phoenix_v2.menu.iramfloat.yes=allowed in ISR +phoenix_v2.menu.iramfloat.yes.build.iramfloat=-DFP_IN_IRAM ############################################################## eduinowifi.name=Schirmilabs Eduino WiFi @@ -6910,6 +7019,10 @@ eduinowifi.menu.eesz.autoflash.build.flash_size=16M eduinowifi.menu.eesz.autoflash.build.flash_ld=eagle.flash.auto.ld eduinowifi.menu.eesz.autoflash.build.extra_flags=-DFLASH_MAP_SUPPORT=1 eduinowifi.menu.eesz.autoflash.upload.maximum_size=1044464 +eduinowifi.menu.iramfloat.no=in IROM +eduinowifi.menu.iramfloat.no.build.iramfloat=-DFP_IN_IROM +eduinowifi.menu.iramfloat.yes=allowed in ISR +eduinowifi.menu.iramfloat.yes.build.iramfloat=-DFP_IN_IRAM ############################################################## wiolink.name=Seeed Wio Link @@ -7129,6 +7242,10 @@ wiolink.menu.eesz.autoflash.build.flash_size=16M wiolink.menu.eesz.autoflash.build.flash_ld=eagle.flash.auto.ld wiolink.menu.eesz.autoflash.build.extra_flags=-DFLASH_MAP_SUPPORT=1 wiolink.menu.eesz.autoflash.upload.maximum_size=1044464 +wiolink.menu.iramfloat.no=in IROM +wiolink.menu.iramfloat.no.build.iramfloat=-DFP_IN_IROM +wiolink.menu.iramfloat.yes=allowed in ISR +wiolink.menu.iramfloat.yes.build.iramfloat=-DFP_IN_IRAM ############################################################## blynk.name=SparkFun Blynk Board @@ -7348,6 +7465,10 @@ blynk.menu.eesz.autoflash.build.flash_size=16M blynk.menu.eesz.autoflash.build.flash_ld=eagle.flash.auto.ld blynk.menu.eesz.autoflash.build.extra_flags=-DFLASH_MAP_SUPPORT=1 blynk.menu.eesz.autoflash.upload.maximum_size=1044464 +blynk.menu.iramfloat.no=in IROM +blynk.menu.iramfloat.no.build.iramfloat=-DFP_IN_IROM +blynk.menu.iramfloat.yes=allowed in ISR +blynk.menu.iramfloat.yes.build.iramfloat=-DFP_IN_IRAM ############################################################## thing.name=SparkFun ESP8266 Thing @@ -7567,6 +7688,10 @@ thing.menu.eesz.autoflash.build.flash_size=16M thing.menu.eesz.autoflash.build.flash_ld=eagle.flash.auto.ld thing.menu.eesz.autoflash.build.extra_flags=-DFLASH_MAP_SUPPORT=1 thing.menu.eesz.autoflash.upload.maximum_size=1044464 +thing.menu.iramfloat.no=in IROM +thing.menu.iramfloat.no.build.iramfloat=-DFP_IN_IROM +thing.menu.iramfloat.yes=allowed in ISR +thing.menu.iramfloat.yes.build.iramfloat=-DFP_IN_IRAM ############################################################## thingdev.name=SparkFun ESP8266 Thing Dev @@ -7786,6 +7911,10 @@ thingdev.menu.eesz.autoflash.build.flash_size=16M thingdev.menu.eesz.autoflash.build.flash_ld=eagle.flash.auto.ld thingdev.menu.eesz.autoflash.build.extra_flags=-DFLASH_MAP_SUPPORT=1 thingdev.menu.eesz.autoflash.upload.maximum_size=1044464 +thingdev.menu.iramfloat.no=in IROM +thingdev.menu.iramfloat.no.build.iramfloat=-DFP_IN_IROM +thingdev.menu.iramfloat.yes=allowed in ISR +thingdev.menu.iramfloat.yes.build.iramfloat=-DFP_IN_IRAM ############################################################## esp210.name=SweetPea ESP-210 @@ -8005,6 +8134,10 @@ esp210.menu.eesz.autoflash.build.flash_size=16M esp210.menu.eesz.autoflash.build.flash_ld=eagle.flash.auto.ld esp210.menu.eesz.autoflash.build.extra_flags=-DFLASH_MAP_SUPPORT=1 esp210.menu.eesz.autoflash.upload.maximum_size=1044464 +esp210.menu.iramfloat.no=in IROM +esp210.menu.iramfloat.no.build.iramfloat=-DFP_IN_IROM +esp210.menu.iramfloat.yes=allowed in ISR +esp210.menu.iramfloat.yes.build.iramfloat=-DFP_IN_IRAM ############################################################## espinotee.name=ThaiEasyElec's ESPino @@ -8224,6 +8357,10 @@ espinotee.menu.eesz.autoflash.build.flash_size=16M espinotee.menu.eesz.autoflash.build.flash_ld=eagle.flash.auto.ld espinotee.menu.eesz.autoflash.build.extra_flags=-DFLASH_MAP_SUPPORT=1 espinotee.menu.eesz.autoflash.upload.maximum_size=1044464 +espinotee.menu.iramfloat.no=in IROM +espinotee.menu.iramfloat.no.build.iramfloat=-DFP_IN_IROM +espinotee.menu.iramfloat.yes=allowed in ISR +espinotee.menu.iramfloat.yes.build.iramfloat=-DFP_IN_IRAM ############################################################## wifi_kit_8.name=WiFi Kit 8 @@ -8443,6 +8580,10 @@ wifi_kit_8.menu.eesz.autoflash.build.flash_size=16M wifi_kit_8.menu.eesz.autoflash.build.flash_ld=eagle.flash.auto.ld wifi_kit_8.menu.eesz.autoflash.build.extra_flags=-DFLASH_MAP_SUPPORT=1 wifi_kit_8.menu.eesz.autoflash.upload.maximum_size=1044464 +wifi_kit_8.menu.iramfloat.no=in IROM +wifi_kit_8.menu.iramfloat.no.build.iramfloat=-DFP_IN_IROM +wifi_kit_8.menu.iramfloat.yes=allowed in ISR +wifi_kit_8.menu.iramfloat.yes.build.iramfloat=-DFP_IN_IRAM ############################################################## wifiduino.name=WiFiduino @@ -8662,6 +8803,10 @@ wifiduino.menu.eesz.autoflash.build.flash_size=16M wifiduino.menu.eesz.autoflash.build.flash_ld=eagle.flash.auto.ld wifiduino.menu.eesz.autoflash.build.extra_flags=-DFLASH_MAP_SUPPORT=1 wifiduino.menu.eesz.autoflash.upload.maximum_size=1044464 +wifiduino.menu.iramfloat.no=in IROM +wifiduino.menu.iramfloat.no.build.iramfloat=-DFP_IN_IROM +wifiduino.menu.iramfloat.yes=allowed in ISR +wifiduino.menu.iramfloat.yes.build.iramfloat=-DFP_IN_IRAM ############################################################## wifinfo.name=WifInfo @@ -8937,6 +9082,10 @@ wifinfo.menu.eesz.autoflash.build.flash_size=16M wifinfo.menu.eesz.autoflash.build.flash_ld=eagle.flash.auto.ld wifinfo.menu.eesz.autoflash.build.extra_flags=-DFLASH_MAP_SUPPORT=1 wifinfo.menu.eesz.autoflash.upload.maximum_size=1044464 +wifinfo.menu.iramfloat.no=in IROM +wifinfo.menu.iramfloat.no.build.iramfloat=-DFP_IN_IROM +wifinfo.menu.iramfloat.yes=allowed in ISR +wifinfo.menu.iramfloat.yes.build.iramfloat=-DFP_IN_IRAM ############################################################## cw01.name=XinaBox CW01 @@ -9159,4 +9308,8 @@ cw01.menu.eesz.autoflash.build.flash_size=16M cw01.menu.eesz.autoflash.build.flash_ld=eagle.flash.auto.ld cw01.menu.eesz.autoflash.build.extra_flags=-DFLASH_MAP_SUPPORT=1 cw01.menu.eesz.autoflash.upload.maximum_size=1044464 +cw01.menu.iramfloat.no=in IROM +cw01.menu.iramfloat.no.build.iramfloat=-DFP_IN_IROM +cw01.menu.iramfloat.yes=allowed in ISR +cw01.menu.iramfloat.yes.build.iramfloat=-DFP_IN_IRAM diff --git a/doc/ideoptions.rst b/doc/ideoptions.rst index f591772548..25fd08defa 100644 --- a/doc/ideoptions.rst +++ b/doc/ideoptions.rst @@ -263,6 +263,12 @@ See our issue tracker in regards to default version selection. Notice that 3.x.x is provided **as-is** and remains **experimental**. +Floating Point operations +~~~~~~~~~~~~~~~~~~~~~~~~~ + +- ``in IROM``: This provides more free space in IRAM but disallows using floating operations inside ISRs. +- ``allowed in ISR``: Floats can be used in ISRs, cost is ~1KB IRAM when floats are used. + SSL Support ~~~~~~~~~~~ diff --git a/package/package_esp8266com_index.template.json b/package/package_esp8266com_index.template.json index e87c6f66ca..323db7081f 100644 --- a/package/package_esp8266com_index.template.json +++ b/package/package_esp8266com_index.template.json @@ -383,4 +383,4 @@ ] } ] -} +} \ No newline at end of file diff --git a/platform.txt b/platform.txt index 7e88e48db5..3ca4ffae29 100644 --- a/platform.txt +++ b/platform.txt @@ -62,6 +62,9 @@ build.spiffs_start= build.spiffs_end= build.spiffs_blocksize= +# soft float location +build.iramfloat=-DFP_IN_IROM + # Fully qualified file names for processing sketch global options globals.h.source.fqfn={build.source.path}/{build.project_name}.globals.h commonhfile.fqfn={build.core.path}/CommonHFile.h @@ -79,7 +82,7 @@ compiler.cpreprocessor.flags=-D__ets__ -DICACHE_FLASH -U__STRICT_ANSI__ -D_GNU_S compiler.libraries.ldflags= compiler.c.cmd=xtensa-lx106-elf-gcc -compiler.c.flags=-c "{compiler.warning_flags}-cflags" -std=gnu17 {build.stacksmash_flags} -g -free -fipa-pta -Werror=return-type -Wpointer-arith -Wno-implicit-function-declaration -Wl,-EL -fno-inline-functions -nostdlib -mlongcalls -mtext-section-literals -falign-functions=4 -MMD -ffunction-sections -fdata-sections {build.exception_flags} {build.sslflags} {build.mmuflags} {build.non32xferflags} +compiler.c.flags=-c "{compiler.warning_flags}-cflags" -std=gnu17 {build.stacksmash_flags} -g -free -fipa-pta -Werror=return-type -Wpointer-arith -Wno-implicit-function-declaration -Wl,-EL -fno-inline-functions -nostdlib -mlongcalls -mtext-section-literals -falign-functions=4 -MMD -ffunction-sections -fdata-sections {build.exception_flags} {build.sslflags} {build.mmuflags} {build.non32xferflags} {build.iramfloat} compiler.S.cmd=xtensa-lx106-elf-gcc compiler.S.flags=-c -g -x assembler-with-cpp -MMD -mlongcalls "-I{runtime.tools.xtensa-lx106-elf-gcc.path}/include/" @@ -90,7 +93,7 @@ compiler.c.elf.cmd=xtensa-lx106-elf-gcc compiler.c.elf.libs=-lhal -lphy -lpp -lnet80211 {build.lwip_lib} -lwpa -lcrypto -lmain -lwps -lbearssl -lespnow -lsmartconfig -lairkiss -lwpa2 {build.stdcpp_lib} -lm -lc -lgcc compiler.cpp.cmd=xtensa-lx106-elf-g++ -compiler.cpp.flags=-c "{compiler.warning_flags}-cppflags" {build.stacksmash_flags} -g -free -fipa-pta -Werror=return-type -mlongcalls -mtext-section-literals -fno-rtti -falign-functions=4 {build.stdcpp_level} -MMD -ffunction-sections -fdata-sections {build.exception_flags} {build.sslflags} {build.mmuflags} {build.non32xferflags} +compiler.cpp.flags=-c "{compiler.warning_flags}-cppflags" {build.stacksmash_flags} -g -free -fipa-pta -Werror=return-type -mlongcalls -mtext-section-literals -fno-rtti -falign-functions=4 {build.stdcpp_level} -MMD -ffunction-sections -fdata-sections {build.exception_flags} {build.sslflags} {build.mmuflags} {build.non32xferflags} {build.iramfloat} compiler.as.cmd=xtensa-lx106-elf-as @@ -128,7 +131,7 @@ recipe.hooks.prebuild.2.pattern="{runtime.tools.python3.path}/python3" -I "{runt recipe.hooks.linking.prelink.1.pattern="{runtime.tools.python3.path}/python3" -I "{runtime.tools.mkdir}" -p "{build.path}/ld_h/" recipe.hooks.linking.prelink.2.pattern="{runtime.tools.python3.path}/python3" -I "{runtime.tools.cp}" "{runtime.platform.path}/tools/sdk/ld/{build.flash_ld}" "{build.path}/ld_h/local.eagle.flash.ld.h" recipe.hooks.linking.prelink.3.pattern="{compiler.path}{compiler.c.cmd}" -CC -E -P {build.vtable_flags} {build.mmuflags} "{build.path}/ld_h/local.eagle.flash.ld.h" -o "{build.path}/local.eagle.flash.ld" -recipe.hooks.linking.prelink.4.pattern="{compiler.path}{compiler.c.cmd}" -CC -E -P {build.vtable_flags} {build.mmuflags} "{runtime.platform.path}/tools/sdk/ld/eagle.app.v6.common.ld.h" -o "{build.path}/local.eagle.app.v6.common.ld" +recipe.hooks.linking.prelink.4.pattern="{compiler.path}{compiler.c.cmd}" {build.iramfloat} -CC -E -P {build.vtable_flags} {build.mmuflags} "{runtime.platform.path}/tools/sdk/ld/eagle.app.v6.common.ld.h" -o "{build.path}/local.eagle.app.v6.common.ld" ## Compile c files recipe.c.o.pattern="{compiler.path}{compiler.c.cmd}" {compiler.cpreprocessor.flags} {compiler.c.flags} -D{build.sdk}=1 -DF_CPU={build.f_cpu} {build.lwip_flags} {build.debug_port} {build.debug_level} -DARDUINO={runtime.ide.version} -DARDUINO_{build.board} -DARDUINO_ARCH_{build.arch} -DARDUINO_BOARD="{build.board}" -DARDUINO_BOARD_ID="{_id}" {build.led} {build.flash_flags} {compiler.c.extra_flags} {build.extra_flags} {includes} "{source_file}" -o "{object_file}" diff --git a/tools/boards.txt.py b/tools/boards.txt.py index 9524bd57c2..681cc0b7b6 100755 --- a/tools/boards.txt.py +++ b/tools/boards.txt.py @@ -1682,6 +1682,17 @@ def sdk (): ################################################################ +def float_in_iram (): + return { 'iramfloat': collections.OrderedDict([ + ('.menu.iramfloat.no', 'in IROM'), + ('.menu.iramfloat.no.build.iramfloat', '-DFP_IN_IROM'), + ('.menu.iramfloat.yes', 'allowed in ISR'), + ('.menu.iramfloat.yes.build.iramfloat', '-DFP_IN_IRAM'), + ]) + } + +################################################################ + def all_boards (): if boardsgen or boardslocalgen: @@ -1709,6 +1720,7 @@ def all_boards (): macros.update(led('led', led_default, range(0,led_max+1))) macros.update(led('led216', 2, { 16 })) macros.update(sdk()) + macros.update(float_in_iram()) if boardfilteropt or excludeboards: print('#') @@ -1754,6 +1766,7 @@ def all_boards (): print('menu.stacksmash=Stack Protection') print('menu.wipe=Erase Flash') print('menu.sdk=NONOS SDK Version') + print('menu.iramfloat=Floating Point operations') print('menu.ssl=SSL Support') print('menu.mmu=MMU') print('menu.non32xfer=Non-32-Bit Access') @@ -1791,6 +1804,7 @@ def all_boards (): macrolist += speeds[default_speed] macrolist += [ 'autoflash' ] + macrolist += [ 'iramfloat' ] for block in macrolist: for optname in macros[block]: diff --git a/tools/platformio-build.py b/tools/platformio-build.py index 83b7d7830a..20fe8c77fb 100644 --- a/tools/platformio-build.py +++ b/tools/platformio-build.py @@ -275,17 +275,23 @@ def scons_patched_match_splitext(path, suffixes=None): # current_vtables = None -fp_in_irom = "" +current_fp = None for d in flatten_cppdefines: if str(d).startswith("VTABLES_IN_"): current_vtables = d - if str(d) == "FP_IN_IROM": - fp_in_irom = "-DFP_IN_IROM" + if str(d).startswith("FP_IN_"): + current_fp = d + if not current_vtables: current_vtables = "VTABLES_IN_FLASH" env.Append(CPPDEFINES=[current_vtables]) assert current_vtables +if not current_fp: + current_fp = "FP_IN_IROM" + env.Append(CPPDEFINES=[current_fp]) +assert current_fp + # # MMU # @@ -363,9 +369,10 @@ def scons_patched_match_splitext(path, suffixes=None): join("$BUILD_DIR", "ld", "local.eagle.app.v6.common.ld"), join(FRAMEWORK_DIR, "tools", "sdk", "ld", "eagle.app.v6.common.ld.h"), env.VerboseAction( - "$CC -CC -E -P -D%s %s %s $SOURCE -o $TARGET" + "$CC -CC -E -P -D%s -D%s %s $SOURCE -o $TARGET" % ( current_vtables, + current_fp, # String representation of MMU flags " ".join( [ @@ -373,7 +380,6 @@ def scons_patched_match_splitext(path, suffixes=None): for f in mmu_flags ] ), - fp_in_irom, ), "Generating LD script $TARGET", ), diff --git a/tools/sdk/ld/eagle.app.v6.common.ld.h b/tools/sdk/ld/eagle.app.v6.common.ld.h index 051ce170e7..e6b415c50b 100644 --- a/tools/sdk/ld/eagle.app.v6.common.ld.h +++ b/tools/sdk/ld/eagle.app.v6.common.ld.h @@ -142,6 +142,16 @@ SECTIONS /* all functional callers are placed in IRAM (including SPI/IRQ callbacks/etc) here */ *(.text._ZNKSt8functionIF*EE*) /* std::function::operator()() const */ + +#ifdef FP_IN_IRAM + *libgcc.a:*f2.o(.literal .text) + *libgcc.a:*f3.o(.literal .text) + *libgcc.a:*fsi.o(.literal .text) + *libgcc.a:*fdi.o(.literal .text) + *libgcc.a:*ifs.o(.literal .text) + *libgcc.a:*idf.o(.literal .text) +#endif + } >iram1_0_seg :iram1_0_phdr .irom0.text : ALIGN(4)