A problem in a PDL SMIF library

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

cross mob
lock attach
Attachments are accessible only for community members.
Gintaras
Level 2
Level 2
10 replies posted 25 sign-ins 10 sign-ins

Hi,

I tried to use Cy_SMIF_MemWrite() with ModusToolbox and it always returned a timeout error.

I have QSPI FRAM configured for full QSPI operation.

The problem is in Cy_SMIF_MemCmdReadStatus() function as it only uses CY_SMIF_WIDTH_SINGLE for WIP flag reading.

I have modified the function and it now works correctly:

cy_en_smif_status_t Cy_SMIF_MemCmdReadStatus(SMIF_Type *base,
cy_stc_smif_mem_config_t const *memDevice,
uint8_t *status,
uint8_t command,
cy_stc_smif_context_t const *context)
{
cy_en_smif_status_t result = CY_SMIF_CMD_NOT_FOUND;

/* Read the memory status register */
result = Cy_SMIF_TransmitCommand( base, command, memDevice->deviceCfg->readStsRegWipCmd->cmdWidth,
NULL, CY_SMIF_CMD_WITHOUT_PARAM,
CY_SMIF_WIDTH_NA, memDevice->slaveSelect,
CY_SMIF_TX_NOT_LAST_BYTE, context);

if (CY_SMIF_SUCCESS == result)
{
result = Cy_SMIF_ReceiveDataBlocking( base, status,
CY_SMIF_READ_ONE_BYTE, memDevice->deviceCfg->readStsRegWipCmd->cmdWidth, context);
}

return(result);
}

0 Likes
1 Solution
DheerajK_81
Moderator
Moderator
Moderator
First comment on KBA First comment on blog 5 questions asked

Hello @Gintaras ,

I am not sure why the transfer width was hardcoded to CY_SMIF_WIDTH_SINGLE. It should be taking the transfer widths from the values configured in the QSPI configurator. 

Also, this is not the only function that might be affected by this. You might want to do the same changes to Cy_SMIF_MemCmdWriteStatus as well. 

Thanks for pointing this out. The modifications you have made seem right. I will pass this on to the internal team for evaluation. 

Regards,
Dheeraj

View solution in original post

0 Likes
1 Reply
DheerajK_81
Moderator
Moderator
Moderator
First comment on KBA First comment on blog 5 questions asked

Hello @Gintaras ,

I am not sure why the transfer width was hardcoded to CY_SMIF_WIDTH_SINGLE. It should be taking the transfer widths from the values configured in the QSPI configurator. 

Also, this is not the only function that might be affected by this. You might want to do the same changes to Cy_SMIF_MemCmdWriteStatus as well. 

Thanks for pointing this out. The modifications you have made seem right. I will pass this on to the internal team for evaluation. 

Regards,
Dheeraj

0 Likes