diff options
author | Giovanni Di Sirio <gdisirio@gmail.com> | 2016-05-24 13:57:49 +0000 |
---|---|---|
committer | Giovanni Di Sirio <gdisirio@gmail.com> | 2016-05-24 13:57:49 +0000 |
commit | a3c37f98cce0829b9c1f6e00f01f6060b9494c26 (patch) | |
tree | 08a4f4ca82e1959813d10fb85b0ed2ab565e07ce /testhal/STM32/STM32L4xx/QSPI-N25Q128/main.c | |
parent | b36f9f55856979ae773c8c676c0f6723440e52a1 (diff) | |
download | ChibiOS-a3c37f98cce0829b9c1f6e00f01f6060b9494c26.tar.gz ChibiOS-a3c37f98cce0829b9c1f6e00f01f6060b9494c26.tar.bz2 ChibiOS-a3c37f98cce0829b9c1f6e00f01f6060b9494c26.zip |
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@9508 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 | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/testhal/STM32/STM32L4xx/QSPI-N25Q128/main.c b/testhal/STM32/STM32L4xx/QSPI-N25Q128/main.c index 5e57497fa..51abd65cd 100644 --- a/testhal/STM32/STM32L4xx/QSPI-N25Q128/main.c +++ b/testhal/STM32/STM32L4xx/QSPI-N25Q128/main.c @@ -21,7 +21,7 @@ const QSPIConfig qspicfg1 = {
NULL,
- 0
+ STM32_DCR_FSIZE(24) | STM32_DCR_CSHT(1)
};
qspi_command_t cmd_read_id = {
@@ -63,6 +63,7 @@ static THD_FUNCTION(Thread1, arg) { * Application entry point.
*/
int main(void) {
+ flash_error_t err;
/*
* System initializations.
@@ -89,8 +90,11 @@ int main(void) { */
m25qObjectInit(&m25q);
m25qStart(&m25q, &m25qcfg1);
-// qspiStart(&QSPID1, &qspicfg1);
-// qspiReceive(&QSPID1, &cmd_read_id, 17, buffer);
+
+ /* Reading it back.*/
+ err = flashRead(&m25q, 0, buffer, 128);
+ if (err != FLASH_NO_ERROR)
+ chSysHalt("read error");
/*
* Normal main() thread activity, in this demo it does nothing.
|