AnsweredAssumed Answered

Vybrid MQX interfacing QSPI1

Question asked by Thomas Fredriksen on Aug 17, 2015
Latest reply on Oct 14, 2015 by Thomas Fredriksen

I am attempting to access QSPI1 on my twrvf610gs10 development kit running MQX 4.0.1.

 

After searching through the BSP, I have found that the IOMUX is not set for this device, neither is the chip settings in "init_qspi.c".

 

I have tried to copy the settings from QSPI0_A in SDR-mode, neglecting QSPI0_B since it doesn't exist. As a result, I have nulled QSPI1_A1, QSPI1_B0 and QSPI1_B1 devices (see "_bsp_quadspi1_flash_device" below) in the same fashion as with the existing QSPI0 device.

 

I ahve also added the "BSPCFG_ENABLE_QUADSPI1" flag to "user_config.g", and added the following lines to "_bsp_init(void)" in "init_bsp.c":

 

#if BSPCFG_ENABLE_QUADSPI1 && !BSPCFG_ENABLE_FLASHX_QUADSPI1

    _io_qspi_install("qspi1:", &_bsp_quadspi1_init);

#endif

 

My question is: What am I doing wrong? Are there any special considerations I have to make when accessing QSPI1?

 

**************************** C-Code ****************************

 

static QuadSPI_FLASH_INFO_STRUCT _bsp_quadspi1_flash_device[] = {

  {

  0, /** Start address */

  64, /** Number of sectors */

  0x40000 /** Sector size */

  }, {

  0x1000000, /** Start address */

  0, /** Number of sectors */

  0 /** Sector size */

  }, {

  0x1000000, /** Start address */

  0, /** Number of sectors */

  0 /** Sector size */

  }, {

  0x1000000, /** Start address */

  0, /** Number of sectors */

  0 /** Sector size */

  }

};

 

static QuadSPI_FLASH_CMD_STRUCT _bsp_quadspi1_flash_cmd =

{

    .READ_CMD = {0x0403, 0x0818, 0x1c80},

    .DUAL_READ_CMD = {0x04BB, 0x0918, 0x0D04, 0x1D80},

    .QUAD_READ_CMD = {0x04EB, 0x0A18, 0x0E06, 0x1E80},

    .DDR_READ_CMD = {0x040D, 0x2818, 0x2CFF, 0x0C02, 0x3880},

    .DDR_DUAL_READ_CMD = {0x04BD, 0x2918, 0x2DFF, 0x0C04, 0x3980},

    .DDR_QUAD_READ_CMD = {0x04ED, 0x2A18, 0x30FF, 0x0E06, 0x3A80},

};

 

static const QuadSPI_INIT_STRUCT _bsp_quadspi1_init_data = {

    1,                                  /* QSPI controller id */

    QuadSPI_CLK_SDR_MODE,               /* Clock Mode */

    QuadSPI_SINGLE_MODE,                /* IO Mode */

    33000000,                           /* Serial Clock: Read */

    33000000,                           /* Serial Clock: Write */

    QuadSPI_PAGE_256,                   /* Page size */

    _bsp_quadspi1_flash_device,         /* flash device information */

    &_bsp_quadspi1_flash_cmd,           /* flash command */

    FALSE,                              /* Parallel mode */

    3,                                  /* flash CS hold time */

    3,                                  /* flash CS setup time */

};

 

const QSPI_INIT_STRUCT _bsp_quadspi1_init = {

    &_qspi_quadspi_devif,               /* Low level driver interface */

    &_bsp_quadspi1_init_data,           /* Low level driver init data */

};

 

************************** C-Code end **************************

Outcomes