Kinetis (K20) EEPROM Partition Question.

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

Kinetis (K20) EEPROM Partition Question.

1,311 Views
ZQSu
Contributor I

Hi Everyone.

I'm trying to use K20 FlexMEM / FlexRAM to implement a EEPROM and experiensing some EEPROM partition issue. The EEPROM partition routine can only be executed in debug mode and after first running, it automatic stops running. Then after reset procedure, it runs well. After EEPROM partition in debug mode, the board runs very well after power-on. If it is just burned in all code and then directly power-on again, it will not work. Looks like it will always in EEPROM partition routine.

 

I noticed that the EEPROM partition routine must be executed in RAM. The issue is how I can let this routine is copied into RAM after power-on and is executed from RAM. I tried some #pragma and modified link file. But this issue is still there: The routine is always in P flash.

 

Is there any one here who have solved the EEPROM partition ?

 

Thanks for your reply.

0 Kudos
Reply
2 Replies

556 Views
lander
Contributor IV

Did you figure out your problem?  If so, please let me know how!

Thank you,

Liz

0 Kudos
Reply

556 Views
Briwal
Contributor I

If you are using IAR then use the __ramfunc ojecct attribute. Then IAR will copy the function to RAM for you. The problem is that it will always take up RAM space but my flash function is quite small ~100 bytes.

 

_ _ramfunc int FlashPage(char * data, char * page);
I was allocating RAM, copying the code and calling it manually, then freeing the RAM but the __ramfunc attribute is a lot easier.
0 Kudos
Reply