8 years, 4 months ago.

Minor flaw in v19

Neil,

The disk type/size reporting is broken in v19. It was working before in v17

- SD Flash Card type: SD - Sectors: 0 - Capacity: 0.0MB

...kevin

Question relating to:

A re-written SDFileSystem library with improved compatibility, CRC support, and card removal/replacement support. fatfilesystem, MMC, SD, SD Card, SDHC, SDXC

1 Answer

8 years, 4 months ago.

Thanks for the heads up Kevin, I think this may be a side effect of changes I made to card_type(). It used to initialize the card if it wasn't already, but that was causing problems with FatFs. The new version still initializes the card if necessary, but marks it as uninitialized so FatFs can initialize it again later. I'm not sure what the best solution is, it might be more consistent behaviour for card_type() to return unknown until FatFs initializes the card itself. Perhaps if I added an extra card_present() method... I'll look into this later on when I get back to my computer.

Accepted Answer

Hi Kevin, I've updated SDFileSystem and removed the under-the-table initialization logic from card_type(). Therefore, in v20, both card_type() and disk_sectors() are only valid after the filesystem has been mounted, either manually or automatically. This is more consistent behavior, and encourages a developers to use a proper accessing sequence. To help offset the inconvenience, I've added a new card_present() method for checking the card socket without polling the card type. SDFileSystem_HelloWorld has been updated to demonstrate the changes.

posted by Neil Thiessen 08 Dec 2015

That got it Neil, thanks.

There is a timestamp issue with the nRF51822, all timestamps come back as 01/01/2098 00:00:00. However, it is not an issue with a K64F, the timestamps are correct. The nRF has a different way of talking to the internal RTC, so I think that is the reason.

...kevin

posted by Kevin Braun 08 Dec 2015