SPI_MMC driver issue

ChibiOS public support forum for all topics not covered by a specific support forum.

Moderators: RoccoMarco, lbednarz, tfAteba

Post Reply
JetForMe
Posts: 99
Joined: Mon Jan 31, 2011 8:12 am

SPI_MMC driver issue

Post by JetForMe »

I'm trying to get MMC working on a SAM7X board, based off the FAT demo.

When a card is inserted, the insertion handler tries do an mmcConnect() that ends up asserting in spiSelect(), because the state is not SPI_READY.

This is because mmcConnect() first calls spiStart(), which sets the state to SPI_READY, and then calls spiIgnore(), which sets the state to SPI_ACTIVE. (Nowhere in the code to I find anything that sets it back to SPI_READY.)

Then mmcConnect() calls send_command(), which first tries to all spiSelect(), but that asserts because the state is not SPI_READY.

Is there something wrong with my setup, or is there a bug in MMC?

Thanks,
Rick
User avatar
Giovanni
Site Admin
Posts: 14895
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 997 times

Re: SPI_MMC driver issue

Post by Giovanni »

Thanks Rick,

I will look into this.

Giovanni
User avatar
Giovanni
Site Admin
Posts: 14895
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 997 times

Re: SPI_MMC driver issue

Post by Giovanni »

Confirmed, it is a bug in the SPI driver, it does not return to the SPI_READY state when a callback is not defined. It has no impact except triggering the assertion.

Will be fixed in next releases, it has been already fixed in the repository.

thanks,
Giovanni
Post Reply