AnsweredAssumed Answered

SRAM write of MPC5644A can not by byte?

Question asked by Yang Zhao on Mar 27, 2019
Latest reply on Mar 27, 2019 by Yang Zhao

Dear support,

    I face one problem ,after initial the 128k sram in start up code, after do some board initial, i need implement flash copy to SRAM,

but strange is : the copy can correctly run with 4 bytes every time,  but if i do copy with one byte ,it will run to IVOR exception.

 

i need to copy 64 k data from flash 0x30000, to SRAM 0X40010000.

the copy function is also below:

          while (numofBytes-- > 0)
     {
        *pdestaddr++ = *psrcaddr++;         
     }

 

#define XCPAPP_CAL_RAM_START    0x40010000u
#define XCPAPP_CAL_MEM_START    0x00030000

 

 

with below definition: the  4 bytescopy function can run correctly

 

unsigned long numofBytes = 0x4000;
unsigned int* pdestaddr = (unsigned int*)(XCPAPP_CAL_RAM_START);
const unsigned int* psrcaddr = (unsigned int*)(XCPAPP_CAL_MEM_START);    

 

 

but with the below byte code, it will run to exception.

unsigned long numofBytes = 0x10000;
unsigned char* pdestaddr = (unsigned char*)(XCPAPP_CAL_RAM_START);
const unsigned char* psrcaddr = (unsigned char*)(XCPAPP_CAL_MEM_START);    

 

 

could you give me some advise?  thank you for your reply!

Outcomes