Author Topic: SD-card Tower 52259  (Read 7072 times)

Offline aluminio

  • Newbie
  • *
  • Posts: 2
    • View Profile
SD-card Tower 52259
« on: June 12, 2012, 01:10:27 AM »
Hi Mark,

I am having trouble with SD cards on the Tower 52259, when it starts, the card is detected correctly and disk D mounted, but a few seconds later it is not recognized. After a while, it sees the card again and so on.

The sequence is like this:

Disk D mounted
dir
Directory D:\

---- 31.01.2010  15:59 <DIR>            dir1
0 files with 0 bytes
1 directories, 3895853056 bytes free
D:\>cd dir1
D:\dir1>dir
Directory D:\dir1\

---A 10.05.2012  23:49             2289 0Menu.htm
---A 10.05.2012  23:49             2600 1Lan.htm
---A 10.05.2012  23:49             3012 2I_O.htm
---A 10.05.2012  23:49             2365 3admin.htm
---A 10.05.2012  23:49             1534 4EmailSetup.htm
---A 10.05.2012  23:49             2341 5serial.htm
---A 10.05.2012  23:49             1729 6help.htm
---A 10.05.2012  23:49             1269 7dynamic.htm
---A 10.05.2012  23:49             1689 8Stats.htm
---A 10.05.2012  23:49                4 9Generate.htm
---A 10.05.2012  23:49             1134 ALCD.htm
---A 10.05.2012  23:49            70144 alogo.gif
---A 10.05.2012  23:49             2007 Dback.jpg
---A 10.05.2012  23:49            84422 Eboard.jpg
14 files with 176539 bytes
0 directories, 3895853056 bytes free
D:\dir1>SD-card not responding
SD-card V2 - High Capacity

Disk D mounted
SD-card not responding
SD-card V2 - High Capacity

Disk D mounted
SD-card not responding
SD-card V2 - High Capacity

Disk D mounted
SD-card not responding
SD-card V2 - High Capacity

Disk D mounted
SD-card not responding
SD-card V2 - High Capacity

Disk D mounted
SD-card not responding

Tried my project and a new compilation of the demo app, and the results are the same. I also tried to change timeout parameters with no results.

If I try to access the website repitedly, at some time it stabilizes.

Regards,

Alvaro

Offline mark

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3236
    • View Profile
    • uTasker
Re: SD-card Tower 52259
« Reply #1 on: June 12, 2012, 02:25:53 AM »
Hi Alvaro

Please disabled SD_CARD_RETRY_INTERVAL. This is a new option which polls a register in the SD card to detect when it has been removed (for when the board has no insertion detection switch) and may be able to detect a change of a card for a different one when the register content changes.

Unfortunately this technique doesn't seem to be successful at the moment with cards not responding correctly when polled - it may be SPI/SDIO mode dependent, whereby the 52259 only can do SPI.

In any case this, option shoudn't be used at the moment until it is solved correctly. In case of other difficulties you can use an older utFAT version as fall-back.

Regards

Mark


Offline aluminio

  • Newbie
  • *
  • Posts: 2
    • View Profile
Re: SD-card Tower 52259
« Reply #2 on: June 13, 2012, 12:24:32 AM »
Mark,

It didn't work. Replacing files from version 1.4-10 did the job, just a little tweak needed.

Are you going to add detecting the card trough the slot switch?

Regards,

Alvaro

Offline mark

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3236
    • View Profile
    • uTasker
Re: SD-card Tower 52259
« Reply #3 on: June 16, 2012, 10:23:47 PM »
Hi Alvaro

The idea with polling a register was that it would be a general solution for all card slots, with or without card detect switches. Once this is available (and works correctly) I envisage a more optimised solution when card detect switches are present where a port bit can be checked rather than having to read from the card. In the case where thsi is connected to a processor port which has interrupt capabilities it can then operate based on interrupt events rather than polling, which would be the third and best method.

A problem with polling is that the polling speed has to be chosen as a compromise between not polling too fast to disturb normal operation and not too slow to miss a user quickly changing a card for another. The register polling has the advantage that it can sometimes detect this because the register read will have a different value (eg. size etc.).

Regards

Mark