Tomas Vavra

SDIF driver invalid error handling

Discussion created by Tomas Vavra on Nov 22, 2019
Latest reply on Dec 9, 2019 by Felipe García

I am using SDK 2.6.0 with LPCExpresso54618 and running an example lpcxpresso54618_fatfs_sdcard_fatfs.


If the write to the card timeouts or fail for any reason, then i run into an assert in SDIF_TransferHandleData


    1404: assert(handle->data);


Reason for this is interruptFlags & kSDIF_DataTransferStatus is true in SDIF_TransferHandleIRQ but handle->data was already set to NULL by SD_StopTransmission (SDIF_TransferNonBlocking).


How reliable is this driver?


My stack:


lpcxpresso54618_fatfs_sdcard_fatfs LinkServer Debug [C/C++ (NXP Semiconductors) MCU Application]    
    lpcxpresso54618_fatfs_sdcard_fatfs.axf [LPC54618J512 (cortex-m4)]    
        Thread #1 1 (Suspended : Signal : SIGQUIT:Quit)    
            __sys_appexit() at 0x6878    
            SDIF_TransferHandleData() at fsl_sdif.c:1,404 0x5e06    
            SDIF_TransferHandleIRQ() at fsl_sdif.c:1,521 0x5f96    
            SDIO_DriverIRQHandler() at fsl_sdif.c:1,566 0x600c    
            SDIO_IRQHandler() at startup_lpc54618.c:678 0x7ad6    
            <signal handler called>() at 0xfffffff9    
            SDIF_SendCommand() at fsl_sdif.c:729 0x56fe    
            SDIF_TransferNonBlocking() at fsl_sdif.c:1,303 0x5c46    
            SDMMCHOST_TransferFunction() at fsl_sdmmc_host.c:137 0x2b1c    
            SD_StopTransmission() at fsl_sd.c:374 0xa86    
            SD_Transfer() at fsl_sd.c:421 0xaf2    
            SD_Write() at fsl_sd.c:1,460 0x203e    
            SD_WriteBlocks() at fsl_sd.c:1,654 0x22b4    
            sd_disk_write() at fsl_sd_disk.c:45 0x44ca    
            disk_write() at diskio.c:223 0x7f4c    
            f_write() at ff.c:3,875 0x94d6    
            main() at fatfs_sdcard.c:275 0x688    
    arm-none-eabi-gdb (