From a3c37f98cce0829b9c1f6e00f01f6060b9494c26 Mon Sep 17 00:00:00 2001 From: Giovanni Di Sirio Date: Tue, 24 May 2016 13:57:49 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@9508 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- .../debug/QSPI-N25Q128 (OpenOCD, Flash and Run).launch | 2 +- testhal/STM32/STM32L4xx/QSPI-N25Q128/main.c | 10 +++++++--- 2 files changed, 8 insertions(+), 4 deletions(-) (limited to 'testhal/STM32') diff --git a/testhal/STM32/STM32L4xx/QSPI-N25Q128/debug/QSPI-N25Q128 (OpenOCD, Flash and Run).launch b/testhal/STM32/STM32L4xx/QSPI-N25Q128/debug/QSPI-N25Q128 (OpenOCD, Flash and Run).launch index 5c5c982a2..573a54f12 100644 --- a/testhal/STM32/STM32L4xx/QSPI-N25Q128/debug/QSPI-N25Q128 (OpenOCD, Flash and Run).launch +++ b/testhal/STM32/STM32L4xx/QSPI-N25Q128/debug/QSPI-N25Q128 (OpenOCD, Flash and Run).launch @@ -33,7 +33,7 @@ - + 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. -- cgit v1.2.3