Error message when compiling

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 6.

Moderator: Benj

User avatar
jollybv
Flowcode v5 User
Posts: 374
Joined: Thu Feb 12, 2009 5:20 am
Location: Cape Town
Has thanked: 81 times
Been thanked: 25 times
Contact:

Error message when compiling

Post by jollybv »

Hi guys

Can anyone tell me why im getting this message ....Internal Error: Trying to add bank switching for var that has no memory allocated:'$ret' ('CompTempVarRet2637',0x100027B8)... if i go to this line in the line 2637 in View C i get this .....2637 MX_UINT16 FCL_IDX; ....dont know what is going on .

Brian

User avatar
jollybv
Flowcode v5 User
Posts: 374
Joined: Thu Feb 12, 2009 5:20 am
Location: Cape Town
Has thanked: 81 times
Been thanked: 25 times
Contact:

Re: Error message when compiling

Post by jollybv »

Hi Guys

Is there any one out there who can tell me what these error's mean

Serious Warning: Possible sw stack corruption, function 'FC_CAL_Port_In_DDR__x' called by more than one asynchronous thread (main/Task, interrupt, interrupt low)
Serious Warning: Possible sw stack corruption, function 'FCI_TOSTRING' called by more than one asynchronous thread (main/Task, interrupt, interrupt low)

medelec35
Matrix Staff
Posts: 9520
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2585 times
Been thanked: 3815 times
Contact:

Re: Error message when compiling

Post by medelec35 »

Hi Brian,
jollybv wrote:Serious Warning: Possible sw stack corruption, function 'FC_CAL_Port_In_DDR__x' called by more than one asynchronous thread (main/Task, interrupt, interrupt low)
Serious Warning: Possible sw stack corruption, function 'FCI_TOSTRING' called by more than one asynchronous thread (main/Task, interrupt, interrupt low)
These warnings are when you place the same functions within interrupts as you have got elsewhere within flowchart.
For example the ToString$() Function.
The

Code: Select all

sw stack corruption
warnings can't be ignored!
Only options I can think of are:
1) Remove offending function from interrupt and access function by setting a flag within interrupt, then within main a decision branch If Flag =1 then flag = 0: ToString$(), LCD, Delay function etc.

2) Make sure 100% that the interrupt can't be triggered while within the non interrupt ToString$() function


As for error meaasges, just stating error message is not usually enough.
To try and resolve issue, it's normally better to include Flowchart as well.

Martin
Martin

User avatar
Steve001
Valued Contributor
Valued Contributor
Posts: 1189
Joined: Wed Dec 31, 2008 3:37 pm
Has thanked: 460 times
Been thanked: 523 times
Contact:

Re: Error message when compiling

Post by Steve001 »

Hi,

I also had a similar error message within flowcode 3 ( not sure if the same applies here tho ) I had a Timer 0 calculation that was trying to divide by zero and my macro was too long

Also from steve tandy
Steve wrote:I've seen issues like this when the interrupt routine is doing far too much than is generally recommended. For efficiency, your interrupt routine should be as short as possible. Anything that will take more than a few milliseconds to perform (e.g. output to an LCD) should occur in the main program loop.

maybe something else to check

Steve
Success always occurs in private and failure in full view.

User avatar
jollybv
Flowcode v5 User
Posts: 374
Joined: Thu Feb 12, 2009 5:20 am
Location: Cape Town
Has thanked: 81 times
Been thanked: 25 times
Contact:

Re: Error message when compiling

Post by jollybv »

HI Martian

Thanks i was able to remove the ToString fault but the other one 'FC_CAL_Port_In_DDR__x' i cant seem to find whats causing it i will PM My cod to you as its just about ready for the market if that all right with you

medelec35
Matrix Staff
Posts: 9520
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2585 times
Been thanked: 3815 times
Contact:

Re: Error message when compiling

Post by medelec35 »

Hi Brian,
jollybv wrote:i will PM My cod to you as its just about ready for the market if that all right with you
No a problem.
I can't guarantee 100% I can find the issue, but I can take a look for you.
Martin

medelec35
Matrix Staff
Posts: 9520
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2585 times
Been thanked: 3815 times
Contact:

Re: Error message when compiling

Post by medelec35 »

Hi Brian,
The corruption message is referring to the input that's within Getkey interrupt macro.
Would you be able to find an alternative location?
Martin

User avatar
jollybv
Flowcode v5 User
Posts: 374
Joined: Thu Feb 12, 2009 5:20 am
Location: Cape Town
Has thanked: 81 times
Been thanked: 25 times
Contact:

Re: Error message when compiling

Post by jollybv »

Hi Martin
Not sure what to do should I make another macro or what

medelec35
Matrix Staff
Posts: 9520
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2585 times
Been thanked: 3815 times
Contact:

Re: Error message when compiling

Post by medelec35 »

I will report the issue this morning and see of the team at matrix can find a way around it.

Martin
Martin

