Using a Serial NOR Device
When used with a serial NOR device, the NOR driver is three layered, as depicted in the figure below. The generic NOR driver, as always, provides sector abstraction and performs wear-leveling (to make certain all blocks are used equally). Below this, the physical-layer driver implements a particular command set to read and program the flash and erase blocks. Lastly, a BSP implements function to communicate with the device over SPI. Device commands are executed though this BSP.
Figure - NOR driver architecture (serial NOR flash)