mNAND Refresh Utility (mnand_rfsh)#

The mNAND Refresh utility, mnand_rfsh, ensures that eMMC mNAND blocks are refreshed by issuing refresh commands at an appropriate rate.

An mNAND refresh command may take a substantial amount of time to execute, depending on manufacturer implementation and mNAND’s internal state, and so may cause the device’s primary application to “stutter.” For this reason, the utility can operate in three different modes:

  • Session Mode: Intended for use when the device is initialized and may be interacting with a user; has a limited impact on device performance.

Once the utility is started it remains loaded and wakes up at a predefined interval. Each time the utility wakes up it determines the actual refresh progress and issues zero or more mNAND refresh commands, as necessary, to make actual refresh progress converge with scheduled refresh progress.

The wake-up interval may be set from chip data (stored in the mNAND supporting library based on part number) or by an argument provided to the utility. It is typically long (e.g., 3600 seconds) to limit the impact of refresh processing on user interaction. The interval between refresh commands sent within a single wake-up session is also long (e.g. 20 seconds) for the same reason.

  • Catch-Up Mode: Intended for use when the device is being shut down and is not interacting with a user; can make refresh progress converge much more quickly than Session Mode, but keeps the mNAND device busy while running, so concurrent read and write access by other applications is not recommended.

The utility determines how many refresh commands are required to make refresh progress converge to the scheduled refresh progress. It then issues the required number of refresh commands with a predefined interval after each command. The interval between refresh commands is typically short (e.g. 100 msec) to provide rapid convergence.

Because a device typically must complete shutdown within a limited amount of time, Catch-Up Mode provides an optional command line switch to limit the utility’s run time. When the run time limit is reached the utility stops running even if it has not issued the required number of refresh commands. Refresh catch-up must continue the next time the device is turned on.

  • Blind Mode: A legacy mode implemented in previous projects. The utility remains loaded, wakes up at a predefined interval, and issues one refresh command each time it wakes up. It does not measure actual refresh progress or try to make actual refresh progress converge with scheduled refresh progress.