How to flush the data cache in front of the Flash chip

philip
Posts: 12
Joined: Thu Jan 14, 2016 11:47 am

How to flush the data cache in front of the Flash chip

Postby philip » Tue May 17, 2016 9:27 am

I'm working on the nodemcu-firmware and I want to modify the contents of flash (easy) and then have this data visible from a regular data load -- this is the hard part.

There is a cache (of some size) that is used to buffer some amount of the flash to use for returning value for load instructions. Thus if you read a 32 bit flash location (originally erased), you get 0xffffffff. Now write 0 to the flash chip. Now read the same location again and you get 0xffffffff. Now go a do a whole load of other stuff, and do the load again and you get 0.

The question is: How can I flush the cache so that I am guaranteed to get the real value on the next read?

Thanks

Who is online

Users browsing this forum: No registered users and 13 guests