Jump to content
Sign in to follow this  
Badejavu

Relocating "application Reset Vector" For Bootloader

Recommended Posts

Hi,

I have implemented a microchip AN1310 bootloader on PIC18F25K80.Its works on first program via the uart, but does not work again after my firmware has been loaded on the microcontroller. After checking the Pic's datasheet , the "application reset vector" is at location 0000h but then again the AN1310 bootloader has a "bootloader reset vector" at the same address 0000h . This means when i download my program code via the uart bootloader, it overwrites the "bootloader reset vector" at 0000h with the "application reset vector". Hence i cannot use the bootloader after the 1st program code download.

 

1. How do i define a new application reset vector or program start address in boost C? I have seen examples on the forum of including a linker option -rt <new address> but it does not work.If it does, can anyone pls explain where i can include this to the linker?Maybe I am including it wrongly.

 

 

2. Is there a way I can write protect the bootloader reset vector address at 0000h in code or via the Pic's CONFIG bits?

 

Thanks

Share this post


Link to post
Share on other sites

Badejavu,

1. How do i define a new application reset vector or program start address in boost C? I have seen examples on the forum of including a linker option -rt <new address> but it does not work.If it does, can anyone pls explain where i can include this to the linker?Maybe I am including it wrongly.

Use linker option -rb 0x100 ( 0x100 or whatever point you want the ROM base address to be).

It is a linker command line option.

In SourceBoost IDE you can enter extra command line options here: Menu Settings->Options->Compile Options->Extra Linker Options.

 

Regards

Dave

Share this post


Link to post
Share on other sites

Hi

 

In MPLAB the extra compile / link options are accessible at "Project" -> "Build Options"

 

You can set global options in "project" or source file specific one at "<xxxxxxx.c>".

 

 

 

Best regards

Jorge

Share this post


Link to post
Share on other sites

Thanks Jorge,

I did it in Mplab as you said and it worked.I previewed the program code and confirmed it relocated the start address to 0x100 in the program viewer.Now i can load the bootloader code once and do unlimited write without

erasing the bootloader code.

 

For others: to change the program start address in Mplab IDE using Boost C;

 

Project=>Build Options=>Project=>Bosst Link Linker=>[additional command line]

 

Best regards

Badejo

Share this post


Link to post
Share on other sites

Hi

 

Well, thats the job of the bootloader. When there is one we don't use a regular programmer.

The all idea is that you send your HEX file to the bootloader by some communication means and it will take care of writing it to flash without erasing itself.

 

 

Best regards

Jorge

Edited by JorgeF

Share this post


Link to post
Share on other sites

Join the conversation

You are posting as a guest. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...