em_eeprom questions

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
KeYp_290406
Level 4
Level 4

I would like to make an 8k block at top of flash for eeprom. I see where bootloadable can be set to allow this. What's confusing is the examples only show setting up small arrays and filling them without any regard to memory address, etc. I want to set up something more organized like the smaller eeprom component where you can define fixed addresses. I guess I want to tell the linker where I want my em_eeprom arrays to reside or maybe just create one big 8k array and then index into it as needed. Any suggestions?

0 Likes
1 Solution
KeYp_290406
Level 4
Level 4

I found that something like this works for reading and writing using the em_eeprom flash write functions.

   


#define USRFLSH_BASE 262144 - USRFLSH_SIZE
#define ptr_userFlsh ((uint8 const *) USRFLSH_BASE)

   

The flash write function works fine with pointers to sram source and flash destination. It only gets messy if your application is a bootloadable like mine. You have to tell the bootloadable component the size of your user flash area. It must be at the top of flash. Also, very important, you can't write to the top row of flash or your application will crash on the next power on. The bootloader uses the top 64 bytes.

View solution in original post

0 Likes
1 Reply