Page 1 of 1

undefined reference error

Posted: Thu Nov 23, 2017 5:31 pm
by stefan.erni
Hi Ben

Strange Problem.
I insert some C-Code. sometimes it's working, somtimes not. I don't now what is wrong in the few commands.
Is there something I'm doing wrong?

/*
Enter C code below this comment
*/
FCD_0e742_PWDN_ADS__TurnOn();
// Call Component Macro: RESET_ADS::TurnOn()
FCD_0e743_RESET_ADS__TurnOn();
// Delay: 500 ms
FCI_DELAYINT_MS(500);
// Call Component Macro: CS_ADS::TurnOff()
FCD_0e743_RESET_ADS__TurnOff();
// Call Component Macro: SPI_ADS99::SendChar(.wakeup)
FCD_06c41_SPI_ADS99__SendChar(FCL_WAKEUP);





C:\C#SOUR~1\_#FC\EMG5er\Flowcode_Emg_5er_main1.o(.text+0x590):C:\C#SOUR~1\_#FC\EMG5er\Flowcode_Emg_5er_main1.c: undefined reference to `FCD_06c41_SPI_ADS99__SendChar'

Re: undefined reference error

Posted: Fri Nov 24, 2017 11:36 am
by Benj
Hello,

The problem is likely the function prefixes.

e.g.
FCD_0e742_
FCD_0e743_

Flowcode creates these so they are unique and so you can have multiple of the same component in your project without them causing problems with each other.

Check that these prefixes are correct in the projects that are not compiling and that should solve the problem for you.

Re: undefined reference error

Posted: Fri Nov 24, 2017 1:45 pm
by stefan.erni
Hi Ben

I have to import a lot of c code and change it to FC7 conform.
It's mostly sending a constants or variables to the spi_out.
the constants I creat it one by one and ad the hex Value......
But can I use C code with copy/paste for sending like
FCD_06c41_SPI_ADS99__SendChar(FCL_WAKEUP);
FCD_06c41_SPI_ADS99__SendChar(FCL_CH1SET);
Constants.PNG
(11.26 KiB) Downloaded 2050 times

Re: undefined reference error

Posted: Fri Nov 24, 2017 2:00 pm
by LeighM
Hi,
You are best calling Flowcode macros from an icon, but if you want to cut'n'paste lines, as in C, then you can put the calls into a calculation icon...
calc_box.jpg
calc_box.jpg (40.65 KiB) Viewed 4426 times

Re: undefined reference error

Posted: Fri Nov 24, 2017 2:28 pm
by stefan.erni
Hi Leigh

Perfect. "put the calls into a calculation Icon"
That what I'm looking for. It's working
The calculation Icon I use anyway. So my Flowcode now is very comfortable to use and read....

Re: undefined reference error

Posted: Fri Nov 24, 2017 3:13 pm
by stefan.erni
Hi Leigh
Thank you for the additional infos. Just for an info. More or less the same code.
Compare the first Pictures with all with Icon's and the second Pictures with variables and constants and the call's in calculation Icon.
That's really nice in Flowcode.
b4.PNG
(45.99 KiB) Downloaded 2044 times
b4_a.PNG
(9.77 KiB) Downloaded 2044 times

Re: undefined reference error

Posted: Fri Nov 24, 2017 4:32 pm
by LeighM
You might also like to know that you can drag and drop component functions (macros) into the calculation box in the same way that you can with variables..
calc_drag_drop.jpg
calc_drag_drop.jpg (52.12 KiB) Viewed 4416 times