Problem accessing SD Card on PyBoard v1.1 clone #15093
-
Hi, After much effort and countless searches I have been unable to mount an SD card on my PyBoard v1.1 clone. I've tried 6 different cards, formatted in many ways (using both disks and gparted), 1 or 2 partitions, FAT 16 & 32, / msdos, GPT & loop partition tables, different sizes 2/8/32/64 and different brands Transcend, Kingston , SanDisk and Pico. The Pyboard is listed on eBay as 'unbranded'. It appears to work well in every other way. I've also tried formatting from MPY to no avail in both FAT and Little FS v2. (Using vfs.VfsLfs2.mkfs) My only lead at this point is that executing sd.power(True) returns False and sd.power(False) returns True. I have no idea what this means and haven't been able to find more info? Any help would be appreciated. Thanks,
|
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 2 replies
-
The SD card should automatically be mounted. On a real pyboard after power up MicroPython v1.22.1 on 2024-01-05; PYBv1.1 with STM32F405RG
Type "help()" for more information.
>>> import os
>>> os.listdir("/")
['flash', 'sd']
>>> This is without any user code. import pyb
pyb.usb_mode('VCP') The SD card needs no special formatting. A standard, brand new, SD card should just work. |
Beta Was this translation helpful? Give feedback.
-
Hi Peter, Thanks for your response. I suspect that this clone has a problem. I've read where others have found the SD_PRESENT switch mapped to PA13 rather than PA8, or not connected at all. pyb.sd.present() appears to work as it should for me. My only clue now is that it is not getting powered up properly
To me this looks like this function triggers logic to provide power to the SD once detected as present, and I guess the return value indicates if power actually is enabled on the device. I've read through the relevant part of the c source code, but it is beyond my understanding. I can't find a 'power' pin in the pins.csv list, but it does show...
PA8 is mapped top two pins - should 1 be for power? Thanks, PS. Many thanks Peter for all your posts. I've been learning micropython for two years now, and using it on multiple platforms - every time I have an issue, I can nearly always find the answer in one of your posts. |
Beta Was this translation helpful? Give feedback.
-
I've checked the PyBoard v1.1 schematic and note that the SD card slot is always powered. So what does pyb.SDCard.power() actually do? Whilst trying to find a solution I found that when others executed pyb.SDCard.power(True) it returns True. Mine always returns false. |
Beta Was this translation helpful? Give feedback.
Thanks Peter,
Definitely a design fault, I bought a handful and all exhibit the same problem. I agree that I'm not pursuing the most cost effective solution, but I'm retired, have time and sometimes the thrill is in uncovering, understanding and solving difficult problems. I'll buy a few genuine boards today which will also serve as a reference whilst supporting the excellent MicroPython development that I have gained so much from.
Anyway I got out the microscope and had a good look at the board. It appears SD card slot, pin 8 (DATA1), is missing a solder pad. It's awfully small but I'm going to try to connect to pin 40 on the MCU.