diff options
author | Giovanni Di Sirio <gdisirio@gmail.com> | 2016-05-26 08:54:46 +0000 |
---|---|---|
committer | Giovanni Di Sirio <gdisirio@gmail.com> | 2016-05-26 08:54:46 +0000 |
commit | 96f3718cc7e228e4b365cb2cba3d15f6451a8e19 (patch) | |
tree | 52d1ef6f92edfcea4f6d0618805c54f753d03b23 /testhal/STM32/STM32L4xx/QSPI-N25Q128/main.c | |
parent | 249d014e0bc24c1341a09c9af4cf65b12161993e (diff) | |
download | ChibiOS-96f3718cc7e228e4b365cb2cba3d15f6451a8e19.tar.gz ChibiOS-96f3718cc7e228e4b365cb2cba3d15f6451a8e19.tar.bz2 ChibiOS-96f3718cc7e228e4b365cb2cba3d15f6451a8e19.zip |
Flashing driver over QSPI working but not complete, it needs more work.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@9524 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'testhal/STM32/STM32L4xx/QSPI-N25Q128/main.c')
-rw-r--r-- | testhal/STM32/STM32L4xx/QSPI-N25Q128/main.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/testhal/STM32/STM32L4xx/QSPI-N25Q128/main.c b/testhal/STM32/STM32L4xx/QSPI-N25Q128/main.c index 2f85ec5d2..bd506f9e8 100644 --- a/testhal/STM32/STM32L4xx/QSPI-N25Q128/main.c +++ b/testhal/STM32/STM32L4xx/QSPI-N25Q128/main.c @@ -112,16 +112,32 @@ int main(void) { if (err != FLASH_NO_ERROR)
chSysHalt("erase error");
+ /* Verifying the erase operation.*/
+ err = flashVerifyErase(&m25q, 0);
+ if (err != FLASH_NO_ERROR)
+ chSysHalt("verify erase error");
+
/* Programming a pattern.*/
err = flashProgram(&m25q, 0, pattern, 128);
if (err != FLASH_NO_ERROR)
chSysHalt("program error");
+ /* Verifying the erase operation.*/
+ err = flashVerifyErase(&m25q, 0);
+ if (err != FLASH_ERROR_VERIFY)
+ chSysHalt("verify non-erase error");
+
/* Reading it back.*/
err = flashRead(&m25q, 0, buffer, 128);
if (err != FLASH_NO_ERROR)
chSysHalt("read error");
+ /* Erasing again.*/
+ (void) flashStartEraseSector(&m25q, 0);
+ err = flashWaitErase((BaseFlash *)&m25q);
+ if (err != FLASH_NO_ERROR)
+ chSysHalt("erase error");
+
/*
* Normal main() thread activity, in this demo it does nothing.
*/
|