Page 1 of 1

Modify XC8 Compiler/Linker inside FC for Bootloader

Posted: Wed Dec 29, 2021 4:29 pm
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

Re: Modify XC8 Compiler/Linker inside FC for Bootloader

Posted: Wed Dec 29, 2021 5:08 pm
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.

Re: Modify XC8 Compiler/Linker inside FC for Bootloader

Posted: Wed Dec 29, 2021 5:28 pm
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

Re: Modify XC8 Compiler/Linker inside FC for Bootloader

Posted: Wed Dec 29, 2021 11:15 pm
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>

Re: Modify XC8 Compiler/Linker inside FC for Bootloader

Posted: Wed Jan 05, 2022 4:50 pm
by BenR
Hello,

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

Re: Modify XC8 Compiler/Linker inside FC for Bootloader

Posted: Fri Jan 07, 2022 11:18 am
by dvcam99
Many Thanks and Happy new year Ben

I will implement/test it into my next project.

BR

Dirk