SDcard library by Roland-Riegel.

Hi all.
I’d like to try the SDcard library by Roland-Riegel ( - sd-reader: MMC/SD/SDHC card library).
I have downloaded and put it in my IDE, then I did make the “examples” folder putting the following sketch:

     * \ingroup sd_raw
     * Sends a raw byte to the memory card.
     * \param[in] b The byte to sent.
     * \see sd_raw_rec_byte
    void sd_raw_send_byte(uint8_t b)
        SPDR = b;
        /* wait for byte to be shifted out */
        while(!(SPSR & (1 << SPIF)));
        SPSR &= ~(1 << SPIF);
    /* FORCE ERASE */
    uint8_t send_cmd42_erase(){
                    uint8_t response,i;
                    uint8_t arg = 0x08;
                    uint8_t command = 0x2a;
                    uint16_t crc = calc_crc(mess,((command&arg)|command),CRC16STARTBIT);
            /* wait some clock cycles */
                    Serial.print("Starting erase procedure");
                    select_card(); // select SD card first
                    sd_raw_send_byte(0x40 | 0x10);
                    sd_raw_send_byte(0x01 & 0xff);
            sd_raw_send_byte(0x40 | 0x2a);
            sd_raw_send_byte((arg >> 0) & 0xff);
            /*CRC16 CCITT*/
            //CRC16 is calculated over data given/sent (block length*n_frames_sent)
            //SPI does not force CRC checking, but i'll enable it anyway
            //CRC16=size(command+argument) (38 bits)
            sd_raw_send_byte((crc >> 8) & 0xff);
            sd_raw_send_byte((crc >> 0) & 0xff);
            /* receive response */
            for(i = 0; i < 10; ++i)
                response = sd_raw_rec_byte();
                if(response != 0xff)
            return response;

Testingt the sketch IDE tell me something is wrong in "uint16_t crc = calc_crc(mess,((command&arg)|command),CRC16STARTBIT); line and that “‘mess’ was not declared in this scope” followed by many other errors.
Is anybody here who has been able to install and use that library or who has had experience with it?
Seems to me the SDcard library is the only which is able to manage even MMC instead of the usually SD.
Am I wrong?

Thanks in advance!


I'm thinking that the folks at are your best source of help with your snippets. We're a little strange here. We like to see ALL of your code.

Hi PaulS. Yes, I know. It was my fault. Anyway I already fix it myself. Thanks.