Page 1 of 1

Codesize compared to V3

Posted: Tue Apr 17, 2018 7:35 am
by CSM2711
Hello,

I am new on programming Flowcode (wonderful tool), we are using Flowcode V3 and Flowcode V5.
At the moment I try to program a PIC12F615 (small memory) it works fine by using V3 but when
I use the more comfortable V5 the code will always be too big. For example I have writ a very small program (see attached pictures) just read out two ADC (as byte) and subtract the both values.
By using V3 the codesize is 9 bytes (14.1%), under V5 the codesize is 48 bytes (75%).
I use the boostc V6.7 compiler in V3 and the boostc V7.04 vompiler in V5.
In the C-files you can see that V5 include many unused function, I think that’s the reason for the big size.
Now my questions, is it recommended to use a other compiler which is able to remove unused functions?
Is there’re any other possibility to reduce the codesize?
Or is it recommended to use V3 for controllers with a small memory?

Re: Codesize compared to V3

Posted: Tue Apr 17, 2018 7:37 am
by CSM2711
forgot attachmends .....

Re: Codesize compared to V3

Posted: Wed May 02, 2018 7:02 am
by CSM2711
Does nobody have an answer or an idea?

Re: Codesize compared to V3

Posted: Wed May 02, 2018 10:21 am
by Steve
In all versions of Flowcode, you can include your own C code and functions if code size is an important constraint.

Re: Codesize compared to V3

Posted: Thu May 03, 2018 9:22 pm
by Benj
Hello,

The string buffer allowing you to do things like string manipulations is maybe partially to blame (20 bytes). V5 was a while ago so I'll have to look at my install for where in the resource files this might be so you can disable it.

It's likely the other size increases are similar feature and performance improvements from v3 to v5.

Re: Codesize compared to V3

Posted: Fri May 04, 2018 12:03 pm
by Benj
Ok in v5 you can do the following to reduce the amount of RAM used.

Browse to the following location on your PC "Flowcode 5\PIC\FCD"

Find the file "internals.c" and open with a text editor e.g. notepad.

Find these lines in the code.

Code: Select all

	#ifndef MX_10F_TRIS
		unsigned char FCI_TMP_STR[20];
		int FCI_TMP_INT;
	#endif
Comment out the two inner lines and that should reduce your RAM usage by 22 bytes.

Code: Select all

	#ifndef MX_10F_TRIS
		//unsigned char FCI_TMP_STR[20];
		//int FCI_TMP_INT;
	#endif
Let us know how you get on.