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

ORG errors with bootloader

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



Joined: 16 Dec 2005
Posts: 2

View user's profile Send private message

ORG errors with bootloader
PostPosted: Fri Dec 16, 2005 2:27 pm     Reply with quote

I'm having some odd problems since updating my compiler. I am using a bootload based on the example code which came with the compiler. My target is a PIC18F6720.

The following code use to work fine in my main application. Now it causes an "Invalid ORG Range" error. I've tried changing a number of things but to no avail.

Has anybody come across this before?

Code:

#define LOADER_END   0xfFF
#define LOADER_SIZE   0xdff

#ifndef _bootloader

#define VERSION_HIGH  ((FIRMWARE_VERSION)>>8)
#define VERSION_LOW ((FIRMWARE_VERSION)&0xff)

#if defined(__PCM__)
   #build(reset=LOADER_END+1, interrupt=LOADER_END+5)
#elif defined(__PCH__)
   #build(reset=LOADER_END+2, interrupt=LOADER_END+8)
#endif

#org 0, LOADER_END {}

#endif
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Fri Dec 16, 2005 2:40 pm     Reply with quote

Quote:
The following code use to work fine in my main application.
Now it causes an "Invalid ORG Range" error.

1. Were you using a different PIC for the code that worked ?
If so, what PIC were you using ?

2. Did you change compiler versions ? What was your old version
and what is your current version ?
darryl



Joined: 16 Dec 2005
Posts: 2

View user's profile Send private message

PostPosted: Mon Dec 19, 2005 3:06 pm     Reply with quote

1) we've always been using the same PIC 18F6720

2) It use to work fine on previous compiler versions 3.191, 3.202, 3.204, but does not now work on our current version 3.241.
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Mon Dec 19, 2005 3:57 pm     Reply with quote

If I take your code and drop it into a test program, it compiles with
no errors with PCH vs. 3.241.

Code:
#include <18F6720.H>
#fuses XT,NOWDT,PUT,BROWNOUT,NOLVP
#use delay(clock=4000000)
#use rs232(baud=9600, xmit=PIN_C6, rcv=PIN_C7, ERRORS)

#define LOADER_END   0xfFF
#define LOADER_SIZE   0xdff

#ifndef _bootloader

#define VERSION_HIGH  ((FIRMWARE_VERSION)>>8)
#define VERSION_LOW ((FIRMWARE_VERSION)&0xff)

#if defined(__PCM__)
   #build(reset=LOADER_END+1, interrupt=LOADER_END+5)
#elif defined(__PCH__)
   #build(reset=LOADER_END+2, interrupt=LOADER_END+8)
#endif

#org 0, LOADER_END {}

#endif


//=============================================
void main(void)
{


while(1);
}
Howard



Joined: 19 Dec 2005
Posts: 2

View user's profile Send private message

ORG_errors with bootloader
PostPosted: Mon Dec 19, 2005 11:05 pm     Reply with quote

If you try the following code it causes the problem. It appears to be related to using interupts. Remove the interrupt and it compiles properly using PCH ver 3.241

Code:
#include <18F6720.H>
#fuses XT,NOWDT,PUT,BROWNOUT,NOLVP
#use delay(clock=4000000)
#use rs232(baud=9600, xmit=PIN_C6, rcv=PIN_C7, ERRORS)

#define LOADER_END   0xfFF
#define LOADER_SIZE   0xdff

#ifndef _bootloader

#define VERSION_HIGH  ((FIRMWARE_VERSION)>>8)
#define VERSION_LOW ((FIRMWARE_VERSION)&0xff)

#if defined(__PCM__)
   #build(reset=LOADER_END+1, interrupt=LOADER_END+5)
#elif defined(__PCH__)
   #build(reset=LOADER_END+2, interrupt=LOADER_END+8)
#endif

#org 0, LOADER_END {}

#endif

int i;
#INT_RTCC

   void rtc_code() {
      i++;
   }

//=============================================
void main(void)
{
while(1);
}
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Tue Dec 20, 2005 1:17 am     Reply with quote

To get it to compile with PCH vs. 3.241, I had to increase the value
shown in bold below to 9. I'm not sure how this will affect your
program. You'll have to look at the .LST file.
Quote:
#if defined(__PCM__)
#build(reset=LOADER_END+1, interrupt=LOADER_END+5)
#elif defined(__PCH__)
#build(reset=LOADER_END+2, interrupt=LOADER_END+9)
#endif
agrj



Joined: 26 Sep 2003
Posts: 48

View user's profile Send private message

PostPosted: Tue Dec 27, 2005 1:51 pm     Reply with quote

It worked for me.

thanks!!
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