-
Notifications
You must be signed in to change notification settings - Fork 7.6k
SD Card no longer mounts #8076
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
What error are you seeing? |
@jbhopestar Can you try to start SD card on lower frequency? 40Mhz or 20Mhz. |
I traced it, it fails silently at the fmount call of the fat file system.
After that the serial port stops working.
it neither reports a failed mounting nor prints this message out.
Serial.print("cardType ");
what i see is this:
clockPin 18 MasterInSlaveOut 19 MasterOutSlaveIn 23
cardBegin chipSelect 5
and then nothing.
I tried the two different frequencies, same behaviour. These cards used to
mount at that frequency. I have spent a few days on this one. My only
other clue is that I spent a couple of days working on the tinyusb library
trying to get the cards to mount on an S2 Mini, which also involves the
same fatfs file system. I attempted a reinstall of arduino and all the
libraries. I deleted the tinyUSB libraries in the documents folder as well.
FRESULT res = f_mount(fs, drv, 1);
it fails on this line
in sd_diskio.cpp
line 800
no Serial calls after that line work properly.
…On Fri, Apr 14, 2023 at 9:36 AM Jan Procházka ***@***.***> wrote:
@jbhopestar <https://github.com/jbhopestar> Can you try to start SD card
on lower frequency? 40Mhz or 20Mhz.
—
Reply to this email directly, view it on GitHub
<#8076 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AZLMV3SBUNMQUYXZHAAUGNTXBFHHTANCNFSM6AAAAAAW56XCOM>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Hi, did you format the SD card with Fat32 default and 32 kilo octets. |
Does the SD_Test example work? |
yes. There is little doubt in my mind that this was caused by some change
in the library. What concerns me is that we are not hearing this from many
many people, and if that is the case, I suppose the solution is to buy some
new sd cards. They are older cards.
…On Sat, Apr 15, 2023 at 2:21 AM Simon410 ***@***.***> wrote:
Hi, did you format the SD card with Fat32 default and 32 kilo octets.
—
Reply to this email directly, view it on GitHub
<#8076 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AZLMV3UODQJVYG5EK6EHN23XBI45DANCNFSM6AAAAAAW56XCOM>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
If the test works, then it must have something to do with how you are calling things. Start from the working Test example, and pull the pieces into there to see what breaks it. Start with the SD.begin() parameters, then do the SPI.begin. |
I believe I have discovered the source of the problem in the change in the
library. I regard it as a serious problem that requires an easy fix. Many
of my old projects do not work on account of this problem, and other
projects by other authors do not work on account of this problem. I went
back to the original form of the code to mount the card to verify whether
your assertion is correct. What I got was the watchdog error that claimed
that I had starved the watchdog from any time, so i placed a delay in the
loop and it still did not work. I then noticed that one of my old projects
did not fail, and it had the code that runs the task for Core 0, so I
placed that in the code, and placed a delay, and then the card mounted
properly.
There are hundreds of old projects that did not deal with the second core,
my guess is they all project this new problem, which means in the old
library you didnt have to deal with the second processor, while in the new
library you do. I suspect the old library had that delay in the loop while
checking the reset button. Is there anyone who can fix this problem?
My code runs fine now, now any project that I ran that did not put a delay
in the core 0 loop does not run unless I do it. If this is the new
requirement of the new libraries, it would be useful to let programmers
know.
I have gone back to the original form of the code to see if your assertion
has merit, and it still didnt work
…On Sat, Apr 15, 2023 at 9:10 PM lbernstone ***@***.***> wrote:
If the test works, then it must have something to do with how you are
calling things. Start from the working Test example, and pull the pieces
into there to see what breaks it. Start with the SD.begin() parameters,
then do the SPI.begin.
—
Reply to this email directly, view it on GitHub
<#8076 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AZLMV3RLFX3RC2732HJMGN3XBNBH5ANCNFSM6AAAAAAW56XCOM>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
sorry that last line was from an earlier revision.
…On Mon, Apr 17, 2023 at 4:21 PM joshua bendah ***@***.***> wrote:
I believe I have discovered the source of the problem in the change in the
library. I regard it as a serious problem that requires an easy fix. Many
of my old projects do not work on account of this problem, and other
projects by other authors do not work on account of this problem. I went
back to the original form of the code to mount the card to verify whether
your assertion is correct. What I got was the watchdog error that claimed
that I had starved the watchdog from any time, so i placed a delay in the
loop and it still did not work. I then noticed that one of my old projects
did not fail, and it had the code that runs the task for Core 0, so I
placed that in the code, and placed a delay, and then the card mounted
properly.
There are hundreds of old projects that did not deal with the second core,
my guess is they all project this new problem, which means in the old
library you didnt have to deal with the second processor, while in the new
library you do. I suspect the old library had that delay in the loop while
checking the reset button. Is there anyone who can fix this problem?
My code runs fine now, now any project that I ran that did not put a delay
in the core 0 loop does not run unless I do it. If this is the new
requirement of the new libraries, it would be useful to let programmers
know.
I have gone back to the original form of the code to see if your assertion
has merit, and it still didnt work
On Sat, Apr 15, 2023 at 9:10 PM lbernstone ***@***.***>
wrote:
> If the test works, then it must have something to do with how you are
> calling things. Start from the working Test example, and pull the pieces
> into there to see what breaks it. Start with the SD.begin() parameters,
> then do the SPI.begin.
>
> —
> Reply to this email directly, view it on GitHub
> <#8076 (comment)>,
> or unsubscribe
> <https://github.com/notifications/unsubscribe-auth/AZLMV3RLFX3RC2732HJMGN3XBNBH5ANCNFSM6AAAAAAW56XCOM>
> .
> You are receiving this because you were mentioned.Message ID:
> ***@***.***>
>
|
@jbhopestar Can you provide more details? How did you run on core 0? Where did you place the delay? Can you show a code example that would fix the library? |
#define cButton1Pin 35
#define cButton2Pin 0
TaskHandle_t gSensorEventTask;
void processor2Code( void * pvParameters )
{
Serial.printf("processor2Code running on core %d\n", xPortGetCoreID() );
int button1State = 0;
int button2State = 0;
for(;;)
{
button1State = digitalRead(cButton1Pin);
button2State = digitalRead(cButton2Pin);
if (button1State == LOW)
{
//buttonOnePressed();
delay( 10 );
}
if (button2State == LOW)
{
buttonTwoPressed();
delay( 10 );
}
delay( 10 );
}
}
void buttonOnePressed()
{
Serial.println("ButtonOnePressed");
delay(5);
}
void buttonTwoPressed()
{
Serial.println("ButtonTwoPressed");
delay(5);
}
void setup()
{
Serial.begin(115200);
xTaskCreatePinnedToCore( processor2Code, "SensingTask", 10000, NULL, 2, &
gSensorEventTask, 0 );
}
This is what I had to add to fix the project. I think the changes in the
library have to
do with how the watchdog timer is implemented now. I suspect these changes
came in while
doing the update for the S3 chip.
Somewhere in the library there is a loop looking for a change in state of
the reset
button, the delay needs to be added there.
…On Mon, Apr 17, 2023 at 5:55 PM David McCurley ***@***.***> wrote:
@jbhopestar <https://github.com/jbhopestar> Can you provide more details?
How did you run on core 0? Where did you place the delay? Can you show a
code example that would fix the library?
—
Reply to this email directly, view it on GitHub
<#8076 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AZLMV3XACVDRQAJNAW6KHGLXBW353ANCNFSM6AAAAAAW56XCOM>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Are you saying you had to add a delay to your Task |
in this case, i simplified it to show what i was doing, generally i don't
give processor2 a higher priority,
but it was taken from a project that reads two as5600's reading two motors,
and it was a little slow,
the main loop was serving a website that takes commands to the motors. My
priority in this case was keeping up with the motors.
My main point is that older projects that don't create a second process are
now failing. I don't think you had to in the past.
…On Tue, Apr 18, 2023 at 10:01 AM David McCurley ***@***.***> wrote:
Are you saying you had to add a delay to your Task processor2Code? You
are running that task with Priority 2, which is higher than loop task
priority 1. If there are no delays in processor2Code then you will block
execution of loop functions.
—
Reply to this email directly, view it on GitHub
<#8076 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AZLMV3UWX4URLAZPOBQUIW3XB2NDDANCNFSM6AAAAAAW56XCOM>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
I am saying in the original version i did not create a second process, I
had to create a second process in order to put a delay in it, otherwise the
chip would go into continual reboot. This was not the behaviour in the
past.
…On Tue, Apr 18, 2023 at 11:42 AM joshua bendah ***@***.***> wrote:
in this case, i simplified it to show what i was doing, generally i don't
give processor2 a higher priority,
but it was taken from a project that reads two as5600's reading two
motors, and it was a little slow,
the main loop was serving a website that takes commands to the motors. My
priority in this case was keeping up with the motors.
My main point is that older projects that don't create a second process
are now failing. I don't think you had to in the past.
On Tue, Apr 18, 2023 at 10:01 AM David McCurley ***@***.***>
wrote:
> Are you saying you had to add a delay to your Task processor2Code? You
> are running that task with Priority 2, which is higher than loop task
> priority 1. If there are no delays in processor2Code then you will block
> execution of loop functions.
>
> —
> Reply to this email directly, view it on GitHub
> <#8076 (comment)>,
> or unsubscribe
> <https://github.com/notifications/unsubscribe-auth/AZLMV3UWX4URLAZPOBQUIW3XB2NDDANCNFSM6AAAAAAW56XCOM>
> .
> You are receiving this because you were mentioned.Message ID:
> ***@***.***>
>
|
Did you resolve the issue? |
Yes, I did.
…On Wed, Apr 26, 2023 at 3:14 PM David McCurley ***@***.***> wrote:
Did you resolve the issue?
—
Reply to this email directly, view it on GitHub
<#8076 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AZLMV3VZXI2LUMZOGNPYZHLXDFX2ZANCNFSM6AAAAAAW56XCOM>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Board
ESP32 Dev Module
Device Description
plain module on breadboard
Hardware Configuration
no just the SD card
Version
v2.0.7
IDE Name
Arduino IDE
Operating System
Windows 10
Flash frequency
40Mhz
PSRAM enabled
yes
Upload speed
115200
Description
SDCard mounting fails ungracefully. This code worked in the past with older versions.
Sketch
Debug Message
Other Steps to Reproduce
tried different chips, different setups
I have checked existing issues, online documentation and the Troubleshooting Guide
The text was updated successfully, but these errors were encountered: