Page 1 of 1
Make compiler settings sticky for flowchart
Posted: Thu Apr 23, 2015 7:54 am
by kersing
While working on a boot loader for dsPIC devices with auxiliary flash I've created updated compiler settings using the auxiliary flash. Now I need to switch between the compiler settings when switching flow charts as the compiler settings are global and not associated with the flow chart.
It would be convenient to be able to use the 'default' settings for new projects and all projects not specifying a specific compiler and have the ability to use the other available settings for individual flow charts. (Not store the settings of the compiler/linker/etc with the flow chart, but store the name of the selected profile so updates to the profile benefit all flow charts referring to it)
Re: Make compiler settings sticky for flowchart
Posted: Mon Apr 27, 2015 10:59 am
by Benj
Hi Kersing,
You can potentially do this by creating your own custom FCDX. Take the FCDX for the chip you want to use, make a copy and then using a text editor alter the following.
In Device-> Name edit the name so that it matches the name of the new FCDX file.
Also create a new field named namealt which holds the name of the chip.
Code: Select all
<device name='16F1947' product='PIC' family='16F' bits='8' >
changes to this
Code: Select all
<device name='16F1947Custom' namealt='16F1947' product='PIC' family='16F' bits='8' >
If you want to override the compiler settings then you can add this section between the </test> and the </root> lines. Here is an example from the ECIO FCDX.
Code: Select all
<build>
<compiler exe="$(appdir)compilers\pic\boostc\boostc_18f.exe"
params="-v -t $(chipalt) "$(target).c""
/>
<linker exe="$(appdir)compilers\pic\boostc\boostlink_picmicro.exe"
params="-rb 0x800 -ld "$(appdir)compilers\pic\boostc\Lib" libc_18F.lib rand_18F.lib float_18F.lib "$(target).obj" -t $(chipalt) -d "$(dir)" -p "$(target)""
/>
<programmer exe="$(appdir)tools\mLoader\mLoader.exe"
params="-ecio40 "$(target).hex""
/>
</build>
The config settings can be altered or overridden by altering this line near the end of the FCDX.
Code: Select all
<config >
<body code='#ifdef _BOOSTC\n#pragma DATA $(address), 0x$(value:x)\n#endif\n#ifdef HI_TECH_C\n__CONFIG(0x$(value:x));\n#endif\n' />
</config>
change "body" to "start" so that it doesn't repeat multiple times.
You can use Flowcode to generate the config settings you need and then copy the C code from Flowcode into the FCDX file. Replacing new lines with \n etc.
Re: Make compiler settings sticky for flowchart
Posted: Mon Apr 27, 2015 12:27 pm
by kersing
Hi Ben,
Thank you for that solution, I'll certainly look into it.
Given the check box 'Default compiler for the platform...' I would still expect to be able to specify the profile to be used for the current flow chart and not have to set it for all flow charts for that particular architecture. (May-be I should file this as a bug??

)
Best regards,
Jac
Re: Make compiler settings sticky for flowchart
Posted: Mon Apr 27, 2015 2:20 pm
by Benj
Hi Jac,
A simpler graphical way of doing this on a project basis would be very nice. Also graphically locking the config and being able to use it time and time again would be very handy.
Sounds like a v7 feature to me but I will get it on the list so we can mull it over.