Error message when compiling
Moderator: Benj
- 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
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
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
- 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
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)
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)
-
- 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
Hi Brian,
For example the ToString$() Function.
The 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
These warnings are when you place the same functions within interrupts as you have got elsewhere within flowchart.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)
For example the ToString$() Function.
The
Code: Select all
sw stack corruption
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
- Steve001
- 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
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
maybe something else to check
Steve
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.
- 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
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
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
-
- 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
Hi Brian,
I can't guarantee 100% I can find the issue, but I can take a look for you.
No a problem.jollybv wrote:i will PM My cod to you as its just about ready for the market if that all right with you
I can't guarantee 100% I can find the issue, but I can take a look for you.
Martin
-
- 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
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?
The corruption message is referring to the input that's within Getkey interrupt macro.
Would you be able to find an alternative location?
Martin
-
- 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
I will report the issue this morning and see of the team at matrix can find a way around it.
Martin
Martin
Martin
- 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
Hi! Martin
Thanks for those notes, you are too good at solving problems, cheers...
Regards
Abhi
Thanks for those notes, you are too good at solving problems, cheers...
Regards
Abhi
- 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
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
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
-
- 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
Hi Brian,
Is where the previous line was say a Case statement which was TRUE.
Therefor a command was accessed which cause the CASE statements to be exited before the next CASE statement which caused the error you see.
For example:
Since 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:
Have you looked on previous line to 10355?
Nothing to worry about at all!jollybv wrote:(345) unreachable code (warning)
Is where the previous line was say a Case statement which was TRUE.
Therefor a
Code: Select all
break
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
Code: Select all
if Count = 3
Code: Select all
If count = 3 then do something : goto exit
Martin
- 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
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
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
- 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
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
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
- 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
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.
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.
- 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
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??
Where will i find the tick box to uncheck
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
- 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
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.
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.
This is slightly worrying, probably being caused by an input icon in your main loop and also in your interrupt code.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
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);
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
- 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
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
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
- 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
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.
If the variable was instead a global variable then the code would change to look like this.
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.
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;
Code: Select all
trisd = trisd | 0x0F;
FCV_VAR = portd & 0x0F;
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
- 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
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
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
- 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
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;
trisd = trisd | 0x0F;
FCL_VAR = portd & 0x0F;
trisd = trisd | 0x0F;
FCV_VAR = portd & 0x0F;
- 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
Hello,
FCV_ = Global
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.Is this correct
FCL_ = LocalI also do not see any difference between the too as my var is global
FCV_ = Global
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
- 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
Thanks Ben
My eyes are getting bad now compiling without any error messages
My eyes are getting bad now compiling without any error messages
- 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
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 .
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 .