Help with string error

Use this section to discuss your embedded Flowcode projects.
Post Reply
aderito
Posts: 35
http://meble-kuchenne.info.pl
Joined: Sun Jan 29, 2023 12:49 pm
Location: portugal
Has thanked: 16 times
Been thanked: 2 times

Help with string error

Post 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.
Attachments
display_app.fcm
(11.21 KiB) Downloaded 8 times

BenR
Matrix Staff
Posts: 2171
Joined: Mon Dec 07, 2020 10:06 am
Has thanked: 592 times
Been thanked: 780 times

Re: Help with string error

Post 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

aderito
Posts: 35
Joined: Sun Jan 29, 2023 12:49 pm
Location: portugal
Has thanked: 16 times
Been thanked: 2 times

Re: Help with string error

Post by aderito »

Thank you for your reply. The project is a bit extensive, but I'll post it here anyway.
Attachments
local V8HMI DS18B20.fcfx
(1.51 MiB) Downloaded 7 times

Steve-Matrix
Matrix Staff
Posts: 1844
Joined: Sat Dec 05, 2020 10:32 am
Has thanked: 268 times
Been thanked: 432 times

Re: Help with string error

Post 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

Post Reply