|
|
View previous topic :: View next topic |
Author |
Message |
nilsener
Joined: 06 Dec 2005 Posts: 59
|
Bootloader |
Posted: Fri Aug 26, 2011 5:53 am |
|
|
18F2523, PCWH v4.014
Dear,
I have a bootloader located in boot block at 0x0 - 0x7FF. If I burn only the bootloader to the PIC, it starts and works normal. After loading the program code with the bootloader to code memory it is not possible to start the bootloader again, but actual it must. The PIC starts the program code immediately and ignores the bootloader. The bootloader start condition (check a pin for high signal) is exactly the same. It seems that PIC jumps to 0x800 (start address of program code) immediately after power up, but it should start at 0x0.
I found that the bootloader will start again, if I interrupt the loader if approx. 70% of program code was loaded and will no more start up if 80% is loaded. The range between 70 and 80% is where code block 3 (0x6000 - 0x7FFF) comes into effect. Maybe the problem appears after writing to code block 3.
I checked the code in boot block for any changes after loading the program code to code memory by reading out the boot block with MPLAB and found that the boot block matches for both cases. The boot block contains exactly the same code before and after burning the program code.
I am searching the problem for 2 days but until now I have now idea what is going on here.
Has anyone an idea before I become desperate?
Best Regards
Nilsener |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Fri Aug 26, 2011 1:52 pm |
|
|
Quote: | and found that the boot block matches for both cases. The boot block contains exactly the same code before and after burning the program code.
|
What if the boot block code calls routines that are outside the boot block ?
Possibly CCS library routines, for CCS built-in functions ? What if your
new application program is over-writing those routines with different code
or moving them to a different address ? This could explain the failure.
Quote: |
I found that the bootloader will start again, if I interrupt the loader if approx. 70% of program code was loaded and will no more start up if 80% is loaded. The range between 70 and 80% is where code block 3 (0x6000 - 0x7FFF) comes into effect. Maybe the problem appears after writing to code block 3. |
The routines that I'm referring to, may be in code block 3.
Check the .LST file for the boot block code. See if it's doing any calls or
branches to code outside of the boot block. |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|