Problem with spi-sd-card.c (rtems-4.9.0)

Robert S. Grimes rsg at alum.mit.edu
Thu Oct 2 18:11:21 UTC 2008


Seems I've moved backwards from last week.  I switched to 4.9.0, and 
that seemed fine - until I returned to the SD card driver.  I can't even 
get the basic card id functions to work - it fails before then.  Here 
are my (current) problems:

1. In spi-sd-card.c, sd_card_driver_init, sd_card_driver_get_entry fails 
to return pointer to driver.  Specifically, X_get_entry returns an 
incorrect value (0x51xxxx, for example, when it should be 0x48xxxx - the 
point of these addresses is only to point out the issue).  Then, the 
following call to CHECK_RVSC blasts the local variable e, setting it to 2!

2. If I manually correct (in the debugger) the value, when later a call 
to rtems_io_register_driver is made, the sd_card_disk_ops table only has 
an entry for the initialization_entry; all others are 0.

3. Finally, the card never leaves the "busy" state, in that the output 
line is always low.

4. I haven't noticed a CMD0 being sent to the card with the CS low; this 
seems to be needed to switch the card to SPI mode.  Am I missing something?

Any ideas?
-Bob

P.S. I'm using the powerpc/virtex BSP, and the virtex SPI functions seem 
to be called correctly, and the SPI signals at the card seem correct.



More information about the users mailing list