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 support@ccsinfo.com

ex_pcd_bootloader.c example on dsPIC30F3011

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



Joined: 19 Dec 2014
Posts: 23

View user's profile Send private message

ex_pcd_bootloader.c example on dsPIC30F3011
PostPosted: Thu Apr 22, 2021 9:20 am     Reply with quote

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

View user's profile Send private message

PostPosted: Thu Apr 22, 2021 9:22 am     Reply with quote

Sorry I forgot to specify: I am using compiler version 5.091
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Thu Apr 22, 2021 1:32 pm     Reply with quote

Read this CCS newsletter. Read the part about dealing with
out of rom errors:
https://www.ccsinfo.com/pdfs/March-2021-Newsletter.pdf
Ttelmah



Joined: 11 Mar 2010
Posts: 19215

View user's profile Send private message

PostPosted: Fri Apr 23, 2021 12:06 am     Reply with quote

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. Sad

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

View user's profile Send private message

PostPosted: Fri Apr 23, 2021 7:11 am     Reply with quote

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. Sad

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: 19215

View user's profile Send private message

PostPosted: Fri Apr 23, 2021 7:40 am     Reply with quote

I've actually pointed this problem out to CCS, since they need to change
this part of the example code. Very annoying otherwise!...
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