MPC5674f Flash write

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

MPC5674f Flash write

1,346 Views
mayconkruger
Contributor I

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);

Tags (1)
2 Replies

970 Views
davidtosenovjan
NXP TechSupport
NXP TechSupport

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:

Flash and EEPROM DRIVERS mpc5644a 

970 Views
mayconkruger
Contributor I

Thanks David,

I was missing the step where you have to write the password to the flash lock register.

0 Kudos
Reply