MPC5674f Flash write

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

MPC5674f Flash write

1,917件の閲覧回数
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 返答(返信)

1,541件の閲覧回数
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 

1,541件の閲覧回数
mayconkruger
Contributor I

Thanks David,

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

0 件の賞賛
返信