Hi, I am currently working with a MPC5674f based board.
I am trying to write to a flash memory block.
The code that writes to the flash memory is also in the same flash , but in a different memory block.
I've been reading the reference manual and concluded that the only way to that would be throught the FLASH CONFIGURATION REGISTER(located 0xC3F8800) described in chapter 11.2.1 of the reference manual.
The problem is I can't seen to write to these registers(Can only read then).
Is there any locking mechanism preventing me to do so?
This is the sample clode used to write in one of the configuration registers.
os_uintptr_t* mcr = (os_uintptr_t*)0xC3F88000;
printf("mcr = 0x0%x\n",*mcr);
*mcr = *mcr | 0x20000000; //ERS
printf("mcr = 0x0%x\n",*mcr);
Hi, I would recommend to see one of following example code
Example MPC5675K Data_flash_program_simple CW210
Example MPC5643L Flash_program_simple CW210
Even though it was written for different device, principle of flash programming is the same. In both cases pay attention to main file.
Also you may use SSD driver from the same place I have just pointed out to someone here:
Thanks David,
I was missing the step where you have to write the password to the flash lock register.