User avatar
jollybv
Flowcode v5 User
Posts: 374
Joined: Thu Feb 12, 2009 5:20 am
Location: Cape Town
Has thanked: 81 times
Been thanked: 25 times
Contact:

Re: Error message when compiling

Post by jollybv »

Hi Martin

Thanks for your help will wait and see what they say

User avatar
AbhijitR
Posts: 299
Joined: Fri Nov 07, 2014 12:48 pm
Location: Pune, India
Has thanked: 280 times
Been thanked: 79 times
Contact:

Re: Error message when compiling

Post by AbhijitR »

Hi! Martin

Thanks for those notes, you are too good at solving problems, cheers...

Regards
Abhi

User avatar
jollybv
Flowcode v5 User
Posts: 374
Joined: Thu Feb 12, 2009 5:20 am
Location: Cape Town
Has thanked: 81 times
Been thanked: 25 times
Contact:

Re: Error message when compiling

Post by jollybv »

Hi guys

quick question im getting the following message when i compile in V7

E-P_I2CU2E0V46-PIC18F47J13_GSM24LC256K_Bit_48Mhz.c: main()
10355: break;
^ (345) unreachable code (warning)

How would i find out what is causing the problem i have opened the assembler file in notepad but can see anything at this location any ideas

medelec35
Matrix Staff
Posts: 9520
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2585 times
Been thanked: 3815 times
Contact:

Re: Error message when compiling

Post by medelec35 »

Hi Brian,
jollybv wrote:(345) unreachable code (warning)
Nothing to worry about at all!
Is where the previous line was say a Case statement which was TRUE.
Therefor a

Code: Select all

break 
command was accessed which cause the CASE statements to be exited before the next CASE statement which caused the error you see.

For example:

Code: Select all

Count = 2
If count = 1 then do something: goto exit
If count = 2 then do something : goto exit
If count = 3 then do something : goto exit

exit: do something else
Since

Code: Select all

 if Count = 3
will not be accessed as program has exited in the statement above it then the warning will be pointing to the line of code that has:

Code: Select all

If count = 3 then do something : goto exit
Have you looked on previous line to 10355?
Martin

User avatar
jollybv
Flowcode v5 User
Posts: 374
Joined: Thu Feb 12, 2009 5:20 am
Location: Cape Town
Has thanked: 81 times
Been thanked: 25 times
Contact:

Re: Error message when compiling

Post by jollybv »

Hi Martin

Thanks for explanation that is exactly what it is doing sitting in a loop then jumping out if a button is pushed or it waits for a count to = 4 then exit

User avatar
jollybv
Flowcode v5 User
Posts: 374
Joined: Thu Feb 12, 2009 5:20 am
Location: Cape Town
Has thanked: 81 times
Been thanked: 25 times
Contact:

Re: Error message when compiling

Post by jollybv »

Hi Guys

I'm getting this message when compiling and have no clue why

C:\Program Files\Flowcode 7\CAL\PIC\PIC_CAL_String.c: 908: non-reentrant function "_FCI_SCOPY" appears in multiple call graphs and has been duplicated by the compiler

Can someone please explain and is it a critical message

User avatar
LeighM
Matrix Staff
Posts: 2178
Joined: Tue Jan 17, 2012 10:07 am
Has thanked: 481 times
Been thanked: 699 times
Contact:

Re: Error message when compiling

Post by LeighM »

Hi,
Most likely due to, as mentioned earlier, code in an interrupt.
Flowcode functions are non-reentrant, which means they cannot be called from within themselves, such as on an interrupt.
Also it is best to avoid calling other macros within an interrupt and also ensure that any string parameters do not have "Make a local copy of the value" ticked.

User avatar
jollybv
Flowcode v5 User
Posts: 374
Joined: Thu Feb 12, 2009 5:20 am
Location: Cape Town
Has thanked: 81 times
Been thanked: 25 times
Contact:

Re: Error message when compiling

Post by jollybv »

Hi Leigh

Thanks for that i seem to have sorted that out in the program, now I have another error in my other program which i think is similar.

C:\Program Files\Flowcode 7\CAL\PIC\PIC_CAL_IO.c: 83: non-reentrant function "_FC_CAL_Port_In_DDR__x" appears in multiple call graphs and has been duplicated by the compiler

The program is running fine should i worry about this error??
LeighM wrote:ensure that any string parameters do not have "Make a local copy of the value" ticked.


Where will i find the tick box to uncheck

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: Error message when compiling

Post by Benj »

This is the tickbox to look out for, note it only applies to String variables used as macro parameters. We always untick unless it's absolutely necessary. For some reason the default state is ticked.
StrVar.jpg
StrVar.jpg (63.42 KiB) Viewed 17782 times
C:\Program Files\Flowcode 7\CAL\PIC\PIC_CAL_IO.c: 83: non-reentrant function "_FC_CAL_Port_In_DDR__x" appears in multiple call graphs and has been duplicated by the compiler
This is slightly worrying, probably being caused by an input icon in your main loop and also in your interrupt code.

