Reading data from CFLASH (MPC5646C)

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

Reading data from CFLASH (MPC5646C)

Jump to solution
1,673 Views
ericg
Contributor II

I'm very new to Freescale and I have a Qorriva MPC5646C. I was able to include user data in a binary and flash it into CFLASH from address 0x00300000. I need to verify it and don't know how to do it. So, my question is:

 

1. How to read data from the address 0x00300000?

 

Thanks in advance.

Labels (1)
0 Kudos
1 Solution
1,520 Views
ericg
Contributor II

Thanks for the helpful answer David. I've already solved it. The reason it wasn't working is that 0x00300000 is a reserved space and it was reading all 0xFF. After flashing user data in different sector and reading from different address space works. So, I'm not sure whether it is possible to use reserved space or not. Also, other ways of reading data from CFLASH solutions works just fine too. It is just like reading from any other memory. Here are the examples:

1. memcpy (test, (char*)(0x002E0000), sizeof(test));

2.  uint8_t *pointer;

     pointer = (uint8_t *) 0x002E0000;

     for(i = 0; i < sizeof(test); i++)

          test[i] = *pointer;

          pointer++;

     }



View solution in original post

0 Kudos
2 Replies
1,520 Views
davidtosenovjan
NXP TechSupport
NXP TechSupport

vuint32_t read_data = 0;

read_data = *(vuint32_t*)(0x00300000);

1,521 Views
ericg
Contributor II

Thanks for the helpful answer David. I've already solved it. The reason it wasn't working is that 0x00300000 is a reserved space and it was reading all 0xFF. After flashing user data in different sector and reading from different address space works. So, I'm not sure whether it is possible to use reserved space or not. Also, other ways of reading data from CFLASH solutions works just fine too. It is just like reading from any other memory. Here are the examples:

1. memcpy (test, (char*)(0x002E0000), sizeof(test));

2.  uint8_t *pointer;

     pointer = (uint8_t *) 0x002E0000;

     for(i = 0; i < sizeof(test); i++)

          test[i] = *pointer;

          pointer++;

     }



0 Kudos