MicroSD hangup
-
- Posts: 45
- Joined: Wed Nov 15, 2017 9:07 pm
Re: MicroSD hangup
Thank you for following up! I am testing currently with the ESP-IDF master because I need WPA2 enterprise fixes (I don't think they are included in a release so far).
@igrr: Heap poisoning is already set to comprehensive. I actually think this issue is because of verbose logging. Now that we have seen the sequence I go back to error and repeat the test to see if it crashes. For all other devices I change the frequency down to 10000 kHz hoping that it improves the situation. I just hope I don't need to change the layout to be able to power off and on the card :S
@igrr: Heap poisoning is already set to comprehensive. I actually think this issue is because of verbose logging. Now that we have seen the sequence I go back to error and repeat the test to see if it crashes. For all other devices I change the frequency down to 10000 kHz hoping that it improves the situation. I just hope I don't need to change the layout to be able to power off and on the card :S
Re: MicroSD hangup
@ESP_igrr
My bad: v3.2-beta1-34-gfb7ba1baa
The issue is described here: https://www.esp32.com/viewtopic.php?f=2&t=7960&start=10 and here https://github.com/espressif/esp-idf/issues/1651
My summary at the end of the first thread explains the mechanism (as I see it).
Perhaps you could add comments to that post?
My bad: v3.2-beta1-34-gfb7ba1baa
The issue is described here: https://www.esp32.com/viewtopic.php?f=2&t=7960&start=10 and here https://github.com/espressif/esp-idf/issues/1651
My summary at the end of the first thread explains the mechanism (as I see it).
Perhaps you could add comments to that post?
& I also believe that IDF CAN should be fixed.
Re: MicroSD hangup
Unfortunately we were never able to reproduce https://github.com/espressif/esp-idf/issues/1651 based on the description provided there. If you have some code which can be used to reproduce this, and which you can share with us, that would be great!
Re: MicroSD hangup
Perhaps we should jump over to https://www.esp32.com/viewtopic.php?f=2&t=7960&start=10 before I get charged with post hijacking
I could not distill a small example. I think the mechanism described in my post is easy enough to review and follow though.
Essential there was no multi-core protection and so you can find yourself in a race.
Would love to get a second opinion - to put my paranoia at ease.
The beta changes are also quite interesting as they suggest broader protection has been addressed e.g. memory model.
I could not distill a small example. I think the mechanism described in my post is easy enough to review and follow though.
Essential there was no multi-core protection and so you can find yourself in a race.
Would love to get a second opinion - to put my paranoia at ease.
The beta changes are also quite interesting as they suggest broader protection has been addressed e.g. memory model.
& I also believe that IDF CAN should be fixed.
-
- Posts: 45
- Joined: Wed Nov 15, 2017 9:07 pm
Re: MicroSD hangup
Don't worry, everybody want's their issues solved
I have now made another test that regulary writes and downloads from MicroSD with 20000 kHz on another device with another MicroSD and it does not crash so far so I think it is related to printing so much.
All other devices are running fine so far with the 10000 kHz setting. Maybe it really is an issue of the MicroSD? Unfortunately this is the only model I know that is at least 85 degC specified
I have now made another test that regulary writes and downloads from MicroSD with 20000 kHz on another device with another MicroSD and it does not crash so far so I think it is related to printing so much.
All other devices are running fine so far with the 10000 kHz setting. Maybe it really is an issue of the MicroSD? Unfortunately this is the only model I know that is at least 85 degC specified
-
- Posts: 45
- Joined: Wed Nov 15, 2017 9:07 pm
Re: MicroSD hangup
Unfortunately lowering the speed also did not help I'm also trying to find simple reproduction code or procedure but so far it only happens in the field after some hours and my test device that was able to reproduce sometimes was accidentially sent to another plant
Next thing I will do is checking the actual init routine. I think there are some interesting points laid out in this SO answer:
https://electronics.stackexchange.com/a/238217/146576
Especially leaving the controller 8 cycles at the end which might be missing after a crash/corruption... Short outage is no problem for me as long as I can recover from it :S
Next thing I will do is checking the actual init routine. I think there are some interesting points laid out in this SO answer:
https://electronics.stackexchange.com/a/238217/146576
Especially leaving the controller 8 cycles at the end which might be missing after a crash/corruption... Short outage is no problem for me as long as I can recover from it :S
Re: MicroSD hangup
Printing frequency & especially the number of items you print at a time definitely makes a difference.
I was running with stacks at least 1.25K to small for ages without issue. Started debugging & enabled some verbose & boom.
Still finding my feet with ESP but back in the day 5K for a task with printf was reasonable. Most of my ESP tasks were 2k which I accepted as; I though that units were words (no, its bytes) & also the examples generally use that.
Maybe ESP printf is uber cool but suggest you go stupidly large to rule out stack.
I was running with stacks at least 1.25K to small for ages without issue. Started debugging & enabled some verbose & boom.
Still finding my feet with ESP but back in the day 5K for a task with printf was reasonable. Most of my ESP tasks were 2k which I accepted as; I though that units were words (no, its bytes) & also the examples generally use that.
Maybe ESP printf is uber cool but suggest you go stupidly large to rule out stack.
& I also believe that IDF CAN should be fixed.
-
- Posts: 45
- Joined: Wed Nov 15, 2017 9:07 pm
Re: MicroSD hangup
For completenes I attached some scope shots of the signal. The series resistors are not optimal for 20MHz, better with 10MHz or lower but even then the issue persists.
Re: MicroSD hangup
That would really help! I tried some obvious ways to reproduce this (such as, place an abort() call into sdmmc driver, to simulate a crash while reading from the card; reset the ESP32 externally while read is in progress) but so far the card could be re-initialized every time.PaulFreund wrote: ↑Fri Nov 16, 2018 9:39 pmI'm also trying to find simple reproduction code or procedure
-
- Posts: 45
- Joined: Wed Nov 15, 2017 9:07 pm
Re: MicroSD hangup
Unfortunately I am only now getting to work on this again. I noticed one thing and am wondering where it came from. I could not find something in the simplified SD spec but the example notes here https://github.com/espressif/esp-idf/tr ... ge/sd_card state: "10k pullup in SD mode"
Does this imply I should not have a 10k Pull-Up in SPI mode? Is the ESP actively driving this pin the whole time? Should I try to drive it low?
Does this imply I should not have a 10k Pull-Up in SPI mode? Is the ESP actively driving this pin the whole time? Should I try to drive it low?
Who is online
Users browsing this forum: Baidu [Spider] and 68 guests