To completely remove the issue it might be worth using C code to read the input in the interrupt to ensure your not going to corrupt the main program code.

for example if you are reading port b bit 0 and passing to Flowcode local variable input then the C would look like this.

Code: Select all

FCL_INPUT = test_bit(portb, 0);

User avatar
jollybv
Flowcode v5 User
Posts: 374
Joined: Thu Feb 12, 2009 5:20 am
Location: Cape Town
Has thanked: 81 times
Been thanked: 25 times
Contact:

Re: Error message when compiling

Post by jollybv »

Hi Ben

Thanks Yes i do have an interrupt that reads port D bits 0, 1, 2, 3 every time there is an interrupt on INT0 so how will i do this in C as i have no clue to code in C

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: Error message when compiling

Post by Benj »

Hello,

It would be something like this if your variable name was called var, it was local to the macro and you want all 4 bits to be stored into the same variable in bits 0-3.

Code: Select all

trisd = trisd | 0x0F;
FCL_VAR = portd & 0x0F;
If the variable was instead a global variable then the code would change to look like this.

Code: Select all

trisd = trisd | 0x0F;
FCV_VAR = portd & 0x0F;
Note that the C code won't simulate so I would only worry about this if you're creating say a commercial product or something else that needs to be 100% perfect and rock solid reliable.

User avatar
jollybv
Flowcode v5 User
Posts: 374
Joined: Thu Feb 12, 2009 5:20 am
Location: Cape Town
Has thanked: 81 times
Been thanked: 25 times
Contact:

Re: Error message when compiling

Post by jollybv »

Hi Ben

yes this is a commercial product and it needs to be solid in the field have had issues with it going down so need to sort it and this is the last error that is reported so lets hope it sorts the problem. Is this correct
/*
Check Port D 0,1,2,3
*/
trisd = trisd | 0x0F;
FCV_KEY = portd & 0x0F;

because it is giving me unreachable code error

User avatar
jollybv
Flowcode v5 User
Posts: 374
Joined: Thu Feb 12, 2009 5:20 am
Location: Cape Town
Has thanked: 81 times
Been thanked: 25 times
Contact:

Re: Error message when compiling

Post by jollybv »

I also do not see any difference between the too as my var is global

trisd = trisd | 0x0F;
FCL_VAR = portd & 0x0F;

trisd = trisd | 0x0F;
FCV_VAR = portd & 0x0F;

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: Error message when compiling

Post by Benj »

Hello,
Is this correct
Yes it looks correct to me, unreachable code usually happens when you have a return from a function with code after the return or a decision containing a constant with code in the opposing branch. Do you want to PM me the file and I'll take a quick look for you.
I also do not see any difference between the too as my var is global
FCL_ = Local
FCV_ = Global

User avatar
jollybv
Flowcode v5 User
Posts: 374
Joined: Thu Feb 12, 2009 5:20 am
Location: Cape Town
Has thanked: 81 times
Been thanked: 25 times
Contact:

Re: Error message when compiling

Post by jollybv »

Thanks Ben

My eyes are getting bad :shock: now compiling without any error messages :D

User avatar
jollybv
Flowcode v5 User
Posts: 374
Joined: Thu Feb 12, 2009 5:20 am
Location: Cape Town
Has thanked: 81 times
Been thanked: 25 times
Contact:

Re: Error message when compiling

Post by jollybv »

Hi guys

Can any one please tell me what the problem is here


0: (1347) can't find 0xE words (0xe withtotal) for psect "text65" in class "CODE" (largest unused contiguous range 0x4)
0: (1347) can't find 0xE words (0xe withtotal) for psect "text69" in class "CODE" (largest unused contiguous range 0x4)
0: (1347) can't find 0xC words (0xc withtotal) for psect "text8" in class "CODE" (largest unused contiguous range 0x4)
0: (1347) can't find 0xA words (0xa withtotal) for psect "text66" in class "CODE" (largest unused contiguous range 0x4)
0: (1347) can't find 0xA words (0xa withtotal) for psect "text70" in class "CODE" (largest unused contiguous range 0x4)
0: (1347) can't find 0x8 words (0x8 withtotal) for psect "text7" in class "CODE" (largest unused contiguous range 0x4)
0: (1347) can't find 0x6 words (0x6 withtotal) for psect "idataBANK0" in class "CODE" (largest unused contiguous range 0x4)
0: (1347) can't find 0x6 words (0x6 withtotal) for psect "text76" in class "CODE" (largest unused contiguous range 0x4)
0: (1347) can't find 0x6 words (0x6 withtotal) for psect "text78" in class "CODE" (largest unused contiguous range 0x4)
(908) exit status = 1
(908) exit status = 1

C:\Program Files\Flowcode 7\compilers\pic\bin\xc8.exe reported error code 1

What i did is copy and past from one program to another then this comes up when i try compile. If i go through the program i cant find any errors if i disable the icons that i copied then it compiles :? .

Post Reply