Corruption Query

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

Moderator: Benj

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

Corruption Query

Post by medelec35 »

I created a test flowchart that would trigger a corruption warning with Flowcode V6:

Code: Select all

Launching the linker/assembler...
C:\Program Files (x86)\Flowcode 6\compilers\pic\boostc\boostlink_picmicro.exe  -ld "C:\Program Files (x86)\Flowcode 6\compilers\pic\boostc\lib" libc_16F.lib rand_16F.lib float_16F.lib "Corruption Test.obj" -t PIC16F1937 -d "C:\Users\Martin\DOWNLO~1" -p "Corruption Test" -swcs 6 2
BoostLink Optimizing Linker Version 7.20
http://www.sourceboost.com
Copyright(C) 2004-2013 Pavel Baranov
Copyright(C) 2004-2013 David Hobday


Caution: argument of 'delay_us' calls must have a value of 1 or more
Caution: Delay inaccurrate: 'delay_us', Delay overhead:0ms, Unit delay:0.00101725ms, Delay resolution:1 units
Caution: Delay inaccurrate: 'delay_ms', Delay overhead:0ms, Unit delay:1.00016ms, Delay resolution:1 units
Warning unreferenced functions removed:
	 FC_CAL_Port_In__x	 in: C:\Program Files (x86)\Flowcode 6\CAL\PIC\PIC_CAL_IO.c
	 FC_CAL_Port_Out__x	 in: C:\Program Files (x86)\Flowcode 6\CAL\PIC\PIC_CAL_IO.c
	 FC_CAL_Port_Out_DDR__x	 in: C:\Program Files (x86)\Flowcode 6\CAL\PIC\PIC_CAL_IO.c
	 Wdt_Delay_S	 in: C:\Program Files (x86)\Flowcode 6\CAL\PIC\PIC_CAL_Delay.c
	 Wdt_Delay_Ms	 in: C:\Program Files (x86)\Flowcode 6\CAL\PIC\PIC_CAL_Delay.c
	 FCI_DELAYINT_US	 in: C:\Program Files (x86)\Flowcode 6\CAL\PIC\PIC_CAL_Delay.c
	 FCI_DELAYINT_MS	 in: C:\Program Files (x86)\Flowcode 6\CAL\PIC\PIC_CAL_Delay.c
	 FCI_DELAYINTWDT_MS	 in: C:\Program Files (x86)\Flowcode 6\CAL\PIC\PIC_CAL_Delay.c
	 FCI_DELAYINT_S	 in: C:\Program Files (x86)\Flowcode 6\CAL\PIC\PIC_CAL_Delay.c
	 FCI_DELAYINTWDT_S	 in: C:\Program Files (x86)\Flowcode 6\CAL\PIC\PIC_CAL_Delay.c
	 FCI_GETCHAR	 in: C:\Program Files (x86)\Flowcode 6\CAL\PIC\PIC_CAL_String.c
	 FCI_MIDSTRING	 in: C:\Program Files (x86)\Flowcode 6\CAL\PIC\PIC_CAL_String.c
	 FCI_LEFTSTRING	 in: C:\Program Files (x86)\Flowcode 6\CAL\PIC\PIC_CAL_String.c
	 FCI_RIGHTSTRING	 in: C:\Program Files (x86)\Flowcode 6\CAL\PIC\PIC_CAL_String.c
	 FCI_TOSTRS16	 in: C:\Program Files (x86)\Flowcode 6\CAL\PIC\PIC_CAL_String.c
	 FCI_TOSTRS32	 in: C:\Program Files (x86)\Flowcode 6\CAL\PIC\PIC_CAL_String.c
	 FCI_TOSTRU16	 in: C:\Program Files (x86)\Flowcode 6\CAL\PIC\PIC_CAL_String.c
	 FCI_TOSTRU32	 in: C:\Program Files (x86)\Flowcode 6\CAL\PIC\PIC_CAL_String.c
	 FCI_TOLOWER	 in: C:\Program Files (x86)\Flowcode 6\CAL\PIC\PIC_CAL_String.c
	 FCI_TOUPPER	 in: C:\Program Files (x86)\Flowcode 6\CAL\PIC\PIC_CAL_String.c
	 FCI_COMPARE	 in: C:\Program Files (x86)\Flowcode 6\CAL\PIC\PIC_CAL_String.c
	 FCI_FLOAT_TO_STRING	 in: C:\Program Files (x86)\Flowcode 6\CAL\PIC\PIC_CAL_String.c
	 FCI_NUMBER_TO_HEX	 in: C:\Program Files (x86)\Flowcode 6\CAL\PIC\PIC_CAL_String.c
	 FCI_STRING_TO_INT	 in: C:\Program Files (x86)\Flowcode 6\CAL\PIC\PIC_CAL_String.c
	 FCI_STRING_TO_FLOAT	 in: C:\Program Files (x86)\Flowcode 6\CAL\PIC\PIC_CAL_String.c
	 FCI_STRREV	 in: C:\Program Files (x86)\Flowcode 6\CAL\PIC\PIC_CAL_String.c
	 FCI_STRMOV	 in: C:\Program Files (x86)\Flowcode 6\CAL\PIC\PIC_CAL_String.c
	 FCI_SHEAD	 in: C:\Program Files (x86)\Flowcode 6\CAL\PIC\PIC_CAL_String.c
	 FCI_SCOPY	 in: C:\Program Files (x86)\Flowcode 6\CAL\PIC\PIC_CAL_String.c
	 isinf	 in: C:\Program Files (x86)\Flowcode 6\CAL\PIC\PIC_CAL_Float.c
	 pow	 in: C:\Program Files (x86)\Flowcode 6\CAL\PIC\PIC_CAL_Float.c
	 flt_round	 in: C:\Program Files (x86)\Flowcode 6\CAL\PIC\PIC_CAL_Float.c
	 flt_floor	 in: C:\Program Files (x86)\Flowcode 6\CAL\PIC\PIC_CAL_Float.c
	 flt_ceil	 in: C:\Program Files (x86)\Flowcode 6\CAL\PIC\PIC_CAL_Float.c
	 flt_atan	 in: C:\Program Files (x86)\Flowcode 6\CAL\PIC\PIC_CAL_Float.c
	 cos	 in: C:\Program Files (x86)\Flowcode 6\CAL\PIC\PIC_CAL_Float.c
	 sin	 in: C:\Program Files (x86)\Flowcode 6\CAL\PIC\PIC_CAL_Float.c
	 tan	 in: C:\Program Files (x86)\Flowcode 6\CAL\PIC\PIC_CAL_Float.c
	 FCD_04071_LCD__PrintAscii	 in: C:\Users\Martin\DOWNLO~1\Corruption Test.c
	 FCD_04071_LCD__RAMWrite	 in: C:\Users\Martin\DOWNLO~1\Corruption Test.c
	 FCD_04071_LCD__ClearLine	 in: C:\Users\Martin\DOWNLO~1\Corruption Test.c
	 FCD_04071_LCD__Command	 in: C:\Users\Martin\DOWNLO~1\Corruption Test.c
	 FCD_04071_LCD__PrintFormattedNumber	 in: C:\Users\Martin\DOWNLO~1\Corruption Test.c
	 FCD_04071_LCD__ScrollDisplay	 in: C:\Users\Martin\DOWNLO~1\Corruption Test.c

