SD card

Discussion to talk about software related topics only.
Post Reply
SeeCwriter
Posts: 606
Joined: Mon May 12, 2008 10:55 am

SD card

Post by SeeCwriter »

Using a MOD54415, with no micro-sd card in the slot, calling function get_cd, in function InitExtFlash(), in file FileSystemsUtils.cpp, in the EFFS-BASIC example, returns a value of 213. According to the manual (EFFS-ProgrammersGuide.pdf) it's supposed to return a 0 or 1.

If I put an sd card in the slot, I can access the sd card just fine. I'm just confused by the return code when a card is not present because I test the return code to decide what to do next. In this case, since it's not 0 I try to mount the card, which fails.

Using v2.8.5.
User avatar
TomNB
Posts: 538
Joined: Tue May 10, 2016 8:22 am

Re: SD card

Post by TomNB »

Are you asking about the return code for InitExtFlash(), or for get_cd()?

However, if you are using the onboard microSD flash socket (not an external to the module flash card) I would recommend using the \nburn\examples\MOD5441X\EFFS-MULTIPLE-MMC example as a guide instead.
User avatar
TomNB
Posts: 538
Joined: Tue May 10, 2016 8:22 am

Re: SD card

Post by TomNB »

The get_cd() function in the MOD5441X you use to detect is located in mmc_mcf.cpp. It will return a 0 or 1.
SeeCwriter
Posts: 606
Joined: Mon May 12, 2008 10:55 am

Re: SD card

Post by SeeCwriter »

I don't understand. I'm using the sd card slot on the MOD5441X module. I'm also using file FileSystemUtils.cpp from example program C:\nburn\examples\StandardStack\EFFS\EFFS-BASIC. That file has all the functions I need to access the sd card, and they work. Both files named FileSystemUtils.cpp call the same function get_cd(). Why would get_cd return a different result when called from one file than the other file? Are you suggesting that there are multiple functions named get_cd that operate differently and return different results?
User avatar
TomNB
Posts: 538
Joined: Tue May 10, 2016 8:22 am

Re: SD card

Post by TomNB »

They should both call the same get_cd function in the mod5441x system library. However, the examples in :\nburn\examples\StandardStack\EFFS\ were created and tested for the external flash card on the dev board. The tested example for the onboard flash card is the information I posted. Looking over the docs I can see that we need to make that more clear.
SeeCwriter
Posts: 606
Joined: Mon May 12, 2008 10:55 am

Re: SD card

Post by SeeCwriter »

I changed my program to use the functions in mmc_mcf.cpp, and used file FileSystemUtils.cpp from example program C:\nburn\examples\MOD5441X\EFFS-MULTIPLE-MMC. get_cd() now returns a 1. However, there is no SD card in the drive. So I created the EFFS-MULITPLE-MMC example project, as is, and loaded it and it produces the same results. This suggests that get_cd does not work.
User avatar
TomNB
Posts: 538
Joined: Tue May 10, 2016 8:22 am

Re: SD card

Post by TomNB »

Hello,

The card detect capability was added on module revisions 1.10 and later (is was always there for external flash cards). If you have a module rev earlier than that, the microSD socket does not support it. What you can do in that case is check the return value of the mount function and if it fails the card is not present.
Post Reply