MPC5748G Flash example code question DisableFlashControllerCache function

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

MPC5748G Flash example code question DisableFlashControllerCache function

Jump to solution
2,605 Views
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 Kudos
Reply
1 Solution
2,563 Views
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

View solution in original post

0 Kudos
Reply
3 Replies
2,564 Views
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 Kudos
Reply
2,559 Views
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 Kudos
Reply
2,554 Views
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 Kudos
Reply