Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Pinguino MICRO, SD Card doesn't mount, Pinguino IDE v11 beta 3, Linux Ubuntu 14.04
13-09-2015, 12:16 AM,
#1
Pinguino MICRO, SD Card doesn't mount, Pinguino IDE v11 beta 3, Linux Ubuntu 14.04
Hi everybody,

I am trying to use SD cards on Pinguino MICRO boards. My OS is Linux Ubuntu 14.04 and I recently updated to Pinguino IDE v11 beta 3. The IDE works fine, as are working other applications I developped for Pinguino MICRO ...

I am using the new libraries and I modified the Dir.pde file accordingly but I can not mount the SD cards (I tried 5 SD cards from slow 2GB to fast SDHC 8GB).

To see the debug messages, I added

#define SD_DEBUG

to fileio.c in SD LIBRARY and I am using serial2 instead of serial1 to display the messages.


... the execution of

SD.mount(SPI2, 40);

gives me:

============
Slow 2GB SD card with 1GB FAT16 partition, 512 bytes sectors
---------------------

Initializing SPI...
Looking for a SD card ...
Initializing SD card...
Mounting FAT filesystem...
Checking FAT filesystem...
Send command 0
return 0xFF
return 0x1
Send command 8
return 0xFF
return 0x1
Send command 169
Send command 55
return 0xFF
return 0x1
return 0xFF
return 0x1
Send command 169
Send command 55
return 0xFF
return 0x1
return 0xFF
return 0x0
Send command 58
return 0xFF
return 0x0
CardType=4
Single block read
Send command 17
return 0xFF
return 0xFF
return 0xFF
return 0xFF
return 0xFF
return 0xFF
return 0xFF
return 0xFF
return 0xFF
return 0xFF
Failed (FR_DISK_ERR)

----------------
fast 8GB card with 1GB FAT16 partition , 512 bytes sectors
----------------

Initializing SPI...
Looking for a SD card ...
Initializing SD card...
Mounting FAT filesystem...
Checking FAT filesystem...
Send command 0
return 0xFF
return 0x1
Send command 8
return 0xFF
return 0x1
Send command 169
Send command 55
return 0xFF
return 0x1
return 0xFF
return 0x1
Send command 169
Send command 55
return 0xFF
return 0x1
return 0xFF
return 0x0
Send command 58
return 0xFF
return 0x0
CardType=12
Single block read
Send command 17
return 0xFF
return 0x82
return 0x7F
Failed (FR_DISK_ERR)

===========

Any idea?
Reply
13-09-2015, 12:46 AM,
#2
RE: Pinguino MICRO, SD Card doesn't mount, Pinguino IDE v11 beta 3, Linux Ubuntu 14.04
Which pinguino board are you using?
The SPI SD Card signals are at 3.3V levels.
Are you connecting all the signals?
Reply
13-09-2015, 01:42 AM,
#3
RE: Pinguino MICRO, SD Card doesn't mount, Pinguino IDE v11 beta 3, Linux Ubuntu 14.04
(13-09-2015, 12:46 AM)B4lfiz4r Wrote: Which pinguino board are you using?
The SPI SD Card signals are at 3.3V levels.
Are you connecting all the signals?

OLIMEX's PIC32-PINGUINO-MICRO Rev. B
Reply
13-09-2015, 12:13 PM,
#4
Smile  RE: Pinguino MICRO, SD Card doesn't mount, Pinguino IDE v11 beta 3, Linux Ubuntu 14.04

I FOUND THE PROBLEM ... AND THE SOLUTION ...



I looked at the signals on a scope...

The SD cards wait for a SPI clock signal of type

___-_-_-_-_-_-_-_-____

At start, the SPI interface was configured as required (looking for SD card, initialisation ...). But after the detection of the type of card, SPI interface was re-configured to output a (faster) clock signal of type

-----_-_-_-_-_-_-_-_------



========================


So, for people who want to use SD cards:


You have to found the library file

..../pinguino-11/p32/include/pinguino/libraries/sd/diskio.c,


search for the line

       SPI_setDataMode(module, SPI_MODE3); // CKE=1 (0x100), CKP=0

and change it to

       SPI_setDataMode(module, SPI_MODE1); // CKE=1 (0x100), CKP=0

....


... and everything works fine ...
Reply
12-06-2016, 09:28 PM,
#5
RE: Pinguino MICRO, SD Card doesn't mount, Pinguino IDE v11 beta 3, Linux Ubuntu 14.04
Hey guys,
I'm all new to Pinguino development, I have an Olimex Pic32-Pinguino-OTG coupled with a shield-midi, I want to use it to make midi signal processing between synthesizers.

On top of that I'd like to use the SD slot to load some settings. I have installed v11 of Pinguino IDE, and from what I see, the fileio libraries changed quite a lot since previous versions but examples weren't updated. The SD.mount function for example now takes 2 parameters and I don't exactly understand the impact of all these changes. I see you're using it with 2 parameters so I guess you have a working program using this new version. Could you help me a bit with that please? (I keep searching on my side of course, it's just all too blurry for me for the moment...)

Thanks by advance Smile
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)