Page 1 of 2
Trouble with SD Card
Posted: Mon Jun 20, 2016 2:04 pm
by ahmet_cihan
Hi community.
After connecting pyboard to my PC, I insert MicroSD Card to pyboard. Just standard boot from flash.. When I write
>>> os.listdir('/')
I can see
['flash', 'sd']
so, it's clear that the board can identify SD Card. But when I write
>>> os.listdir('/sd')
I get this error;
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
OSError: No such file or directory: '/sd'
So, I can't read or write SD card. What could be the problem?
Re: Trouble with SD Card
Posted: Mon Jun 20, 2016 3:08 pm
by dhylands
I think that only unpatrtitioned SDcards which are formatted using FAT32 are supported.
I know lots of SDs get reformatted using multiple partitions (for say Raspberry Pi), and I don't think that these are suppoted.
Re: Trouble with SD Card
Posted: Mon Jun 20, 2016 4:29 pm
by ahmet_cihan
Thank you for your answer Dave. Bad luck for me because I have tried 2 different SD card which are formatted single partition FAT32

I changed one of them to NTFS, it's same. Now I'm trying EXT4.. No, it's same. What can I do anymore?
Re: Trouble with SD Card
Posted: Mon Jun 20, 2016 5:07 pm
by torwag
You have to carefully read Daves answer
Unpartitioned SD card. Means no partition at all.
Under linux that means you need to have no sdb1 or sdbX but only sdb.
And you need to format sdb and not sdbX
Not sure how to manage this under the windows world, which I left long time ago.
There is no support for EXT4, NTFS and Co.
Good luck
EDIT: Could be also sdc sdd or whatever, you need to check... don't tell me you erased your harddisk by using my sdb example

Re: Trouble with SD Card
Posted: Mon Jun 20, 2016 7:47 pm
by Roberthh
Hi folks, I cannot confirm that. I just looked at two SD cards on two systems, size 8 and 16GB, but I had a 64GB card used too. Boths cards are accepted by PyBoardV1. Both have a single partition with a partition sector formatted as FAT. On on system, the cards show up as /dev/sde1, on the other as /dev/mmcblk0 and /dev/mmcblk0p1. What I did, I reformatted the cards before using as FAT.
SO maybe you should confirm that the cards have a single partition only, or use a different computer for verification, that they are properly formatted.
P.S.: When inserted into PYBoard, the cards are shown as /dev/sdc1.
Re: Trouble with SD Card
Posted: Tue Jun 21, 2016 8:01 am
by ahmet_cihan
I used GParted to format SD Cards, under Linux. No flags, no partitioning, just plain format to FAT32.
Note that; there is NO trouble when I reset the board while SD card is connected. PyBoard is running from SD Card properly. So, I don't think there is a format unsuitability.
Now, I'm going to change the firmware to the latest version.
Re: Trouble with SD Card
Posted: Tue Jun 21, 2016 8:50 am
by Roberthh
Hello ahmet_cihan, just two questions:
a) are there any files on the SD card you're trying
b) when PyBoard is connected to your PC, is the SD card visiblle as external drive?
Regards, Robert
Re: Trouble with SD Card
Posted: Tue Jun 21, 2016 10:12 am
by ahmet_cihan
Hi Robert.
1- There is not any file on the SD Card.
2 - When I boot Pyboard with a SD Card, PC can see SD Card as an external drive. In this case there is no problem. Problem occurs when I connect SD Card after flash boot.
I changed the firmware to the latest. What now; I insert SD Card after flash boot
>>> os.listdir('/')
I can see
['flash']
This is more logical

Because formerly, I could see 'sd' with this command but it gave error when I tried to list 'sd'. But now I can't see 'sd' in the list of '/'.
Still no problem with SD boot.
Re: Trouble with SD Card
Posted: Tue Jun 21, 2016 11:01 am
by Roberthh
What do you mean with
Still no problem with SD boot.
, especially when there is no file on the SD card.
PyBoard boots from its image in flash outside the file system. It just takes boot.py and main.py from a filesystem in flash or SD if present.
There might be a problem with the SD card connector.
Re: Trouble with SD Card
Posted: Tue Jun 21, 2016 11:18 am
by ahmet_cihan
I will explain step-by-step;
SD Card: no data, no file, FAT32 formatted.
PC: Linux (Ubuntu 15.04)
A - Connect SD Card -> then -> Plug in USB
1- Command "screen /dev/ttyACM0"
2- Darkness

3- CTRL+C
4- I have console.
5- >>> import os
>>> os.listdir('/')
['flash', 'sd']
6- No problema!
B- Plug in USB, NO SD Card
1- Command "screen /dev/ttyACM0"
2- Darkness

3- CTRL+C
4- I have console.
5- >>> import os
>>> os.listdir('/')
['flash']
6- Connect SD Card
7->>> os.listdir('/')
['flash']
still cannot see 'sd'