I'm using MPC5674F EVB and implementing 'write and read' functions to/from internal flash memory.
Specifically speaking, the following logic is under implementation.
1) Read 100KB of structural data from internal RAM
2) Erase and program the internal flash area of FLASH_B M0 in MPC5674F with the 100KB data which were read from RAM. FLASH_B M0 area is as follows. Starting address: 0x000C0000, size: 0x00040000
3) Reset MCU (MPC5674F)
4) Read variables from structural data in the internal flash memory which were written before a reset
5) Copy the variables to internal RAM
where, my problem is that IVOR1 exception occurs when I read data from internal FLASH during step 4 above and system is hanged up.
The structure information is as follows.
[Definition of structure]
typedef struct s_reset_mem_info
unsigned long aaa;
unsigned long bbb;
unsigned long ccc;
unsigned long ddd;
unsigned long eee;
unsigned long fff;
unsigned long ggg;
unsigned long hhh;
unsigned long iii;
unsigned long jjj;
unsigned char fff_buffer;
unsigned long reserved_for_last;
[Declaration of structure:]
const t_reset_mem_info *picd_reset_mem = (const t_reset_mem_info *)(0x000C0000);
[Usage of structure:]
unsigned long value_aaa = 0;
unsigned long value_bbb = 0;
unsigned long value_jjj = 0;
/* IVOR1 exception occurs in the following arbitary routine */
value_aaa = picd_reset_mem->aaa;
value_bbb = picd_reset_mem->bbb;
value_jjj = picd_reset_mem->jjj;
Can anybody help me to solve my 'Flash Write and Read' problem.
Thanks in advance