[possible BUG] Bug 458 might not be fixed completely Topic is solved

Report here problems in any of ChibiOS components. This forum is NOT for support.
positron
Posts: 10
Joined: Mon Aug 19, 2013 4:23 pm

[possible BUG] Bug 458 might not be fixed completely

Post 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.
User avatar
Giovanni
Site Admin
Posts: 14892
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

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

Post 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
positron
Posts: 10
Joined: Mon Aug 19, 2013 4:23 pm

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

Post by positron »

Thanks.

I hope he's right...
User avatar
Giovanni
Site Admin
Posts: 14892
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

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

Post by Giovanni »

Are you experiencing a specific problem?

Giovanni
positron
Posts: 10
Joined: Mon Aug 19, 2013 4:23 pm

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

Post 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.
User avatar
Giovanni
Site Admin
Posts: 14892
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

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

Post by Giovanni »

Thanks
dhampir
Posts: 3
Joined: Tue Jan 20, 2015 4:03 pm

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

Post 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.
User avatar
Giovanni
Site Admin
Posts: 14892
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

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

Post 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
dhampir
Posts: 3
Joined: Tue Jan 20, 2015 4:03 pm

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

Post 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
Last edited by dhampir on Tue Jan 20, 2015 5:48 pm, edited 1 time in total.
User avatar
Giovanni
Site Admin
Posts: 14892
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

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

Post 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
Post Reply