Jump to content
Neil

How Do You Reserve A Specific Block Of Flash Rom?

Recommended Posts

Hi all

 

Hi have what I think is a simple question, but I cant seem to find the answer on the forum

 

I want to reserve a known block of FLASH ROM on my 18F8722 at a known address. In this block I want to store calibration data that is not suited to EEPROM. I want to to use the block erase and write functions to change this from my code.

 

Using the "rom" key work I can define data in FLASH rom, but I dont know were it is and I can't access it with a pointer!

 

So, how do I do this from with in Boost C++ ?

 

Any tips, examples or code pointer are welcome.

 

Later on in my development I will need to boot load new firm ware via a serial port and NOT over write this calibration data. Again, pointers and help are welcome.

 

Thanks in advance

 

 

Neil

Share this post


Link to post
Share on other sites

Neil,

 

This has been asked before.

 

http://forum.sourceboost.com/index.php?showtopic=3693&hl

 

You can use #pragma DATA blockaddr,1,2,3,4,5,6

 

where blockaddr is the rom address for you data such as 0x1000. Just be sure the address is well away from your code such as top of rom. You will probably need to resort to assembler to get access to it, or use flash read/write features of your pic to load chunks into ram etc.

 

Cheers

 

Reynard

Share this post


Link to post
Share on other sites

Hi Reynard

 

Thanks for that pointer. That is exactly what I needed.

 

Using Boost cany you also force a function to be at a specific location?

 

Thanks

 

Neil

Share this post


Link to post
Share on other sites

Hi Neil,

 

You are looking for something like

 

void func(int par) org 0x200 {
// Function will start at address 0x200
 nop;
}

OR

#pragma funcorg <func_name>  <starting_address>

 

which can be done in MikroC but alas not in BoostC yet (that I know of).

 

Cheers

 

Reynard

Edited by Reynard

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

×
×
  • Create New...