aboutsummaryrefslogtreecommitdiffstats
path: root/testhal/STM32
diff options
context:
space:
mode:
Diffstat (limited to 'testhal/STM32')
-rw-r--r--testhal/STM32/STM32L4xx/QSPI-N25Q128/Makefile2
-rw-r--r--testhal/STM32/STM32L4xx/QSPI-N25Q128/main.c19
2 files changed, 16 insertions, 5 deletions
diff --git a/testhal/STM32/STM32L4xx/QSPI-N25Q128/Makefile b/testhal/STM32/STM32L4xx/QSPI-N25Q128/Makefile
index 13da447eb..110783df6 100644
--- a/testhal/STM32/STM32L4xx/QSPI-N25Q128/Makefile
+++ b/testhal/STM32/STM32L4xx/QSPI-N25Q128/Makefile
@@ -5,7 +5,7 @@
# Compiler options here.
ifeq ($(USE_OPT),)
- USE_OPT = -O2 -ggdb -fomit-frame-pointer -falign-functions=16
+ USE_OPT = -O0 -ggdb -fomit-frame-pointer -falign-functions=16
endif
# C specific options here (added to USE_OPT).
diff --git a/testhal/STM32/STM32L4xx/QSPI-N25Q128/main.c b/testhal/STM32/STM32L4xx/QSPI-N25Q128/main.c
index 942629734..5e57497fa 100644
--- a/testhal/STM32/STM32L4xx/QSPI-N25Q128/main.c
+++ b/testhal/STM32/STM32L4xx/QSPI-N25Q128/main.c
@@ -17,7 +17,9 @@
#include "ch.h"
#include "hal.h"
-QSPIConfig qspicfg1 = {
+#include "m25q.h"
+
+const QSPIConfig qspicfg1 = {
NULL,
0
};
@@ -34,6 +36,13 @@ qspi_command_t cmd_read_id = {
uint8_t buffer[512];
+M25QDriver m25q;
+
+const M25QConfig m25qcfg1 = {
+ &QSPID1,
+ &qspicfg1
+};
+
/*
* LED blinker thread, times are in milliseconds.
*/
@@ -76,10 +85,12 @@ int main(void) {
chThdCreateStatic(waThread1, sizeof(waThread1), NORMALPRIO + 1, Thread1, NULL);
/*
- * Starting QSPI driver 1.
+ * Initializing and starting M25Q driver.
*/
- qspiStart(&QSPID1, &qspicfg1);
- qspiReceive(&QSPID1, &cmd_read_id, 17, buffer);
+ m25qObjectInit(&m25q);
+ m25qStart(&m25q, &m25qcfg1);
+// qspiStart(&QSPID1, &qspicfg1);
+// qspiReceive(&QSPID1, &cmd_read_id, 17, buffer);
/*
* Normal main() thread activity, in this demo it does nothing.