[LPC55S6x] SD card SDK: call to f_open() stalls in OSA_SemaphoreWait

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

[LPC55S6x] SD card SDK: call to f_open() stalls in OSA_SemaphoreWait

318 Views
Alexander_42
Contributor I

I'm using the development board LPCXpresso55S69 with a LPC55S69 and a SD-card slot. The SDK example works fine and can read and write from and to the card. In my own project, while trying to read with f_open(), it stalls in the call to the semaphore wait method. Card inserting detection works as expected and the initialisation is - to my eyes - done exactly as in the SDK example "sdcard_fatfs_cm33_core0_sdcard".

Here is the call-stack where it just stops and waits for the semaphore getting free.

OSA_SemaphoreWait() at fsl_os_abstraction_bm.c:795 0x724a
SDMMC_OSAEventWait() at fsl_sdmmc_osa.c:69 0x2b74
SDMMCHOST_TransferFunction() at fsl_sdmmc_host.c:275 0x8ee6
SDMMC_Goldle() at fsl_sdmmc_common.c:117 0x909e
SD_Goldle() at fsl_sd.c:345 0x92a
SD_ProbeBusVoltage() at fsl_sd.c:1,944 0x25a0
sdcard_init() at fsl_sd.c:2,020 0x26c6
SD_Cardlnit() at fsl_sd.c:2,107 0x2816
SD_Init() at fsl_sd.c:2,290 0x2afa
sd_disk_initialize() at fsl_sd_disk.c:145 0x3344
disk_initialize() at diskio.c:117 0x911c
mount_volume() at ff.c:3,430 0x44ec
f_open() at ff.c:3,740 0x4baa

Any hints where I could search for the problem or which further information I could provide?

Thanks in advance,

Alex

Labels (1)
Tags (1)
0 Kudos
Reply
3 Replies

294 Views
Alexander_42
Contributor I

Further search revealed, that the interrupt SDIO_IRQHandler() does not fire. I use the standard SD_HostInit() to initialize the host, which subsequently calls SDIF_TransferCreateHandle() that should set up the interrupt. Still, there's something missing I can't locate in the (user-) code.

0 Kudos
Reply

276 Views
EdwinHz
NXP TechSupport
NXP TechSupport

Hi @Alexander_42,

Is there anything else on your code that might disable interruptions? You mention that you call the same initialization function "SD_HostInit()", but do you also make sure to initialize all the pins, clocks and other hardware necessary for the SD card to function properly on your application?

BR,
Edwin.

0 Kudos
Reply

172 Views
Alexander_42
Contributor I

Hi Edwin and thanks for your reply.

I compared the code flow between both projects, and everything looks identical. So, unless I did oversee something, the ports and timers should be set-up identical. The interrupt not coming in points to some set-up issue though, so I will double check, also with the HW monitors in MCUXpresso.

Best regards,

Alex

