Jump to content
Sign in to follow this  
crash_n_burn

Protect A Code Memory Area

Recommended Posts

In one of my programs there is user data in flash memory ( code memory ). It's near the middle of the memory map.

 

For my example here, I will say it's at location 0x12000 to 0x13000. I'm using a PIC18F6720.

 

Don't ask me why I did this. I know it's not how it should be done, but now I have to keep it this way so my customer can upgrade the software without losing the user data. We are using a ICD-U40 programmer from CCS with the "no erase" function to upgrade the systems with new software. This way, the code is replaced and the user data is not erased.

 

The code is getting bigger and bigger and someday it will hit the user data. Is there a way to tell Boost C not to put any code there ? Something like #pragma reserve this memory area from there to there.

 

 

I tried to manually move big function with something like :

 

void mybigfunc ( void ) @ 0x140000

{

...

}

 

but boost C does not take it.

 

 

 

Any suggestions ?

 

 

Thank you all.

Share this post


Link to post
Share on other sites
The code is getting bigger and bigger and someday it will hit the user data. Is there a way to tell Boost C not to put any code there ? Something like #pragma reserve this memory area from there to there.
Can't currently be done.

Best option (I can think of, and it isn't that good :( ) would be to use linker option -rt 0x11FFF. You will then get a linker error when linker tries to use this memory. At least you will know that there is going to be a problem.

 

Regards

Dave

Share this post


Link to post
Share on other sites

Okay. I'll put the linker option. At least I'll know if things get too big.

 

Thank you for your reply.

Share this post


Link to post
Share on other sites

Join the conversation

You are posting as a guest. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...