Interesting issue with different sdcards

General discussions and questions abound development of code with MicroPython that is not hardware specific.
Target audience: MicroPython Users.
blmorris
Posts: 348
Joined: Fri May 02, 2014 3:43 pm
Location: Massachusetts, USA

Re: Interesting issue with different sdcards

Post by blmorris » Mon Jun 09, 2014 6:20 pm

@dhylands - that modification photo - I tip my hat to you, and I'm not easily impressed. That is some fine (in both meanings of the word) soldering work.
Would you mind sharing what microscope you used for that photo? Would you recommend it?
-Bryan

User avatar
dhylands
Posts: 3821
Joined: Mon Jan 06, 2014 6:08 pm
Location: Peachland, BC, Canada
Contact:

Re: Interesting issue with different sdcards

Post by dhylands » Mon Jun 09, 2014 6:46 pm

blmorris wrote:@dhylands - that modification photo - I tip my hat to you, and I'm not easily impressed. That is some fine (in both meanings of the word) soldering work.
Would you mind sharing what microscope you used for that photo? Would you recommend it?
-Bryan
Thanks.

I picked up my scope about 7 years ago, as part of a group buy done by the HBRobotics club. The closest model appears to be this one:
http://www.hhip.com/10x-stereo-microsco ... stand.html

My light looks a little different, but the rest looks pretty similar. We paid $180 as part of the group buy (versus about $250 retail at the time).
I really like the scope, but I'm just a hobbyist (although I've been soldering things since I was a teenager) and I've never used anything else other than a magnifying glass for comparison. I like the fact that it has a 4-5" focal length. That gives enough room to put your board under it and maneuver tweezers, soldering iron, etc.

There are lots on ebay as well. I just did a search for "boom microscope" and this one:
http://www.ebay.com/itm/10X-20X-Widefie ... 5d4cc72a2d
looks exactly like mine (except for the logo).

dilogic
Posts: 3
Joined: Mon Jun 09, 2014 10:51 am

Re: Interesting issue with different sdcards

Post by dilogic » Mon Jun 09, 2014 7:46 pm

Sorry about that - it was the problem in my case and 10K pull-up solved it. As I said, it only happened with HC cards, though.

User avatar
Markus Gritsch
Posts: 41
Joined: Fri May 16, 2014 9:04 pm

Re: Interesting issue with different sdcards

Post by Markus Gritsch » Sun Jun 15, 2014 6:58 pm

I also do have problems with my SD cards. I described them in this bug report:
https://github.com/micropython/micropython/issues/687

User avatar
Markus Gritsch
Posts: 41
Joined: Fri May 16, 2014 9:04 pm

Re: Interesting issue with different sdcards

Post by Markus Gritsch » Wed Jun 18, 2014 7:13 pm

@dhylands: If you like, you can try the attached firmware.dfu, where I made the following experimental changes:

Code: Select all

bash-3.2$ diff -u main_orig.c main.c 
--- main_orig.c 2014-06-18 21:01:58.089046200 +0200
+++ main.c      2014-06-18 21:02:42.687597100 +0200
@@ -420,8 +420,9 @@
 
 #if MICROPY_HW_HAS_SDCARD
     // if an SD card is present then mount it on 1:/
+    HAL_Delay(100); // MGr
     if (reset_mode == 1 && sdcard_is_present()) {
-        FRESULT res = f_mount(&fatfs1, "1:", 1);
+        FRESULT res = f_mount(&fatfs1, "1:", 0); // MGr
         if (res != FR_OK) {
             printf("[SD] could not mount SD card\n");
         } else {
With them in place, my SD card get's detected nearly every time I reset the board. I would not consider it a fix though, since setting the last parameter of f_mount to 0 makes the following check obsolete since then it does not perform a read check.

I would be interested in your results nevertheless.

Cheers,
Markus
Attachments
firmware.zip
(153.01 KiB) Downloaded 525 times

User avatar
dhylands
Posts: 3821
Joined: Mon Jan 06, 2014 6:08 pm
Location: Peachland, BC, Canada
Contact:

Re: Interesting issue with different sdcards

Post by dhylands » Thu Jun 19, 2014 5:30 am

Hey Markus,

I'm on a little vacation right now, and I didn't bring the bad sdcards with me, so I'll have to wait until next week to test this.

But I'm also definitely interested in the results.

I shoud be able to build with your patch.

User avatar
dhylands
Posts: 3821
Joined: Mon Jan 06, 2014 6:08 pm
Location: Peachland, BC, Canada
Contact:

Re: Interesting issue with different sdcards

Post by dhylands » Tue Jun 24, 2014 7:19 am

Markus Gritsch wrote:@dhylands: If you like, you can try the attached firmware.dfu, where I made the following experimental changes:

Code: Select all

bash-3.2$ diff -u main_orig.c main.c 
--- main_orig.c 2014-06-18 21:01:58.089046200 +0200
+++ main.c      2014-06-18 21:02:42.687597100 +0200
@@ -420,8 +420,9 @@
 
 #if MICROPY_HW_HAS_SDCARD
     // if an SD card is present then mount it on 1:/
+    HAL_Delay(100); // MGr
     if (reset_mode == 1 && sdcard_is_present()) {
-        FRESULT res = f_mount(&fatfs1, "1:", 1);
+        FRESULT res = f_mount(&fatfs1, "1:", 0); // MGr
         if (res != FR_OK) {
             printf("[SD] could not mount SD card\n");
         } else {
With them in place, my SD card get's detected nearly every time I reset the board. I would not consider it a fix though, since setting the last parameter of f_mount to 0 makes the following check obsolete since then it does not perform a read check.

I would be interested in your results nevertheless.

Cheers,
Markus
I tried your patch and still got mixed results. Some cards work, some don't. Reseting isn't completely consistent (with or without the patch).

User avatar
UltraBob
Posts: 43
Joined: Mon Jul 28, 2014 1:18 pm
Location: Zushi, Japan
Contact:

Re: Interesting issue with different sdcards

Post by UltraBob » Tue Aug 05, 2014 8:14 am

Did this ever get resolved? I'm wondering if the SD card issue I'm having is the same one on this thread from a month and a half ago.

I suspect it is not the same issue because even in REPL I can't access the card. Hmmm.

Post Reply