CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

CCS drivers reliability (MMC/SD)

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
Pret



Joined: 18 Jul 2006
Posts: 92
Location: Iasi, Romania

View user's profile Send private message

CCS drivers reliability (MMC/SD)
PostPosted: Sun Jan 20, 2008 1:00 pm     Reply with quote

During my experience in CCS compiler, i have found some bugs in their driver implementations. Is not really a shock, but what is really troubles me is that they are not testing some code paths at all. For example, taking the mmcsd.c driver. Regarding CRC checks i have found:
Code:
// if the CRC is enabled we have to calculate it, otherwise just send an 0xFFFF
   if(g_CRC_enabled)
      spi_xfer(mmcsd_spi, mmcsd_crc16(ptr, size));
   else
   {
      spi_xfer(mmcsd_spi, 0xFF);
      spi_xfer(mmcsd_spi, 0xFF);
   }
If Crc is enabled, does spi_xfer sends two bytes of crc16 or just the low order byte? The spi_xfer documentation says that
Code:
data is the variable or constant to transfer via SPI. The pin used to transfer data is defined in the DO=pin option in #use spi.
and nothing more related with the size. In #use statement appears BITS=8.

Moreover, in
Code:
if(make16(spi_xfer(mmcsd_spi, 0xFF), spi_xfer(mmcsd_spi, 0xFF)) != mmcsd_crc16(g_mmcsd_buffer, MMCSD_MAX_BLOCK_SIZE))
where
Code:
#define MMCSD_MAX_BLOCK_SIZE 512
and
Code:
unsigned int16 mmcsd_crc16(char *data, unsigned int8 length);
We have an int8 length and 512 value passed. Not commenting the fact that CRC is disabled by default in the very first initialization routine.

This gives me some "emotions" when i'm delivering projects that contains CCS drivers like usb, i2c, lcd and who knows... build-in functions that you really dont know what's in there...
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group