Modify XC8 Compiler/Linker inside FC for Bootloader

For general Flowcode discussion that does not belong in the other sections.
Post Reply
dvcam99
Posts: 96
http://meble-kuchenne.info.pl
Joined: Fri Dec 04, 2020 11:03 am
Has thanked: 6 times
Been thanked: 12 times

Modify XC8 Compiler/Linker inside FC for Bootloader

Post by dvcam99 »

Hello together,

I´m just doing some experimental work with the Microchip Bootloader discribed in AN1310 documentation.
https://ww1.microchip.com/downloads/en/ ... 01310a.pdf

The bootloader works very well with some of my programs. But some programs occupy the memory space that is needed for the bootloader programm.

Is there a way to modify the FC Linker setup in a way in order to reserve the memory space adress range??

For example in MPLAB X you have a possibility to reserve a ROM space like "default,-7CFC-7FFE".



Any advice is welcome.

BR

Dirk
Happy FC9, FC-8 and FC-6 professional user ;)

medelec35
Matrix Staff
Posts: 1919
Joined: Wed Dec 02, 2020 11:07 pm
Has thanked: 622 times
Been thanked: 645 times

Re: Modify XC8 Compiler/Linker inside FC for Bootloader

Post by medelec35 »

Hi Dirk.
I believe the best way for you will be the method in this post.
That applied to v8, but should equally work for v9.
Martin

dvcam99
Posts: 96
Joined: Fri Dec 04, 2020 11:03 am
Has thanked: 6 times
Been thanked: 12 times

Re: Modify XC8 Compiler/Linker inside FC for Bootloader

Post by dvcam99 »

Hello Martin,

many thanks for the reply. If have checked the solution from Ben.

Yes if I understood right the modification would shift my applikation programm to a higher adress making space for the bootloader at the beginning.

The good thing with AN1310 is that the bootloader sits at the end of the adress range ( in example 7CFC-7FFE"). So I need free exclusive adress space at the end.

BR

Dirk
Happy FC9, FC-8 and FC-6 professional user ;)

dvcam99
Posts: 96
Joined: Fri Dec 04, 2020 11:03 am
Has thanked: 6 times
Been thanked: 12 times

Re: Modify XC8 Compiler/Linker inside FC for Bootloader

Post by dvcam99 »

Hello Matrix Team,
Hello Martin,

How about the ROM Default range 0-fff? Would this limit /secure the adress end range for the boot loader if I would put thatr for example to 0-EEE??

BR

Dirk

<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>
Happy FC9, FC-8 and FC-6 professional user ;)

BenR
Matrix Staff
Posts: 1926
Joined: Mon Dec 07, 2020 10:06 am
Has thanked: 503 times
Been thanked: 686 times

Re: Modify XC8 Compiler/Linker inside FC for Bootloader

Post by BenR »

Hello,

Yes I beleive that would work, that and remove the --CODEOFFSET section.

dvcam99
Posts: 96
Joined: Fri Dec 04, 2020 11:03 am
Has thanked: 6 times
Been thanked: 12 times

Re: Modify XC8 Compiler/Linker inside FC for Bootloader

Post by dvcam99 »

Many Thanks and Happy new year Ben

I will implement/test it into my next project.

BR

Dirk
Happy FC9, FC-8 and FC-6 professional user ;)

Post Reply