SdFat icon indicating copy to clipboard operation
SdFat copied to clipboard

SDInfo sketch - wrong manufacturing date

Open avi3232 opened this issue 3 years ago • 3 comments

Hi! I used SDFat v2.1.0 and example sketch SDInfo. There are some problem with decoding card manufacturing date. Android apps SD Insight and SD Tools shows correct dates - 02/2021 & 05/2019. SDInfo sketch shows 02/2015 & 05/2013.

sd1 sd2

.

avi3232 avatar Oct 16 '21 15:10 avi3232

Looks like SdFat decodes the year as BCD but it's binary.

Could you edit SdIinfo.ino and change line 57 from this: cout << (2000 + m_cid.mdt_year_low + 10 * m_cid.mdt_year_high) << endl; to this: cout << (2000 + m_cid.mdt_year_low + 16* m_cid.mdt_year_high) << endl;

Let me know if this fixes the problem.

greiman avatar Oct 16 '21 19:10 greiman

cout << (2000 + m_cid.mdt_year_low + 16* m_cid.mdt_year_high) << endl;

Let me know if this fixes the problem.

This code fixes manufacturing date. Thank you!

avi3232 avatar Oct 17 '21 10:10 avi3232

Thank you. This fix will be in the next version. It may be a while since I have a number of other changes in beta-test.

greiman avatar Oct 17 '21 11:10 greiman