Skip to content

Latest commit

 

History

History
85 lines (44 loc) · 2.97 KB

Exercise_3b.md

File metadata and controls

85 lines (44 loc) · 2.97 KB

SPI Flash Test Code

Unfortunately, the SPI Flash we need to test the Key-Value storage system is on backorder. The KVStore only uses the read, write, and erase functions from the SPI Flash subsystem. Create a small simulator so you can test the KVStore. Write a test for your simulator that uses the read, write and erase functions.

Here is the SPI Flash information. https://www.digikey.com/en/products/detail/winbond-electronics/W25Q80DVSNIG-TR/5154948

We are going to use ST�s Standard Peripheral Flash Driver so here is the header file for the code you will need to simulate:

https://drive.google.com/file/d/12dw-pZiKiK1vi4gv49W1x6np5uzCH_cV/view?usp=sharing

Your assignment is to create a small module that compiles and runs on your computer that implements your flash simulator. You will also need a main file to test out your simulator. Important notes: You don�t need a full Flash simulator, only what is necessary to test the KVStore code. You aren�t writing the KVStore code. You do not need to use CPPUTest or other unit test framework. If you are writing more than 50 lines of code, you are going in the wrong direction.

Turn in two source files (simulator and main test)

and send a link to the #assignment-submission channel on Discord. Make sure the files are publicly viewable.

See _main.c sample usage and spi_flash.c simulation.

Write

sFLASH_WriteBuffer simulation:

spi_write_buffer_simulation.png

sFLASH_WriteBuffer simulation before write:

sFLASH_WriteBuffer_sample_before.png

sFLASH_WriteBuffer simulation after write:

sFLASH_WriteBuffer_sample_after.png

Read

sFLASH_ReadBuffer simulation, before:

spi_read_buffer_simulation_BEFORE.png

sFLASH_ReadBuffer simulation:

spi_read_buffer_simulation.png

sFLASH_ReadBuffer simulation, before edit:

spi_read_buffer_simulation_before_edit.png

sFLASH_ReadBuffer simulation, before edit, detail:

spi_read_buffer_simulation_before_edit_detail.png

sFLASH_ReadBuffer simulation, after edit:

spi_read_buffer_simulation_after_edit.png

Erase

sFLASH_EraseBulk

sFLASH_EraseBulk_after_read.png

sFLASH_EraseBulk before read:

sFLASH_EraseBulk_before_read.png

<< Exercise 3a -- Assignments -- Exercise 4 >>