Changeset df29cfe in rtems


Ignore:
Timestamp:
Oct 8, 2013, 8:40:29 AM (5 years ago)
Author:
Pavel Pisa <ppisa@…>
Branches:
4.10
Children:
387c90b9
Parents:
7c709c05
git-author:
Pavel Pisa <ppisa@…> (10/08/13 08:40:29)
git-committer:
Sebastian Huber <sebastian.huber@…> (10/08/13 09:16:15)
Message:

SPI SD-Card: setup valid CRC-7 for STOP_TRANSMISSION command.

STOP_TRANSMISSION command is used to finish READ_MULTIPLE_BLOCK
command and its format is regular command format.
It requires valid CRC-7 to have effect at least on
same cards types else it is ignored and attempt
to issue next READ or WRITE commands results in
illegal command condition (0x04) preceded by strange
(0x3f) for tested card.

Signed-off-by: Pavel Pisa <ppisa@…>

File:
1 edited

Legend:

Unmodified
Added
Removed
  • c/src/libchip/i2c/spi-sd-card.c

    r7c709c05 rdf29cfe  
    502502{
    503503        int rv = 0;
     504        uint8_t crc7;
    504505
    505506        SD_CARD_COMMAND_SET_COMMAND( e->command, SD_CARD_CMD_STOP_TRANSMISSION);
     507        SD_CARD_COMMAND_SET_ARGUMENT( e->command, 0);
     508        /*crc7 = sd_card_compute_crc7( e->command + 1, 5);*/
     509        crc7 = 0x30;    /* Help compiler - command and argument are constants */
     510        SD_CARD_COMMAND_SET_CRC7( e->command, crc7);
    506511        rv = rtems_libi2c_write_bytes( e->bus, e->command, SD_CARD_COMMAND_SIZE);
    507512        RTEMS_CHECK_RV( rv, "Write stop transfer token");
Note: See TracChangeset for help on using the changeset viewer.