MPC5748G Flash example code question DisableFlashControllerCache function

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

MPC5748G Flash example code question DisableFlashControllerCache function

跳至解决方案
2,612 次查看
MattJCole
Contributor V

I have read through the data sheet for the processor, and I am still do not know what sections in flash the P0_BFEN, P1_BFEN, P2_BFEN control. I know I need to clear the bit before I write to flash and restore the bit after I am done writing to flash. Below are the flash addresses I will be writing to. What flash addresses does P0_BFEN, P1_BFEN, and P2_BFEN control

  1. 0x00FD8000 - 0x00FD8018
  2. 0x00FE0000 - 0x00FE0018
  3. 0x00FF0000 - 0x00FFFFFF
  4. 0x01000000 - 0x012BFFFF
  5. 0x012C0000 - 0x0157FFFF

 

0 项奖励
回复
1 解答
2,570 次查看
lukaszadrapa
NXP TechSupport
NXP TechSupport

Hi,

In the past, I got confirmation that it is not necessary to explicitly clear the read line buffers:

“the flash controller samples the prog/erase status sidebands and uses these to automatically clear the read line buffers whenever a program or erase are in progress.”

And there’s this note in reference manuals for the MPC57xx devices which confirms it:

“To clear the flash controller line read buffers, issue an interlock
write command to a valid flash memory address. There will not
be an actual flash program operation performed, but the flash
controller mini-cache will be cleared as a side effect of
executing the command.”

That means the interlock write issued during program/erase operation clears the buffer.

So, it’s safe to remove the functions which disable/restore the buffer.

And to answer your question – you are not configuring PFCRn registers for certain addresses, you are configuring PFCRn registers for bus masters. This table should explain it:

lukaszadrapa_0-1636378067853.png


Regards,
Lukas

在原帖中查看解决方案

0 项奖励
回复
3 回复数
2,571 次查看
lukaszadrapa
NXP TechSupport
NXP TechSupport

Hi,

In the past, I got confirmation that it is not necessary to explicitly clear the read line buffers:

“the flash controller samples the prog/erase status sidebands and uses these to automatically clear the read line buffers whenever a program or erase are in progress.”

And there’s this note in reference manuals for the MPC57xx devices which confirms it:

“To clear the flash controller line read buffers, issue an interlock
write command to a valid flash memory address. There will not
be an actual flash program operation performed, but the flash
controller mini-cache will be cleared as a side effect of
executing the command.”

That means the interlock write issued during program/erase operation clears the buffer.

So, it’s safe to remove the functions which disable/restore the buffer.

And to answer your question – you are not configuring PFCRn registers for certain addresses, you are configuring PFCRn registers for bus masters. This table should explain it:

lukaszadrapa_0-1636378067853.png


Regards,
Lukas

0 项奖励
回复
2,566 次查看
MattJCole
Contributor V

That makes sense. Thought you where controlling the sections of flash you are actually contorting the bus from the processor to flash. One last question. How do you perform an interlock write?  

0 项奖励
回复
2,561 次查看
lukaszadrapa
NXP TechSupport
NXP TechSupport

That's a part of program and erase sequence:

lukaszadrapa_0-1636381217581.png

 

lukaszadrapa_1-1636381235378.png

 

And here is a description how to perform dummy interlock write:

lukaszadrapa_2-1636381317103.png

 

0 项奖励
回复