how to init QSPI in PSOC 6

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
victor2022
Level 2
Level 2
10 questions asked 5 replies posted 10 sign-ins

Hi, Friends

    I am using QSPI for external flash read/write. I call 

result = cy_serial_flash_qspi_init(&SFDP_SlaveSlot_1_config, CYBSP_QSPI_D0,
CYBSP_QSPI_D1, CYBSP_QSPI_D2, CYBSP_QSPI_D3, NC, NC, NC, NC,
CYBSP_QSPI_SCK, CYBSP_QSPI_SS, QSPI_BUS_FREQUENCY_HZ);

to initialize QSPI, looks like it calls huge code to initialize and it fails at :

const cyhal_resource_pin_mapping_t *sclk_map = _CYHAL_UTILS_GET_RESOURCE(cfg->gpios.sclk, cyhal_pin_map_smif_spi_clk);
/* Can't work without sclk pin */
if (NULL == sclk_map)
{
result = CYHAL_QSPI_RSLT_ERR_PIN;
}
if ((CY_RSLT_SUCCESS == result) && (false == obj->dc_configured))
{
result = _cyhal_qspi_check_pin_and_reserve(sclk_map, CYHAL_PIN_MAP_DRIVE_MODE_SMIF_SPI_CLK);
}
#endif
if (CY_RSLT_SUCCESS == result)

in function of 

static cy_rslt_t _cyhal_qspi_init_common(cyhal_qspi_t *obj, const cyhal_qspi_configurator_t *cfg, uint32_t hz)

I checked the document in "MTB CAT1 Peripheral driver library". The initialize shall not be so complicated, right?

what is wrong with my configuration? Thanks in advance.

Victor

0 Likes
1 Solution
Arpit_S
Moderator
Moderator
Moderator
100 solutions authored 250 sign-ins 10 likes given

Hi @victor2022 ,

 

Please refer to this CE https://github.com/Infineon/mtb-example-psoc6-qspi-readwrite-sfdp This code example demonstrates interfacing with an external NOR flash memory in Quad-SPI mode using the serial memory interface (SMIF) block in PSoC™ 6 MCU. This example uses the serial flash discoverable parameters (SFDP) standard to auto-discover the flash parameters and the commands for read, program, and erase operations.

Thanks!
Kind Regards

Arpit Srivastav

View solution in original post

0 Likes
1 Reply
Arpit_S
Moderator
Moderator
Moderator
100 solutions authored 250 sign-ins 10 likes given

Hi @victor2022 ,

 

Please refer to this CE https://github.com/Infineon/mtb-example-psoc6-qspi-readwrite-sfdp This code example demonstrates interfacing with an external NOR flash memory in Quad-SPI mode using the serial memory interface (SMIF) block in PSoC™ 6 MCU. This example uses the serial flash discoverable parameters (SFDP) standard to auto-discover the flash parameters and the commands for read, program, and erase operations.

Thanks!
Kind Regards

Arpit Srivastav

0 Likes