Sl6087 Spi Failure

Hi Everyone,

Yet another post requesting help from the people far more versed in OpenAt than myself :smiley:

This time I’ve started abusing the on-board microSd card and have found that the functions used to access the card eventually stop accessing it correctly.

From power on ( as in plug in ) everything is fine.
The card has cmd0, cmd55, acmd41, cmd59 and cmd16 sent to it to set up the connection and it’s good.
Writing and reading are fine.

But I’ve integrated an ftp function. This function needs to run as fast and often as it dares to get the data out in a sensible time.
So far tests have been very inconsistent, on one occasion the system did actually complete ( several hours later ). However, for the most part the ftp stops working, and looking at the trace it’s because all commands to the sd card or no longer receiving any response.

Doing an at+wopen=0 then =1 or at+cfun=1 doesn’t fix the problem. The sd card continues ignoring all transmissions.
An actual power cycle to the whole device sorts it, but that is not a good solution for anything.
The sl6087 does not have any way to control the power to the Sd so I am unable to cycle it that way.

Hiya,

Urk. That sounds ugly.

Just out of interest, have you tried the same process with a different (and different brand) of microSD card? Not all cards are the same (unfortunately) - just wondering if you’re tripping over some obscure firmware bug?

Other than that, are you checking the return values for ALL your SPI calls for error conditions?

ciao, Dave

Hi David,

I have not tried another card, I will do that shortly.
In the time between posting my question (turns out i’m useless at keeping an eye on my posts…),
I have been tweaking the existing application to balance the sd card access more evenly across the cyclic timers.

This seems to have had a big effect. It hints towards the sd card, or the code handling the spi directly…(?), is not coping with the re-entrant speed of concurrent commands.

To properly handle error codes, and to probably handle access control, i’m going to have to chop out the existing stuff and get it into its own task really… So either way an overhaul on what’s already there…

I’ll definitely update this space when I have a success.