|
|
View previous topic :: View next topic |
Author |
Message |
haxan7
Joined: 27 Jul 2013 Posts: 79
|
#import not working [SOLVED] |
Posted: Tue Jul 22, 2014 3:38 pm |
|
|
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: 19590
|
|
Posted: Wed Jul 23, 2014 2:05 am |
|
|
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
|
|
Posted: Wed Jul 23, 2014 4:03 am |
|
|
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 |
|
|
|
|
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
|