MPC5674f Flash write

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

MPC5674f Flash write

2,622 次查看
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);

标记 (1)
2 回复数

2,246 次查看
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 

2,246 次查看
mayconkruger
Contributor I

Thanks David,

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

0 项奖励
回复