|
|
View previous topic :: View next topic |
Author |
Message |
RNR107
Joined: 19 Dec 2014 Posts: 23
|
ex_pcd_bootloader.c example on dsPIC30F3011 |
Posted: Thu Apr 22, 2021 9:20 am |
|
|
Hi all,
I am working on a project requireing a boot loader.
This project is based on a dsPIC30F3011.
When I try and compile the "ex_pcd_bootloader.c" example I get an Out of ROM error.
Code: |
*** Error 71 "Y:\dsPIC30F3011_BootLoader\Boot_Loader.c" Line 80(1,2): Out of ROM, A segment or the program is too large load_program
Seg 00100-004BE, 01B8 left, need 002B4
Seg 004C0-03FFE, 3B40 left, need 002B4 Orged
Seg 00000-00002, 0000 left, need 002B4 Reserved
Seg 00004-000FE, 0000 left, need 002B4 Reserved
|
Is there any flags / define I need to change ?
What am I doing wrong here ?
Thank you for any help...
RNR |
|
|
RNR107
Joined: 19 Dec 2014 Posts: 23
|
|
Posted: Thu Apr 22, 2021 9:22 am |
|
|
Sorry I forgot to specify: I am using compiler version 5.091 |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19538
|
|
Posted: Fri Apr 23, 2021 12:06 am |
|
|
He really shouldn't have to though.
The point is that if you take the supplied example file, change just the
'family' selector, for 30F, and change the chip to the 30F3011, the file
as supplied refuses to compile.
This fault is still there on the current compiler, and seems to be for the
whole 30F family. This is strange, since the code correctly identifies this
as having a 128byte erase page, so allocates 19*128 for the bootloader.
Even stranger a really old compiler happily works (really early V5 version).
He really needs to report this to CCS, since it means the supplied example
is not working on this family.
It's actually the number of pages used in pcd_bootloader.h that is too small.
It looks as if some change in the compiler generation has resulted in
the actual code being generated growing (quite a lot!). Now the bigger
PIC24/30/33 chips erase memory in 1536byte lumps, and on these
two pages will be allocated for the bootloader, so 1024 instructions.
On the chips like this that instead erase in 96 byte lumps, the default is
to allocate 19 pages (so 608 instructions). Turns out this is massively too
small. I had to expand the size to 26 pages (so 832 instructions), before
it would compile. After compilation, looking at the listing, shows that it
uses 814 instructions, so this is the lowest value that will work....
So in your code, before where it includes pcd_bootloader.h, add the line:
#define LOADER_PAGES 26
This should make it then compile without error. |
|
|
RNR107
Joined: 19 Dec 2014 Posts: 23
|
|
Posted: Fri Apr 23, 2021 7:11 am |
|
|
Ttelmah wrote: | He really shouldn't have to though.
The point is that if you take the supplied example file, change just the
'family' selector, for 30F, and change the chip to the 30F3011, the file
as supplied refuses to compile.
This fault is still there on the current compiler, and seems to be for the
whole 30F family. This is strange, since the code correctly identifies this
as having a 128byte erase page, so allocates 19*128 for the bootloader.
Even stranger a really old compiler happily works (really early V5 version).
He really needs to report this to CCS, since it means the supplied example
is not working on this family.
It's actually the number of pages used in pcd_bootloader.h that is too small.
It looks as if some change in the compiler generation has resulted in
the actual code being generated growing (quite a lot!). Now the bigger
PIC24/30/33 chips erase memory in 1536byte lumps, and on these
two pages will be allocated for the bootloader, so 1024 instructions.
On the chips like this that instead erase in 96 byte lumps, the default is
to allocate 19 pages (so 608 instructions). Turns out this is massively too
small. I had to expand the size to 26 pages (so 832 instructions), before
it would compile. After compilation, looking at the listing, shows that it
uses 814 instructions, so this is the lowest value that will work....
So in your code, before where it includes pcd_bootloader.h, add the line:
#define LOADER_PAGES 26
This should make it then compile without error. |
Thank you very much Ttelmah!
You are absolutly right, 26 pages are requiered.... !
Thank you!
RNR |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19538
|
|
Posted: Fri Apr 23, 2021 7:40 am |
|
|
I've actually pointed this problem out to CCS, since they need to change
this part of the example code. Very annoying otherwise!... |
|
|
|
|
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
|