Page 1 of 5

[possible BUG] Bug 458 might not be fixed completely

Posted: Tue Apr 08, 2014 1:12 pm
by positron
Hi,

I was looking over the changes in ChibiOS and found the following.

http://sourceforge.net/p/chibios/bugs/458/

This produces the diff:

https://github.com/ChibiOS/ChibiOS-RT/c ... eaf7823a4d

The same constellation of DCTL, sdc_lld_prepare.. and sdc_lld_wait_transaction_end is present in
sdc_lld_write_aligned() and sdc_lld_read_aligned() but the bugfix only changed one of them:

sdc_lld_write_aligned:

Code: Select all

sdc_lld_prepare_write()
SDIO->DCTRL = ...;
sdc_lld_wait_transaction_end()



sdc_lld_read_aligned:

Code: Select all

SDIO->DCTRL = ...;
sdc_lld_prepare_read()
sdc_lld_wait_transaction_end()


I wonder whether this is correct that way. Seems non-symmetric now.

Re: [possible BUG] Bug 458 might not be fixed completely

Posted: Tue Apr 08, 2014 4:20 pm
by Giovanni
Hi,

I asked the same thing to the person who found and fixed the problem: viewtopic.php?f=16&t=1567&p=14121&hilit=sdc#p14121

Apparently the sequence is correct for the write operation as-is.

Giovanni

Re: [possible BUG] Bug 458 might not be fixed completely

Posted: Tue Apr 08, 2014 4:26 pm
by positron
Thanks.

I hope he's right...

Re: [possible BUG] Bug 458 might not be fixed completely

Posted: Tue Apr 08, 2014 4:33 pm
by Giovanni
Are you experiencing a specific problem?

Giovanni

Re: [possible BUG] Bug 458 might not be fixed completely

Posted: Mon Apr 14, 2014 3:49 pm
by positron
We're trying to track down occasional SD card read/write errors...

Latest evidence suggests a hardware problem. I'll update if a ChibiOS bug is found.

Re: [possible BUG] Bug 458 might not be fixed completely

Posted: Mon Apr 14, 2014 6:22 pm
by Giovanni
Thanks

Re: [possible BUG] Bug 458 might not be fixed completely

Posted: Tue Jan 20, 2015 4:12 pm
by dhampir
Any new information about this one? We seem to have similar problems here. Stressing the SD-Card by constant opening, seeking and writing results in about one error per hour.
The error gets raised in sdc_lld_wait_transaction_end(...) when if ((SDIO->STA & SDIO_STA_DATAEND) == 0) evaluates to true.

Any hints what could cause this would be appreciated.

Re: [possible BUG] Bug 458 might not be fixed completely

Posted: Tue Jan 20, 2015 4:42 pm
by Giovanni
Hi,

Could you try another card?

Such an intermittent problem is probably related to HW problems (card, power, connections length, ringing etc).

Giovanni

Re: [possible BUG] Bug 458 might not be fixed completely

Posted: Tue Jan 20, 2015 5:11 pm
by dhampir
Hi! Yes we tried different cards but we did not see any differences.
Updating to the latest stable version improved the behaviour significantly (before: Ver 2.4.x, one error in ~60 sec, after: Ver 2.6.6 ~60 min).
Reading other threads i've got some inspiration about retries and timeouts, but knowing the exact cause would of course be helpful.
There seems to be no significant noise on the sdio and power lines in general, but with about one error in 60 mins this is hard to track.
Maybe this Thread is not the perfect location for this question because it does not have to be related to Bug 458.

And to complete the info about our setup: Selfmade Board with an STM32F407VGT6

Re: [possible BUG] Bug 458 might not be fixed completely

Posted: Tue Jan 20, 2015 5:47 pm
by Giovanni
Hi,

Could you try to change this:

Code: Select all

  if ((SDIO->STA & SDIO_STA_DATAEND) == 0) {
    osalSysUnlock();
    return HAL_FAILED;
  }


In this:

Code: Select all

  while ((SDIO->STA & SDIO_STA_DATAEND) == 0)
    ;


And the see if the problem disappears or the system remains locked in the loop.

Giovanni