CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

Bootloader

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
nilsener



Joined: 06 Dec 2005
Posts: 59

View user's profile Send private message

Bootloader
PostPosted: Fri Aug 26, 2011 5:53 am     Reply with quote

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

View user's profile Send private message

PostPosted: Fri Aug 26, 2011 1:52 pm     Reply with quote

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.
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
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