39#ifndef W25Q_W25Q_VALIDATION_HPP_
40#define W25Q_W25Q_VALIDATION_HPP_
43#include "W25QFlashQSPI.hpp"
46#define W25Q_VALIDATION_BASE_ADDR ((uint32_t)0x000000u)
49#define W25Q_VALIDATION_SMALL_RANGE_SIZE ((uint32_t)256u)
52#define W25Q_VALIDATION_PATTERN_TEST_SIZE ((uint32_t)256u)
55#define W25Q_VALIDATION_BOUNDARY_TEST_SIZE ((uint32_t)512u)
59 W25Q_VALIDATION_TEST_NONE = 0,
60 W25Q_VALIDATION_TEST_ERASED_STATE,
61 W25Q_VALIDATION_TEST_SMALL_RANGE,
62 W25Q_VALIDATION_TEST_PATTERN,
63 W25Q_VALIDATION_TEST_PAGE_BOUNDARY
64} w25qValidationTestId_t;
68 W25Q_VALIDATION_PHASE_IDLE = 0,
69 W25Q_VALIDATION_PHASE_ERASE,
70 W25Q_VALIDATION_PHASE_FILL,
71 W25Q_VALIDATION_PHASE_VERIFY
72} w25qValidationPhase_t;
76 W25Q_VALIDATION_STATUS_PASS = 0,
77 W25Q_VALIDATION_STATUS_FAIL
78} w25qValidationStatus_t;
134 void recordFailure(w25qValidationTestId_t testId, w25qValidationPhase_t phase,
135 uint32_t offset, uint8_t expectedValue, uint8_t actualValue);
136 void printFailure()
const;
137 static const char *getTestName(w25qValidationTestId_t testId);
138 static const char *getPhaseName(w25qValidationPhase_t phase);
141 bool runErasedStateTest();
144 bool runSmallRangeTest();
147 bool runPatternTest();
150 bool runPageBoundaryTest();
STM32 HAL QUADSPI driver for a Winbond W25Q-series flash chip (Adafruit 5632/5633/5634),...
Destructive validation suite for a W25QFlashQSPI driver – see w25q_validation.hpp's file header for t...
W25QValidation(W25QFlashQSPI &flash)
Constructs the validation suite against an already-initialized driver.
const w25qValidationReport_t * GetReport() const
Gets the most recent validation report without rerunning tests.
const w25qValidationReport_t * RunAll()
Runs every validation test in sequence, stopping at the first failure, printing progress and results ...
: Header for main.c file. This file contains the common defines of the application.
Detailed validation report, persistent for the life of the W25QValidation instance.
uint32_t failedOffset
Byte offset (from W25Q_VALIDATION_BASE_ADDR) where the failure was detected.
uint8_t actualValue
Value actually read back at failedOffset.
uint8_t expectedValue
Value expected to be read back at failedOffset.
w25qValidationTestId_t failedTest
Which test failed, or NONE if status is PASS.
w25qValidationStatus_t status
Overall PASS/FAIL outcome of the last RunAll().
uint32_t testsRun
Count of tests that started running, whether they passed or failed.
w25qValidationPhase_t failedPhase
Which phase of failedTest failed (erase/fill/verify).