Skip to content

Commit

Permalink
QSPI test should use defined QSPI pins
Browse files Browse the repository at this point in the history
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"
        },
  • Loading branch information
jeromecoutant committed Sep 10, 2019
1 parent 4a20552 commit 5d86560
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 6 deletions.
22 changes: 22 additions & 0 deletions TESTS/mbed_hal/qspi/flash_configs/flash_configs.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,27 @@
#ifndef MBED_FLASH_CONFIGS_H
#define MBED_FLASH_CONFIGS_H

enum MemoryType {
MX25R6435F,
N25Q128A,
MT25Q
};

#if defined(QSPI_FLASH_CHIP)

#if (QSPI_FLASH_CHIP == MX25R6435F)
#include "MX25RXX35F_config.h"

#elif (QSPI_FLASH_CHIP == N25Q128A)
#include "N25Q128A_config.h"

#elif (QSPI_FLASH_CHIP == MT25Q)
#include "MT25Q_config.h"

#endif

#else // QSPI_FLASH_CHIP not defined

#if defined(TARGET_DISCO_L475VG_IOT01A)
#include "MX25RXX35F_config.h" // MX25R6435F

Expand Down Expand Up @@ -88,5 +109,6 @@
#include "S25FL128S_config.h"

#endif
#endif // QSPI_FLASH_CHIP
#endif // MBED_FLASH_CONFIGS_H

12 changes: 6 additions & 6 deletions TESTS/mbed_hal/qspi/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,12 +70,12 @@ uint8_t rx_buf[DATA_SIZE_1024];


// some target defines QSPI pins as integers thus conversion needed
#define QPIN_0 static_cast<PinName>(QSPI_FLASH1_IO0)
#define QPIN_1 static_cast<PinName>(QSPI_FLASH1_IO1)
#define QPIN_2 static_cast<PinName>(QSPI_FLASH1_IO2)
#define QPIN_3 static_cast<PinName>(QSPI_FLASH1_IO3)
#define QSCK static_cast<PinName>(QSPI_FLASH1_SCK)
#define QCSN static_cast<PinName>(QSPI_FLASH1_CSN)
#define QPIN_0 static_cast<PinName>(MBED_CONF_DRIVERS_QSPI_IO0)
#define QPIN_1 static_cast<PinName>(MBED_CONF_DRIVERS_QSPI_IO1)
#define QPIN_2 static_cast<PinName>(MBED_CONF_DRIVERS_QSPI_IO2)
#define QPIN_3 static_cast<PinName>(MBED_CONF_DRIVERS_QSPI_IO3)
#define QSCK static_cast<PinName>(MBED_CONF_DRIVERS_QSPI_SCK)
#define QCSN static_cast<PinName>(MBED_CONF_DRIVERS_QSPI_CSN)


static uint32_t gen_flash_address()
Expand Down

0 comments on commit 5d86560

Please sign in to comment.