Page 1 of 1

CB34EX to SB800EX: EFFS/FAT Fails

Posted: Thu Apr 27, 2017 11:42 am
by andrew.black
I am currently in the middle of porting from the CB34EX to the SB800EX platforms. My current codebase supports peripherals such as CAN, Ethernet, serial, and SD card access. It is relatively stable on the CB34 and all functions work OK. The card is used for configuration files and logging functions.

I am able to build, load, and run the SB800 with the existing codebase targeting the SB800 platform. Amongst the functions that don't work yet is the card reading. Digging deep, it appears that the call to f_mountfatO is failing with a return value of 2. Snippet:

Code: Select all

   rv = f_mountfat( MMC_DRV_NUM, mmc_initfunc, F_MMC_DRIVE0 );
According to the documentation, a return value of 2 corresponds with "card not formatted". I can confirm that the card is indeed formatted and contains the (5) files I loaded onto it previously. These files occupy less than 100k of disk space. MMC_DRV_NUM is defined as 2, and appears to be standard for external drive used on NB platforms. I have tried F_MMC_DRIVE0 through F_MMC_DRIVE3 to no avail.

- Are there known issues with SB800EX and SD card usage?
- In the switch between CB34 and SB800, should I be utilizing a different library, build options, or other support for SD on the SB800?

Re: CB34EX to SB800EX: EFFS/FAT Fails

Posted: Thu Apr 27, 2017 3:14 pm
by TomNB
The SB800EX and the Nano on-module microSD card interfaces use the significantly faster SDHC interface instead of SPI, so you will need to change just a few lines in your code from the CB34EX. If you can open a support ticket we can send you some additional files that should make the conversion very easy.

Re: CB34EX to SB800EX: EFFS/FAT Fails

Posted: Wed Feb 26, 2020 6:38 am
by Rich
- Are there known issues with SB800EX and SD card usage?
I'm also currently struggling with this, did you ever get the microSD card slot working on the SB800EX?

Re: CB34EX to SB800EX: EFFS/FAT Fails

Posted: Thu Feb 27, 2020 5:04 pm
by TomNB
Yes, it has worked for quite some time. What tools revision are you using? Can you try the \nburn\examples\SB800EX\SDHC-FlashCard example and tell me if it works for you?

Re: CB34EX to SB800EX: EFFS/FAT Fails

Posted: Mon Mar 02, 2020 2:08 am
by Rich
Thanks, I'm using 2.7.7. I will give the example a try.

Re: CB34EX to SB800EX: EFFS/FAT Fails

Posted: Mon Jun 08, 2020 9:42 am
by Rich
I finally got the SD card to work using 2.9.2, but it seems as though f_mountfat() fails periodically. Sometimes it works fine, sometimes seems to lock up (never returning anything) and I have to power off and back on. Then it may boot up and mount just fine. I've tried waiting during startup for 8 to 10 seconds before mounting and that seems to make it more reliable but I'm not sure I trust it. Is there some function I need to use during startup that will tell me that everything is ready? (other than f_enterFS())

Re: CB34EX to SB800EX: EFFS/FAT Fails

Posted: Mon Jun 08, 2020 10:17 am
by TomNB
Hello Rich,

If you run the SB800EX SDHC example with no modifications, does it ever fail? We do not have any other reports I can find of the behavior you describe.

Re: CB34EX to SB800EX: EFFS/FAT Fails

Posted: Wed Jun 10, 2020 10:34 am
by Rich
Thanks for the suggestion, and no the example never fails. I was able to fix my issue by mounting the SD card before doing anything else (setting up tasks etc.) I now think my problem was due to something else. Thanks again