CB34EX to SB800EX: EFFS/FAT Fails

Discussion to talk about software related topics only.
Post Reply
andrew.black
Posts: 1
Joined: Thu Apr 27, 2017 8:53 am

CB34EX to SB800EX: EFFS/FAT Fails

Post 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?
User avatar
TomNB
Posts: 569
Joined: Tue May 10, 2016 8:22 am

Re: CB34EX to SB800EX: EFFS/FAT Fails

Post 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.
Rich
Posts: 6
Joined: Tue Jan 16, 2018 1:57 am

Re: CB34EX to SB800EX: EFFS/FAT Fails

Post 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?
User avatar
TomNB
Posts: 569
Joined: Tue May 10, 2016 8:22 am

Re: CB34EX to SB800EX: EFFS/FAT Fails

Post 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?
Rich
Posts: 6
Joined: Tue Jan 16, 2018 1:57 am

Re: CB34EX to SB800EX: EFFS/FAT Fails

Post by Rich »

Thanks, I'm using 2.7.7. I will give the example a try.
Rich
Posts: 6
Joined: Tue Jan 16, 2018 1:57 am

Re: CB34EX to SB800EX: EFFS/FAT Fails

Post 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())
User avatar
TomNB
Posts: 569
Joined: Tue May 10, 2016 8:22 am

Re: CB34EX to SB800EX: EFFS/FAT Fails

Post 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.
Rich
Posts: 6
Joined: Tue Jan 16, 2018 1:57 am

Re: CB34EX to SB800EX: EFFS/FAT Fails

Post 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
Post Reply