how to decide dest in SetBlockFlash()

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

how to decide dest in SetBlockFlash()

Jump to solution
2,054 Views
SofTA
Contributor I
Hi Experts,
 
It seems someone asked this kind of question before but I could no find an answer suit me so please excuse me to ask it again:
 
I want to save some calibration data. I am using MC9S08QE128 CPU. How can I decide the dest in SetBlockFlash() in IntFlash bean? Thanks a lot in advance.
 
Softa
Labels (1)
Tags (1)
0 Kudos
Reply
1 Solution
695 Views
CrasyCat
Specialist III
Hello
 
If you want to reserve a page of flash for your application, just make sure to remove any occurrence of this  page in the.PRM file's PLACEMENT block.
 
Your original placement block might look as follows:
 
Code:
PLACEMENT    
     DEFAULT_RAM               INTO  RAM,RAM1;    _PRESTART,                         
    STARTUP,                                ROM_VAR,                                STRINGS,                                VIRTUAL_TABLE_SEGMENT,             
    NON_BANKED,                        
    DEFAULT_ROM,    COPY                       INTO  ROM;
    PAGED_ROM                  INTO  PPAGE_0,PPAGE_2,PPAGE_4,PPAGE_5,PPAGE_6,PPAGE_7,ROM1;    _DATA_ZEROPAGE,                    
    MY_ZEROPAGE                INTO  Z_RAM;END

 
Let's say you want to reserve PPAGE_0 to store your data in your application. Then modify the placement block as follows:
 
Code:
PLACEMENT
    DEFAULT_RAM               INTO  RAM,RAM1;    _PRESTART,
    STARTUP,                                ROM_VAR,                                STRINGS,                                VIRTUAL_TABLE_SEGMENT,
    NON_BANKED,               
    DEFAULT_ROM,    COPY                       INTO  ROM;
    PAGED_ROM                  INTO  PPAGE_2,PPAGE_4,PPAGE_5,PPAGE_6,PPAGE_7,ROM1;    _DATA_ZEROPAGE,       
    MY_ZEROPAGE                INTO  Z_RAM;END

 
CrasyCat

View solution in original post

0 Kudos
Reply
4 Replies
695 Views
SofTA
Contributor I
Hi Tom,
 
Thank you for offering help. I may not state me question clearly. I am new to PE. As I understand, my program code compiled in PE platform also use flash memory. I do not worry much about the address of the data I want to save because I think I can use &data to get the address. But I don't know where to save it safely without overwriting my program code. For example, if I write it to address 0x08000, how do I know or control that the address 0x08000 is only used by me but not the compiler? Maybe my quesion is too rudimentary :smileyhappy:
 
Softa
0 Kudos
Reply
695 Views
SofTA
Contributor I
Hi CrasyCat,
 
Thank you very much. This is exactly what I want to know. This is great. Thank you again!
 
Softa
0 Kudos
Reply
696 Views
CrasyCat
Specialist III
Hello
 
If you want to reserve a page of flash for your application, just make sure to remove any occurrence of this  page in the.PRM file's PLACEMENT block.
 
Your original placement block might look as follows:
 
Code:
PLACEMENT    
     DEFAULT_RAM               INTO  RAM,RAM1;    _PRESTART,                         
    STARTUP,                                ROM_VAR,                                STRINGS,                                VIRTUAL_TABLE_SEGMENT,             
    NON_BANKED,                        
    DEFAULT_ROM,    COPY                       INTO  ROM;
    PAGED_ROM                  INTO  PPAGE_0,PPAGE_2,PPAGE_4,PPAGE_5,PPAGE_6,PPAGE_7,ROM1;    _DATA_ZEROPAGE,                    
    MY_ZEROPAGE                INTO  Z_RAM;END

 
Let's say you want to reserve PPAGE_0 to store your data in your application. Then modify the placement block as follows:
 
Code:
PLACEMENT
    DEFAULT_RAM               INTO  RAM,RAM1;    _PRESTART,
    STARTUP,                                ROM_VAR,                                STRINGS,                                VIRTUAL_TABLE_SEGMENT,
    NON_BANKED,               
    DEFAULT_ROM,    COPY                       INTO  ROM;
    PAGED_ROM                  INTO  PPAGE_2,PPAGE_4,PPAGE_5,PPAGE_6,PPAGE_7,ROM1;    _DATA_ZEROPAGE,       
    MY_ZEROPAGE                INTO  Z_RAM;END

 
CrasyCat
0 Kudos
Reply
695 Views
J2MEJediMaster
Specialist I
Take a look at this thread and see if it will help you. If you're talking about what memory address to use for storing into Flash, you need to look at the memory map for the MCU you're working with. HTH.

---Tom

0 Kudos
Reply