Page 1 of 1

programming a micro from a set address

Posted: Fri Oct 16, 2020 1:04 pm
by stuartwili
We were using flowcode v4 and loaded a boot loader on to the micro. then we load the main program to a set address so to not over write the bootloader. we have updated to V8 and cant find out how this is done in V8.

Re: programming a micro from a set address

Posted: Fri Oct 16, 2020 1:23 pm
by Benj
Hello,

The way I might do it would be like this.

Browse to this location using file explorer, it's hidden by default so just paste the link into your address bar.

C:\ProgramData\MatrixTSL\FlowcodeV8\FCD\PIC

Assuming it's a PIC based device.

Copy the device FCD you want to use for example 16F18877.fcdx and rename the copy to 16F18877_boot.fcdx

Open the new FCD file in a text editor and find this section of code. It should be right near the top of the file.

Code: Select all

<device name='16F18877' product='PIC' cal='PIC' family='16F' bits='8' >
Change name to match the new name of the FCD and add namealt='' containing the chip name

For example

Code: Select all

<device name='16F18877_boot' namealt='16F18877' product='PIC' cal='PIC' family='16F' bits='8' >
Above the <device line add these lines to override the compiler and programmer settings.

Code: Select all

<build>
    <compiler exe="$(compilerpic)bin\xc8.exe" 
	params="--chip=$(chipalt) &quot;$(target).c&quot; --MSGDISABLE=359,1273,1388 --CODEOFFSET=1000h --ROM=default,-0-FFF" />
    <programmer exe="$(appdir)tools\mLoader\mLoader.exe" params="-stproto &quot;$(target).hex&quot;" />
</build>
The --CODEOFFSET specifies the bootloader shift.

The Programmer can be overridden as required if you want Flowcode's compile to chip to work with your bootloader application.

Save the file and then close and reopen Flowcode and the new device should now be in the target device list.

Hope this helps.