Use emFile for FAT on SD, and use QSPI HAL to initialize SPI ROM

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

cross mob
KyleLin
Level 3
Level 3
Distributor - Weikeng(GC)
First solution authored 50 sign-ins First like received

Hi ,

  In order to support FAT on uSD, we can use emfile driver.

  However, I met a problem that I can’t use QSPI HAL to init SPI rom successfully after using emfile for uSD only.

  I’m not sure if it’s a driver limitation or config setting problem.

  Could you help on that to use emFile for uSD and SPI access at the same time?

Regards,

Kyle

0 Likes
2 Replies
Ekta_N
Moderator
Moderator
Moderator
750 replies posted First like given 250 solutions authored

Hi @KyleLin 

You can have a look at the example: https://github.com/Infineon/mtb-example-psoc6-filesystem-emfile-freertos 

This example uses the Arm® Cortex®-M4 (CM4) CPU of PSoC™ 6 MCU to execute an emFile filesystem task.

At device reset, the default Cortex®-M0+ (CM0+) application enables the CM4 CPU and configures the CM0+ CPU to go to sleep. The CM4 CPU formats the storage device, reads a file and prints its content to the UART terminal, overwrites the file with a message, and deletes the file if requested via a user button press. The storage device can be either an SD card or a QSPI NOR flash.

As per my understanding of your question, I think you are facing issues when using both simultaneously.

Could you please share your project or the exact issue/ error that you are observing?

Thanks

Ekta

 

0 Likes
KyleLin
Level 3
Level 3
Distributor - Weikeng(GC)
First solution authored 50 sign-ins First like received

Hi Ekta,

In original, we had made sure QSPI init successfully. Also we can send SPI command to read JEDEC ID correctly.

After below actions, we can’t get QSPI init successfully.

1. add emFile module
2. update partial Psoc6 hal drivers for emFile compile pass (from 1.30 to 1.60)
3. add sd card present check and init in main
  4. save debug logs to the file named CCD_Uart_Log.txt on SD card, it’s ok.

UART log:

QSPI init code

 

Board index=16 (pulldown=867V, pullup=2430V, none=1653V), Revision=5

Init_Gpio_setting_Ccd_Swd_Uart_Signal_Check start

Init_Gpio_setting_Ccd_Swd_Uart_Signal_Check end

qspi_init_signals:

 

================================================================================

 

FAIL: QSPI Init FAIL!

Error Code: 0x04020301

 

================================================================================

FS_init done

Done with initialization.

    // Initialize QSPI peripheral with appropriate GPIOs

    result = cyhal_qspi_init(&qspi_object, SMIF_QSPI_DATA0_PIN, SMIF_QSPI_DATA1_PIN, NC, NC, NC, NC, NC, NC,

                             SMIF_QSPI_CLK0_PIN, SMIF_QSPI_CS_PIN_, QSPI_BUS_FREQUENCY_HZ, 0);

    if (result != CY_RSLT_SUCCESS)

    {

        check_status("QSPI Init FAIL!", (uint32_t)result);

    }

    else

    {

        printf("QSPI Init Success!\n");

    }

 

Thanks,

Kyle

0 Likes