cancel
Showing results for 
Search instead for 
Did you mean: 

ModusToolbox AnyCloud SDK

New Contributor II

hello,

i've succesfully tried and reproduced the example called "qspi_read_write_using_sfdp".

When i'm importing the rights function in my project, the init function fails (cy_serial_flash_qspi_init).

When i'm digging into the details, it fails when calling Cy_SMIF_MemInit which return CY_SMIF_SFDP_SS0_FAILED

i've compared everything, and i'm not able to find what i'm doing wrong.

 

is there anybody who experienced the same issue ? thanks

0 Likes
Reply
3 Replies
Moderator
Moderator

Hello @ELA_2836231 ,

Can you please let me know the following:

  • The version of ModusToolbox being used
  • The kit you are using
  • The modifications you have done to the code example

The error CY_SMIF_SFDP_SS0_FAILED basically means it failed to initialize the memory slave 0 by auto-detection (SFDP). 

Looking forward to your reply. Please attach the project if possible so that we can look into what's going wrong. 

Regards,
Dheeraj

0 Likes
Reply
New Contributor II

Hello @DheerajK_81 

thanks for your support

  • Modus version : 2.2
  • kit i'm using : CY8CPROTO-062-4343W
  • Modification i've done in the example : 
    • i've copied mem_config_sfdp.c & mem_config_sfdp.h in my project (no modifications)
    • i'm not calling cy_serial_flash_qspi_ini(..) from the main file but from storage_management.c and the initialisation code is provided bellow

 

#include "mem_config_sfdp.h"
#include "cyhal.h"
#include "cybsp.h"
#include "cy_retarget_io.h"
#include "cy_serial_flash_qspi.h"
#include "storage_management.h"
#include "string.h"
#include <stdlib.h>     /* atoi */

uint32_t nonvolatile_memory_init(void)
{
	cy_rslt_t result;
	uint8_t read_signature[PACKET_SIZE];

        uint32_t ext_mem_address = 0x00;
        size_t sectorSize;

	printf("[event]Emulated EEPROM init  \r\n");

	memset(read_signature,0,SIGNATURE_SIZE);

	result = cy_serial_flash_qspi_init(smifMemConfigsSfdp[MEM_SLOT_NUM], 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);
	
    check_status("Serial Flash initialization failed", result);
}

 

 

many thanks for your support, looking forward for guidance

best regards, ELA

0 Likes
Reply
New Contributor II

Hello @DheerajK_81 

thanks for the help.

- Modustoolbox Version : 2.2

- kit is CY8CPROTO-062-4343W

- modifications : 

    - i believe i didn't made modification, i've imported mem_config_sfdp.c and  mem_config_sfdp.h and i'm calling exactly (without no modifications : 

result = cy_serial_flash_qspi_init(smifMemConfigsSfdp[MEM_SLOT_NUM], 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);
    check_status("Serial Flash initialization failed", result);

cy_serial_flash_qspi_init isn't in main but in a function in a file called storage_management_c, this function is listed just here :

 

uint32_t nonvolatile_memory_init(void)
{
	cy_rslt_t result;
	uint8_t read_signature[PACKET_SIZE];

    uint32_t ext_mem_address = 0x00;
    size_t sectorSize;

	printf("[event]Emulated EEPROM init  \r\n");

	memset(read_signature,0,SIGNATURE_SIZE);

	result = cy_serial_flash_qspi_init(smifMemConfigsSfdp[MEM_SLOT_NUM], 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);
	/*if(result!=0)
	{
		printf("Serial Flash initialization failed");
		return pdFALSE;
	}*/
    check_status("Serial Flash initialization failed", result);

 

When i'm compiling, using the example on the same toolchain it works. But in my project, the cy_serial_flash_qspi_init constantly fail.

many thanks again.

best regards
ELA

0 Likes
Reply