How bootloader knows where to jump

General discussion on mikroBasic PRO for PIC32.
Post Reply
Author
Message
Stimulus
Posts: 4
Joined: 13 Aug 2014 07:07

How bootloader knows where to jump

#1 Post by Stimulus » 13 Aug 2014 07:27

I am looking at HID Bootloader example code and cant figure out where it writes the application entry address to jump to. I can see code that creates a placeholder for the app reset vector in ConfigMem() procedure but I do not see that vector placeholder getting updated with the actual application reset vector after an application is loaded. Can someone explain please how bootloader knows where to jump to?

phil31
Posts: 348
Joined: 02 Apr 2009 15:02
Location: France
Contact:

Re: How bootloader knows where to jump

#2 Post by phil31 » 16 Aug 2014 00:23

hi,

if i right remember, the new vector is write by the USB bootloader software (PC) at the last flash memory address available before the bootloader firmware start.

try to read the flash PIC memory after you upload your application firmware and check the value before the beginning of the bootloader

regards

Stimulus
Posts: 4
Joined: 13 Aug 2014 07:07

Re: How bootloader knows where to jump

#3 Post by Stimulus » 19 Aug 2014 06:26

You are correct, I have figured that out by now. It is the PC microbootloader software that writes the application reset address to 0x9D07BFF0 (for PIC32 with 512kB), which is the 16 bytes right before the bootloader starts at 0x9D07C000.

So Microe - how hard was that to answer?

User avatar
filip
mikroElektronika team
Posts: 11874
Joined: 25 Jan 2008 09:56

Re: How bootloader knows where to jump

#4 Post by filip » 19 Aug 2014 08:15

Hi,

I apologize if I haven't answered appropriately, but the phil31 answered just before I did, so I thought I shouldn't post the same answer again.
Thank you for the understanding.

Regards,
Filip.

Post Reply

Return to “mikroBasic PRO for PIC32 General”