From f262ba5553c01526dc67c83a2888c1a915d6b427 Mon Sep 17 00:00:00 2001 From: Ewoud Date: Thu, 12 Sep 2024 16:32:58 +0200 Subject: [PATCH] Fix for dangerous relocation: l32r: literal target out of range --- platformio.ini | 3 ++- src/User/UserModLive.h | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/platformio.ini b/platformio.ini index 91866c4c..f100bbee 100644 --- a/platformio.ini +++ b/platformio.ini @@ -80,6 +80,8 @@ build_flags = -D VERSION=24091213 ; Date and time (GMT!), update at every commit!! -D LFS_THREADSAFE ; enables use of semaphores in LittleFS driver -D STARBASE_DEVMODE + -mtext-section-literals ;otherwise [UserModLive::setup()]+0xa17): dangerous relocation: l32r: literal target out of range (try using text-section-literals) + ;for StarLight, first only for s2, now for all due to something in UserModLive.Setup... ${ESPAsyncWebServer.build_flags} ;alternatively PsychicHttp ${STARBASE_USERMOD_E131.build_flags} ${STARBASE_USERMOD_MPU6050.build_flags} @@ -175,7 +177,6 @@ platform = espressif32@6.3.0 ; this one behaves better for debugging 6.5.0 is upload_speed = 256000 build_flags = ${env.build_flags} - -mtext-section-literals ;otherwise [UserModLive::setup()]+0xa17): dangerous relocation: l32r: literal target out of range (try using text-section-literals) ; -DARDUINO_ARCH_ESP32 ; no proof of necessity yet... -D CONFIG_IDF_TARGET_ESP32S2=1 -D ARDUINO_USB_CDC_ON_BOOT=1 -D ARDUINO_USB_DFU_ON_BOOT=1 -D ARDUINO_USB_MSC_ON_BOOT=0 ; for debugging over USB diff --git a/src/User/UserModLive.h b/src/User/UserModLive.h index d7f97a96..a6d098a8 100644 --- a/src/User/UserModLive.h +++ b/src/User/UserModLive.h @@ -113,6 +113,8 @@ class UserModLive:public SysModule { void setup() override { SysModule::setup(); + //note: -mtext-section-literals needed in pio.ini, first only for s2, now for all due to something in setup... + parentVar = ui->initUserMod(parentVar, name, 6310); ui->initSelect(parentVar, "script", UINT16_MAX, false , [this](JsonObject var, unsigned8 rowNr, unsigned8 funType) { switch (funType) { //varFun