views:

135

answers:

2

Hi Guys,

I'm interfacing an SD card to ATmega128 using EFSL. Card gets initialised, but I get an error saying "Unknown error 0xff(see sandisk docs p5-13)"... on serial port output.

That's not all, I hv used 'sprintf' to form strings which I display on serial port. The puzzling thing is, I'm also getting the actual formatting characters like "%02d" on the output ! I think my application itself is crashing. I can give my source code, but it's too big. If anyone wants to look at it , i'll copy paste it here.

I've also checked the sandisk docs p5-13 but I can't figure it out...

I'm gonna need help on this one guys... Please let me know if anyone knows anything about this Thanxs...

+1  A: 

I happen to have written some code for an ATmega8 and written my own printf function that outputs to the serial port here.

the SerWrite function is your function that transfers a 0-terminated unsigned char array to the serial port.

#define SIZE_STATUS 80

void ser_printf(const char *fmt, ...) {
    va_list args;
    uchar STATUS[SIZE_STATUS];
    va_start(args, fmt);
    uchar s = (uchar) vsnprintf(STATUS, SIZE_STATUS, fmt, args);
    va_end(args);
    SerWrite(STATUS, s); 
}
Otto Allmendinger
+1  A: 

I don't know how, but problem was solved when I used a different card. I tried two 1/2 GB cards with FAT32 formatting; both didn't work, But the card that worked was 16 MB canon card with FAT12 formatting.I'm trying to figure this out. I'll post the answer if I find it, Thanks anyway guys...