programming a micro from a set address

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

Moderator: Benj

Post Reply
stuartwili
Posts: 5
Joined: Tue Sep 01, 2020 11:23 am
Contact:

programming a micro from a set address

Post 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.

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: programming a micro from a set address

Post 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.

Post Reply