0 Kudos
Reply
%3CLINGO-SUB%20id%3D%22lingo-sub-2179263%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%5BLPC55S6x%5D%20SD%20card%20SDK%3A%20call%20to%20f_open()%20stalls%20in%20OSA_SemaphoreWait%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2179263%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EI'm%20using%20the%20development%20board%26nbsp%3BLPCXpresso55S69%20with%20a%20LPC55S69%20and%20a%20SD-card%20slot.%20The%20SDK%20example%20works%20fine%20and%20can%20read%20and%20write%20from%20and%20to%20the%20card.%20In%20my%20own%20project%2C%20while%20trying%20to%20read%20with%20f_open()%2C%20it%20stalls%20in%20the%20call%20to%20the%20semaphore%20wait%20method.%20Card%20inserting%20detection%20works%20as%20expected%20and%20the%20initialisation%20is%20-%20to%20my%20eyes%20-%20done%20exactly%20as%20in%20the%20SDK%20example%20%22sdcard_fatfs_cm33_core0_sdcard%22.%3C%2FP%3E%3CP%3EHere%20is%20the%20call-stack%20where%20it%20just%20stops%20and%20waits%20for%20the%20semaphore%20getting%20free.%3C%2FP%3E%3CP%3EOSA_SemaphoreWait()%20at%20fsl_os_abstraction_bm.c%3A795%200x724a%3CBR%20%2F%3ESDMMC_OSAEventWait()%20at%20fsl_sdmmc_osa.c%3A69%200x2b74%3CBR%20%2F%3ESDMMCHOST_TransferFunction()%20at%20fsl_sdmmc_host.c%3A275%200x8ee6%3CBR%20%2F%3ESDMMC_Goldle()%20at%20fsl_sdmmc_common.c%3A117%200x909e%3CBR%20%2F%3ESD_Goldle()%20at%20fsl_sd.c%3A345%200x92a%3CBR%20%2F%3ESD_ProbeBusVoltage()%20at%20fsl_sd.c%3A1%2C944%200x25a0%3CBR%20%2F%3Esdcard_init()%20at%20fsl_sd.c%3A2%2C020%200x26c6%3CBR%20%2F%3ESD_Cardlnit()%20at%20fsl_sd.c%3A2%2C107%200x2816%3CBR%20%2F%3ESD_Init()%20at%20fsl_sd.c%3A2%2C290%200x2afa%3CBR%20%2F%3Esd_disk_initialize()%20at%20fsl_sd_disk.c%3A145%200x3344%3CBR%20%2F%3Edisk_initialize()%20at%20diskio.c%3A117%200x911c%3CBR%20%2F%3Emount_volume()%20at%20ff.c%3A3%2C430%200x44ec%3CBR%20%2F%3Ef_open()%20at%20ff.c%3A3%2C740%200x4baa%3C%2FP%3E%3CP%3EAny%20hints%20where%20I%20could%20search%20for%20the%20problem%20or%20which%20further%20information%20I%20could%20provide%3F%3C%2FP%3E%3CP%3EThanks%20in%20advance%2C%3C%2FP%3E%3CP%3EAlex%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2179263%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CLINGO-LABEL%3EDevelopment%20Board%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2185390%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20%5BLPC55S6x%5D%20SD%20card%20SDK%3A%20call%20to%20f_open()%20stalls%20in%20OSA_SemaphoreWait%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2185390%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%20Edwin%20and%20thanks%20for%20your%20reply.%3C%2FP%3E%3CP%3EI%20compared%20the%20code%20flow%20between%20both%20projects%2C%20and%20everything%20looks%20identical.%20So%2C%20unless%20I%20did%20oversee%20something%2C%20the%20ports%20and%20timers%20should%20be%20set-up%20identical.%20The%20interrupt%20not%20coming%20in%20points%20to%20some%20set-up%20issue%20though%2C%20so%20I%20will%20double%20check%2C%20also%20with%20the%20HW%20monitors%20in%20MCUXpresso.%3C%2FP%3E%3CP%3EBest%20regards%2C%3C%2FP%3E%3CP%3EAlex%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2180046%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20%5BLPC55S6x%5D%20SD%20card%20SDK%3A%20call%20to%20f_open()%20stalls%20in%20OSA_SemaphoreWait%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2180046%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F255433%22%20target%3D%22_blank%22%3E%40Alexander_42%3C%2FA%3E%2C%3C%2FP%3E%0A%3CP%3EIs%20there%20anything%20else%20on%20your%20code%20that%20might%20disable%20interruptions%3F%20You%20mention%20that%20you%20call%20the%20same%20initialization%20function%20%22%3CSPAN%3ESD_HostInit()%3C%2FSPAN%3E%22%2C%20but%20do%20you%20also%20make%20sure%20to%20initialize%20all%20the%20pins%2C%20clocks%20and%20other%20hardware%20necessary%20for%20the%20SD%20card%20to%20function%20properly%20on%20your%20application%3F%3C%2FP%3E%0A%3CP%3EBR%2C%3CBR%20%2F%3EEdwin.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2179372%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20%5BLPC55S6x%5D%20SD%20card%20SDK%3A%20call%20to%20f_open()%20stalls%20in%20OSA_SemaphoreWait%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2179372%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EFurther%20search%20revealed%2C%20that%20the%20interrupt%26nbsp%3B%3CSPAN%3ESDIO_IRQHandler()%20does%20not%20fire.%20I%20use%20the%20standard%26nbsp%3B%3CSPAN%3ESD_HostInit()%20to%20initialize%20the%20host%2C%20which%20subsequently%20calls%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%3ESDIF_TransferCreateHandle()%20that%20should%20set%20up%20the%20interrupt.%20Still%2C%20there's%20something%20missing%20I%20can't%20locate%20in%20the%20(user-)%20code.%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E