[En-Nut-Discussion] Problems with MMC cards on Ethernut 3.0e

Ole Reinhardt ole.reinhardt at embedded-it.de
Wed Jul 20 17:54:59 CEST 2011


Hi Harald,

> > Could you please check the current trunk on an Ethernut 3 board with
> > devNplMmc0 as well as the SPI Bus version spiBusNpl/devSpiMmcNpl?
> 
> I'll have a look, not today, but probably tomorrow.

Fine!

In the meantime, I found a workaround which makes me feel that there is
a problem with the NPL code (version 5) with the Ethernut 3.0e boards.

The following patch fixes the problems with most MMC cards. It seems
that the NPL_MMCDR register is not yet ready to read if the NPL_MMCREADY
flag ist set in NPL_SLR.

If I remember correctly there had been a discussion about the NPL code
some time ago...

Bye,

Ole


ole at platon:~/work/NutOS/ethernut/trunk/nut/dev$ svn diff 
Index: nplmmc.c
===================================================================
--- nplmmc.c	(Revision 3522)
+++ nplmmc.c	(Arbeitskopie)
@@ -160,6 +160,10 @@
             break;
         }
     }
+    _NOP(); _NOP(); _NOP(); _NOP();
+    _NOP(); _NOP(); _NOP(); _NOP();
+    _NOP(); _NOP(); _NOP(); _NOP();
+    _NOP(); _NOP(); _NOP(); _NOP();
 
     _NOP(); _NOP(); _NOP(); _NOP();
     rc = inb(NPL_MMCDR);
Index: spibus_npl.c
===================================================================
--- spibus_npl.c	(Revision 3522)
+++ spibus_npl.c	(Arbeitskopie)
@@ -257,6 +257,13 @@
         /* Wait for receiver data register full. */
         while ((inb(NPL_SLR) & NPL_MMCREADY) == 0);
         /* Read incoming data. */
+
+	_NOP(); _NOP(); _NOP(); _NOP();
+	_NOP(); _NOP(); _NOP(); _NOP();
+	_NOP(); _NOP(); _NOP(); _NOP();
+	_NOP(); _NOP(); _NOP(); _NOP();
+	_NOP(); _NOP(); _NOP(); _NOP();
+
         rxc = inb(NPL_MMCDR);
         if (rxp) {
             *rxp++ = rxc;





-- 

Thermotemp GmbH, Embedded-IT

Embedded Hard-/ Software and Open Source Development, 
Integration and Consulting

http://www.embedded-it.de

Geschäftsstelle Siegen - Steinstraße 67 - D-57072 Siegen - 
tel +49 (0)271 5513597, +49 (0)271-73681 - fax +49 (0)271 736 97

Hauptsitz - Hademarscher Weg 7 - 13503 Berlin
Tel +49 (0)30 4315205 - Fax +49 (0)30 43665002
Geschäftsführer: Jörg Friedrichs, Ole Reinhardt
Handelsregister Berlin Charlottenburg HRB 45978 UstID DE 156329280 




More information about the En-Nut-Discussion mailing list