Skip to contentSkip to conversation

wl1271 with atmel-mci

DISCUSSION Logan Gunthorpe 1 participant 2 messages Jul 22, 2010 – Jul 26, 2010

lore
Share & tools
lore
#0 lore raw

Hi Luciano,

I've had the wl1271 working for the most part on an Atmel micro-controller, but I've been fighting with a bug for the past couple of days.

The problem happens whenever I try to transmit large packets of data (using iperf, or nc, etc) the driver would hang and no longer be able to send packets. tx_queue_len in the debugfs would then grow as I tried to send packets but nothing would actually be sent to the device. At the same time receiving packets would consistently work all of the time.

When this occurred I usually got the following messages:

atmel_mci atmel_mci.0: data CRC error
wl1271: ERROR sdio write failed (-84) - addr 0x14fd8, 1076 bytes, 1

(Note: I added the bit at the end of the wl1271 write failed message in order to try and debug this problem.)

Upon further investigation I found that any calls to sdio_writesb with a length greater than or equal to 1024 will occasionally fail with a data CRC error and this would cause the device to stop working.

I have also found that the following ugly hack in wl1271_sdio_raw_write seems to fix the problem:

if (len <= 1000) {
    ret = sdio_writesb(func, addr, buf, len);
} else {
    ret = sdio_writesb(func, addr, buf, 1000);
    ret |= sdio_writesb(func, addr, &buf[1000], len-1000);
}

Based on the above, I am currently thinking there may be a bug in the atmel-mci driver that causes this problem. Therefore, I will likely contact that driver's maintainer next. I was just hoping to get your insight in case there is something I am missing on the wl1271 side.

Thanks,

Logan

#1 lore raw

Hi Everyone,

Quoted 8 lines

I've had the wl1271 working for the most part on an Atmel micro-controller, but I've been fighting with a bug for the past couple of days.

The problem happens whenever I try to transmit large packets of data (using iperf, or nc, etc) the driver would hang and no longer be able to send packets. tx_queue_len in the debugfs would then grow as I tried to send packets but nothing would actually be sent to the device. At the same time receiving packets would consistently work all of the time.

When this occurred I usually got the following messages:

atmel_mci atmel_mci.0: data CRC error
wl1271: ERROR sdio write failed (-84) - addr 0x14fd8, 1076 bytes, 1

Firstly, I'd like to let anyone who's interested know that the problem I had above turned out to be a hardware issue. I tried two newly populated boards which both turned out not to exhibit this problem. I now have the wl1271 working on two AT91SAM9G45-EKES development kits.

Using iperf I have gathered some performance data. I am seeing between a wl1271 device and a host PC (connected via a dlink router):

PC to Device: ~23.0Mbit/s
Device to PC: ~21.7Mbit/s

When running in Ad-Hoc mode between two devices I am getting between about 15Mbit/s and 17Mbit/s.

Does anyone have any insight as to why the Ad-Hoc mode between two devices is noticeably slower? Can anything be done to improve this?

Thanks,

Logan