Skip to content

Commit 75f3afb

Browse files
committed
QSPI test should use defined QSPI pins
Example: "NUCLEO_L4R5ZI": { "target.device_has_add": ["QSPI"], "target.components": ["QSPIF"], "drivers.qspi_io0": "PE_12", "drivers.qspi_io1": "PB_0", "drivers.qspi_io2": "PE_14", "drivers.qspi_io3": "PE_15", "drivers.qspi_sck": "PB_10", "drivers.qspi_csn": "PA_2", "target.macros_add": ["QSPI_FLASH_CHIP=MX25R6435F"], "qspif.QSPI_FREQ": "8000000" },
1 parent 06d24d2 commit 75f3afb

File tree

2 files changed

+28
-6
lines changed

2 files changed

+28
-6
lines changed

TESTS/mbed_hal/qspi/flash_configs/flash_configs.h

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,27 @@
1717
#ifndef MBED_FLASH_CONFIGS_H
1818
#define MBED_FLASH_CONFIGS_H
1919

20+
enum MemoryType {
21+
MX25R6435F,
22+
N25Q128A,
23+
MT25Q
24+
};
25+
26+
#if defined(QSPI_FLASH_CHIP)
27+
28+
#if (QSPI_FLASH_CHIP == MX25R6435F)
29+
#include "MX25RXX35F_config.h"
30+
31+
#elif (QSPI_FLASH_CHIP == N25Q128A)
32+
#include "N25Q128A_config.h"
33+
34+
#elif (QSPI_FLASH_CHIP == MT25Q)
35+
#include "MT25Q_config.h"
36+
37+
#endif
38+
39+
#else // QSPI_FLASH_CHIP not defined
40+
2041
#if defined(TARGET_DISCO_L475VG_IOT01A)
2142
#include "MX25RXX35F_config.h" // MX25R6435F
2243

@@ -88,5 +109,6 @@
88109
#include "S25FL128S_config.h"
89110

90111
#endif
112+
#endif // QSPI_FLASH_CHIP
91113
#endif // MBED_FLASH_CONFIGS_H
92114

TESTS/mbed_hal/qspi/main.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -70,12 +70,12 @@ uint8_t rx_buf[DATA_SIZE_1024];
7070

7171

7272
// some target defines QSPI pins as integers thus conversion needed
73-
#define QPIN_0 static_cast<PinName>(QSPI_FLASH1_IO0)
74-
#define QPIN_1 static_cast<PinName>(QSPI_FLASH1_IO1)
75-
#define QPIN_2 static_cast<PinName>(QSPI_FLASH1_IO2)
76-
#define QPIN_3 static_cast<PinName>(QSPI_FLASH1_IO3)
77-
#define QSCK static_cast<PinName>(QSPI_FLASH1_SCK)
78-
#define QCSN static_cast<PinName>(QSPI_FLASH1_CSN)
73+
#define QPIN_0 static_cast<PinName>(MBED_CONF_DRIVERS_QSPI_IO0)
74+
#define QPIN_1 static_cast<PinName>(MBED_CONF_DRIVERS_QSPI_IO1)
75+
#define QPIN_2 static_cast<PinName>(MBED_CONF_DRIVERS_QSPI_IO2)
76+
#define QPIN_3 static_cast<PinName>(MBED_CONF_DRIVERS_QSPI_IO3)
77+
#define QSCK static_cast<PinName>(MBED_CONF_DRIVERS_QSPI_SCK)
78+
#define QCSN static_cast<PinName>(MBED_CONF_DRIVERS_QSPI_CSN)
7979

8080

8181
static uint32_t gen_flash_address()

0 commit comments

Comments
 (0)