AnsweredAssumed Answered

IVOR1 exception occurs when reading Flash memory

Question asked by Hoseok Seo on Jun 12, 2017
Latest reply on Aug 30, 2017 by Bhavani Ananda

Hi everybody,

 

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;
   // buffers
   t_aaa_info aaa_list[256];
   t_bbb_info bbb_info;
   t_ccc_info ccc_info;
   t_ddd_info ddd_list[10];
   t_eee_info eee_list[3];
   unsigned char fff_buffer[40000];
   t_ggg_info ggg_list[4];
   t_hhh_info hhh_list[16];
   // last
   unsigned long reserved_for_last[1];
} t_reset_mem_info;

 

[Declaration of structure:]
const t_reset_mem_info *picd_reset_mem = (const t_reset_mem_info *)(0x000C0000);

 

[Usage of structure:]
void flash_load(void)
{
   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

 

Hoseok

Outcomes