CTS-SAT-1-OBC-Firmware
Loading...
Searching...
No Matches
flash_benchmark.c File Reference
#include "main.h"
#include "littlefs/flash_benchmark.h"
#include "littlefs/flash_driver.h"
#include <string.h>
#include <stdio.h>
Include dependency graph for flash_benchmark.c:

Functions

uint8_t FLASH_benchmark_erase_write_read (uint8_t chip_num, uint32_t test_data_address, uint16_t test_data_length, char *response_str, uint16_t response_str_len)
 Benchmarks the erase/read/write operations on the flash memory module.
 

Variables

SPI_HandleTypeDef * hspi_ptr = &hspi1
 

Function Documentation

◆ FLASH_benchmark_erase_write_read()

uint8_t FLASH_benchmark_erase_write_read ( uint8_t chip_num,
uint32_t test_data_address,
uint16_t test_data_length,
char * response_str,
uint16_t response_str_len )

Benchmarks the erase/read/write operations on the flash memory module.

Parameters
chip_numChip number to use.
test_data_addressAddress to erase, write, and then read back from.
test_data_lengthMust be <= 512. Otherwise, the verification will fail.
response_str
response_str_len
Returns
0 on success. 1 if erase failed. 2 if write failed. 3 if read failed. 4 if verify failed.

This function will erase the flash memory, write test data to it, read it back, and verify the read data. The test data is a sequence of bytes from 0 to 255. The response_str is valid whether or not there are errors.

Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ hspi_ptr

SPI_HandleTypeDef* hspi_ptr = &hspi1