It shows how to configure Flowcode to compile with latest version of XC8
Microchip have changed the way XC8 compiler works from V2.00
Pre V2.0 the default was to use C90 as standard.
From V2.0 the default is C99 as standard.
This will mean you will not get expected results if you start using XC8 V2.00 or above, especially if using pro version of compiler.
One typical example, Compiled a large flowchart with target = 18F47K40 & pro version XC8 V1.45 (default Flowcode V8 Compiler) I was getting 78% used (in V1.45 there is a bug which means the used value is a few % higher than it should be)
Tried with V2.05 (only changing path and not parameters) I was getting 93.2 % used.
After contacting microchip support, A new batch file was created for me and I thought I would share it for anyone who wants to use XC8 V2.0 or above:
Code: Select all
@REM $(chip) "$(outdir)" "$(target)"
@PUSHD %~2
"C:\Program Files (x86)\Microchip\xc8\v2.00\bin\xc8-cc.exe" -mcpu=%~1 "%~3.c" -w=359,1273,1388 -fshort-float -fshort-double -std=c90 -Os
@POPD
@IF %ERRORLEVEL% NEQ 0 GOTO Error
@ECHO.
@ECHO Compilation successful!
@EXIT 0
:Error
@ECHO.
@ECHO Error returned from [xc8.exe]
@EXIT 1
Note:Batch file can be use with XC8 Standard or pro versions.
After compiling with new batch file, the result is 73% used, much better than 93.2 used!
The batch files can be found within 64 bit windows:
Code: Select all
C:\Program Files (x86)\Flowcode\Compilers\pic\batch\
Code: Select all
C:\Program Files\Flowcode\Compilers\pic\batch\