[En-Nut-Discussion] Bug in Ethernut found - was: SD-card problems
Bernd Walter
enut at cicely.de
Mon Mar 2 20:26:39 CET 2009
Sorry - I was a bit too fast :(
On Mon, Mar 02, 2009 at 08:05:45PM +0100, Bernd Walter wrote:
>
> Probably it is already fixed, since I'm still using 4.6.3.
> The code failed to put the card into SPI mode.
> The comment above was correct, but disagreeing with the code.
> Maybe just luck got the card in SPI mode everywhere else.
>
> [188]devel# [187]devel# diff -u mmcard.orig mmcard.c
> --- mmcard.orig 2009-03-02 20:02:43.551952257 +0100
> +++ mmcard.c 2009-03-02 20:02:50.659675771 +0100
> @@ -366,7 +366,7 @@
> * 80 bits of ones with deactivated chip select will put the card
> * in SPI mode.
> */
> - (*ifc->mmcifc_cs) (0);
> + (*ifc->mmcifc_cs) (1);
> for (i = 0; i < 10; i++) {
> (*ifc->mmcifc_io) (0xFF);
> }
> Exit 1
The code was correct, since mmcifc_cs is inverting.
Nevertheless it is working with this change in the X256 board, but
still not with the X512 one.
Sigh... - I really hate this kind of problems.
--
B.Walter <bernd at bwct.de> http://www.bwct.de
Modbus/TCP Ethernet I/O Baugruppen, ARM basierte FreeBSD Rechner uvm.
More information about the En-Nut-Discussion
mailing list