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

#import not working [SOLVED]

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



Joined: 27 Jul 2013
Posts: 79

View user's profile Send private message

#import not working [SOLVED]
PostPosted: Tue Jul 22, 2014 3:38 pm     Reply with quote

If I do #import(FILE=bootloader.hex,HEX) in my application code, bootloader works fine but the application does not load.

Doing #import(FILE=application.hex,HEX) in my boot-loader works fine.
(But I don't want this, because I would have to compile my project twice every time)

Also burning just the application code without the bootloader ( but including the header) does not work. It used to work for my PIC18 controller.

What seems to be the problem here. Any help?

PIC: PIC24EP512GU810
Compiler: v5.015


Last edited by haxan7 on Wed Jul 23, 2014 4:03 am; edited 1 time in total
Ttelmah



Joined: 11 Mar 2010
Posts: 19472

View user's profile Send private message

PostPosted: Wed Jul 23, 2014 2:05 am     Reply with quote

I'd try restricting the load range, to the area where the actual bootloader lives.

Problem is that the bootloader, contains a 'dummy' application, doing nothing, sitting where the main application is meant to be. This overwrites the first few bytes of your main application...

If you look at 'ex_pcd_booloader.c', this is the bit:

Code:

#org LOADER_END+1,LOADER_END+5
void application(void)
{
   while(TRUE);
}

This has to exist, but if you 'import' this, over the main code, it'll stop things working.

So use the 'RANGE=start:stop' option in the import, using the bottom of memory up to 'loader_end' as the range to import.
haxan7



Joined: 27 Jul 2013
Posts: 79

View user's profile Send private message

PostPosted: Wed Jul 23, 2014 4:03 am     Reply with quote

Thanks!
For those with similar problem.
I was using ccs example bootloader. I calculated LOADER_END from "PCD_Bootloader.h".
And changed the #import to
Code:
#import(FILE=loader.hex,HEX,RANGE=0:4095)

Where LOADER_END=4095
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