Faced an interesting issue. Have a project with 8 analog sensors, 8 relays, lcd screen and some additional stuff. Code happened to be large and originally suited for mega2560 (xod itself takes like 30s-60s to link outputs to inputs, but that is not critical). Now I want to add wifi capability, so i decided to move from mega to ESP32.
I have changed specific nodes that differ, but started getting strange compilation errors. By deleting parts of the project I managed to track the issue down to the number of links used. Attached file has 1 link too many and get compilation error. Any additional links get similar additional errors.
Any ideas on reason for this?
Error log and xodball attached compiler-log.txt (900 Bytes) geliu laistymas ESP32 V0.1.xodball (1.0 MB)
What do you mean by “links”? The wires between nodes? If you delete one link and compile, what does Compiler tab show for memory usage? My guess would be that ESP32 has less memory than mega and you are running out of either code space or variable space.
Yes, by links I mean wires between nodes. Working number of links compiles like that:
Begin compiling code for the board DOIT ESP32 DEVKIT V1 📦
Sketch uses 612073 bytes (46%) of program storage space. Maximum is 1310720 bytes.
Global variables use 32552 bytes (9%) of dynamic memory, leaving 295128 bytes for local variables. Maximum is 327680 bytes.
If I add one more link i get these errors (tried different links in different places of the code, behavior is the same)
Begin compiling code for the board DOIT ESP32 DEVKIT V1 📦
C:\Users\mino\AppData\Local\Temp\arduino-sketch-66C04C6D75E9B131A316734BF05B2D53\sketch\xod_1724095305531_sketch.ino.cpp.o: in function `xod::runTransaction()':
C:\Users\mino\AppData\Local\Temp\xod_temp_sketchbookopvzX6\xod_1724095305531_sketch/xod_1724095305531_sketch.ino:86847:(.text._ZN3xod14runTransactionEv+0x3e288): dangerous relocation: l32r: literal target out of range (try using text-section-literals): (.literal._ZN3xod14runTransactionEv+0x4)
C:\Users\mino\AppData\Local\Temp\xod_temp_sketchbookopvzX6\xod_1724095305531_sketch/xod_1724095305531_sketch.ino:86894:(.text._ZN3xod14runTransactionEv+0x3e2f6): dangerous relocation: l32r: literal target out of range (try using text-section-literals): (.literal._ZN3xod14runTransactionEv+0x4)
C:\Users\mino\AppData\Local\Temp\xod_temp_sketchbookopvzX6\xod_1724095305531_sketch/xod_1724095305531_sketch.ino:87020:(.text._ZN3xod14runTransactionEv+0x3e3ed): dangerous relocation: l32r: literal target out of range (try using text-section-literals): (.literal._ZN3xod14runTransactionEv+0x208)
C:\Users\mino\AppData\Local\Temp\xod_temp_sketchbookopvzX6\xod_1724095305531_sketch/xod_1724095305531_sketch.ino:87027:(.text._ZN3xod14runTransactionEv+0x3e3f6): dangerous relocation: l32r: literal target out of range (try using text-section-literals): (.literal._ZN3xod14runTransactionEv+0x210)
C:\Users\mino\AppData\Local\Temp\xod_temp_sketchbookopvzX6\xod_1724095305531_sketch/xod_1724095305531_sketch.ino:87033:(.text._ZN3xod14runTransactionEv+0x3e401): dangerous relocation: l32r: literal target out of range (try using text-section-literals): (.literal._ZN3xod14runTransactionEv+0x114)
collect2.exe: error: ld returned 1 exit status
Error during build: exit status 1
Compilation failed
Command Process exited with code 1
Well…it is not just a memory limitation. There are a bunch of hits for that error on esp32.com in google search, but my work computer won’t let me access the discussion groups. They might provide clues as to why XOD is giving this error…the error is coming from same compiler used by Arduino IDE. XOD is just a wrapper to turn the graphical code into Arduino IDE code.