Building CASM file
Serious Warning: Possible sw stack corruption, function '__rem_16_16' called by more than one asynchronous thread (main/Task, interrupt, interrupt low)
Serious Warning: Possible sw stack corruption, function 'FCD_04071_LCD__Cursor' called by more than one asynchronous thread (main/Task, interrupt, interrupt low)
Serious Warning: Possible sw stack corruption, function 'FCD_04071_LCD__PrintNumber' called by more than one asynchronous thread (main/Task, interrupt, interrupt low)
Memory Usage Report
===================
RAM available:512 bytes, used:104 bytes (20.4%), free:408 bytes (79.6%), 
Heap size:320 bytes, Heap max single alloc:79 bytes
ROM available:8192 words, used:1410 words (17.3%), free:6782 words (82.7%)



success
The same flowchart loaded in V7:

Code: Select all

Launching the compiler...
C:\Program Files (x86)\Flowcode 7\compilers\pic\bin\xc8.exe  --chip=16F1937 "Corruption Test.c" --MSGDISABLE=359,1273,1388
Corruption Test.c: 184: (1257) local variable "_FCD_04071_LCD__PrintNumber" is used but never given a value (warning)
...

Memory Summary:
    Program space        used   A79h (  2681) of  2000h words   ( 32.7%)
    Data space           used    89h (   137) of   200h bytes   ( 26.8%)
    EEPROM space         used     0h (     0) of   100h bytes   (  0.0%)
    Data stack space     used     0h (     0) of   16Ah bytes   (  0.0%)
    Configuration bits   used     2h (     2) of     2h words   (100.0%)
    ID Location space    used     0h (     0) of     4h bytes   (  0.0%)

Microchip MPLAB XC8 C Compiler (Free Mode) V1.36
Build date: Jan 14 2016
Part Support Version: 1.36
Copyright (C) 2016 Microchip Technology Inc.
License type: Node Configuration


You have compiled in FREE mode.
Using Omnicient Code Generation that is available in PRO mode,
you could have produced up to 60% smaller and 400% faster code.
See http://www.microchip.com/MPLABXCcompilers for more information.


Launching the linker/assembler...
C:\Program Files (x86)\Flowcode 7\tools\DoNothing\DoNothing.exe  


FINISHED
Does this mean with V7 their will not be any corruption or the corruption could occur but we are not warned about the possibility?

Martin
Attachments
Corruption Test.fcfx
(7.96 KiB) Downloaded 239 times
Martin

User avatar
Steve
Matrix Staff
Posts: 3433
Joined: Tue Jan 03, 2006 3:59 pm
Has thanked: 114 times
Been thanked: 422 times

Re: Corruption Query

Post by Steve »

Hi Martin,

I'm not sure. But looking at the memory usage, the XC compiler produces a HEX file which is almost twice the size of the BoostC equivalent. If I was to guess, I'd say perhaps the XC compiler is duplicating the functions in both threads which would prevent possible stack corruption.

Regards,
Steve.

Post Reply