aboutsummaryrefslogtreecommitdiffstats
path: root/testhal
diff options
context:
space:
mode:
Diffstat (limited to 'testhal')
-rw-r--r--testhal/STM32/STM32F3xx/SPI-N25Q128/Makefile12
-rw-r--r--testhal/STM32/STM32F3xx/SPI-N25Q128/main.c15
2 files changed, 11 insertions, 16 deletions
diff --git a/testhal/STM32/STM32F3xx/SPI-N25Q128/Makefile b/testhal/STM32/STM32F3xx/SPI-N25Q128/Makefile
index da75f7dc1..bc34444bd 100644
--- a/testhal/STM32/STM32F3xx/SPI-N25Q128/Makefile
+++ b/testhal/STM32/STM32F3xx/SPI-N25Q128/Makefile
@@ -98,7 +98,7 @@ include $(CHIBIOS)/os/hal/osal/rt/osal.mk
include $(CHIBIOS)/os/rt/rt.mk
include $(CHIBIOS)/os/common/ports/ARMCMx/compilers/GCC/mk/port_v7m.mk
# Other files (optional).
-include $(CHIBIOS)/os/ex/Micron/n25q128_spi.mk
+include $(CHIBIOS)/os/ex/Micron/m25q.mk
include $(CHIBIOS)/os/ex/subsystems/mfs/mfs.mk
# Define linker script file here
@@ -113,8 +113,8 @@ CSRC = $(STARTUPSRC) \
$(HALSRC) \
$(PLATFORMSRC) \
$(BOARDSRC) \
- $(N25Q128SRC) \
- $(MFSSRC) \
+ $(STREAMSSRC) \
+ $(M25QSRC) \
main.c
# C++ sources that can be compiled in ARM or THUMB mode depending on the global
@@ -147,8 +147,8 @@ ASMXSRC = $(STARTUPASM) $(PORTASM) $(OSALASM)
INCDIR = $(CHIBIOS)/os/license \
$(STARTUPINC) $(KERNINC) $(PORTINC) $(OSALINC) \
- $(HALINC) $(PLATFORMINC) $(BOARDINC) \
- $(N25Q128INC) $(MFSINC)
+ $(HALINC) $(PLATFORMINC) $(BOARDINC) $(M25QINC) \
+ $(STREAMSINC) $(CHIBIOS)/os/various
#
# Project, sources and paths
@@ -198,7 +198,7 @@ CPPWARN = -Wall -Wextra -Wundef
#
# List all user C define here, like -D_DEBUG=1
-UDEFS = -DCHPRINTF_USE_FLOAT=1
+UDEFS = -DCHPRINTF_USE_FLOAT=1 -DJESD216_BUS_MODE=JESD216_BUS_MODE_SPI
# Define ASM defines here
UADEFS =
diff --git a/testhal/STM32/STM32F3xx/SPI-N25Q128/main.c b/testhal/STM32/STM32F3xx/SPI-N25Q128/main.c
index daababdf8..ebdadf1d8 100644
--- a/testhal/STM32/STM32F3xx/SPI-N25Q128/main.c
+++ b/testhal/STM32/STM32F3xx/SPI-N25Q128/main.c
@@ -17,7 +17,7 @@
#include "ch.h"
#include "hal.h"
-#include "n25q128_spi.h"
+#include "m25q.h"
/*
* Maximum speed SPI configuration (18MHz, CPHA=0, CPOL=0, MSb first).
@@ -33,7 +33,7 @@ static const SPIConfig hs_spicfg = {
/*
* Flash driver configuration.
*/
-static const N25Q128Config flashcfg = {
+static const M25QConfig flashcfg = {
&SPID2,
&hs_spicfg
};
@@ -41,7 +41,7 @@ static const N25Q128Config flashcfg = {
/*
* Flash driver object.
*/
-static N25Q128Driver flash;
+static M25QDriver flash;
/*
* Generic buffer.
@@ -111,13 +111,8 @@ int main(void) {
/*
* Initializing and starting flash driver.
*/
- n25q128ObjectInit(&flash);
- n25q128Start(&flash, &flashcfg);
-
- /*
- * Reading flash identifier.
- */
- n25q128ReadId(&flash, buffer, 17);
+ m25qObjectInit(&flash);
+ m25qStart(&flash, &flashcfg);
/* Programming a pattern.*/
err = flashProgram(&flash, 0, pattern, 128);