Page 1 of 1

Help with string error

Posted: Mon Apr 20, 2026 10:11 am
by aderito
Hello, I'm here to ask for help in trying to solve a problem I'm having in a project with a dspic33EV256GM006. I recently added a calculation icon to add several variables (strings) into one, and then send it via UART to another system. After a few attempts (Link Error: PC Relative branch to '___delay32' is out of range. Suggest large-code model.
) I realized I couldn't do something like: "string1 = string1 + string2" several times within the calculation. The intention was to sum the variables until finally sending them via UART. Then I tried sending them one by one through the component macro and it continued to give the same error. Of course, before doing that I deleted the calculation icon I had built earlier. If anyone here can help me, I would appreciate it.

Re: Help with string error

Posted: Mon Apr 20, 2026 11:11 am
by BenR
Hello,

I've tried to put togeter a simple test with your macro and the chip you specified, but it's compiling ok here.

You might need to attach your project so we can replicate exactly what you have.

FC_Test.fcfx
(18.71 KiB) Downloaded 7 times

Re: Help with string error

Posted: Mon Apr 20, 2026 11:21 am
by aderito
Thank you for your reply. The project is a bit extensive, but I'll post it here anyway.

Re: Help with string error

Posted: Mon Apr 20, 2026 2:57 pm
by Steve-Matrix
It looks like your project is very large and the compiler fails to compile the code because the call for a delay icon and the actual code for that delay call are too far away from each other.

You could try to reduce the size of your project by removing unnecessary macros and combining duplicate code where possible.

Alternatively, you could try using the "-mlarge-code" command line switch on the compiler. This is done in the "pic16_C30_compLarge.bat" file and instructions for this are in our old forum here:
https://flowcode.co.uk/mmforums/viewtopic.php?t=21926