Hi Ben
Right now, the SD card is working very well with the ESP32-S3 and FC11.
But...
Append a string[20] isn't practical, to save a text line.
For the component File (ESP32 SDMode) is a longer string possible?
Maybe 150, 200, or 512—would be better.
File (ESP32 SDMode) longer string possible?
-
stefan.erni
- Valued Contributor
- Posts: 1305
- http://meble-kuchenne.info.pl
- Joined: Wed Dec 02, 2020 10:53 am
- Has thanked: 246 times
- Been thanked: 258 times
-
BenR
- Matrix Staff
- Posts: 2343
- Joined: Mon Dec 07, 2020 10:06 am
- Has thanked: 647 times
- Been thanked: 856 times
Re: File (ESP32 SDMode) longer string possible?
Hello Stefan,
The string should be a pointer and so allow you to add your own string of any size. Try a bigger string and it should work, shout if it doesn't as it could be the "make a copy" parameter check box has been ticked by accident?
The string should be a pointer and so allow you to add your own string of any size. Try a bigger string and it should work, shout if it doesn't as it could be the "make a copy" parameter check box has been ticked by accident?
-
stefan.erni
- Valued Contributor
- Posts: 1305
- Joined: Wed Dec 02, 2020 10:53 am
- Has thanked: 246 times
- Been thanked: 258 times
Re: File (ESP32 SDMode) longer string possible?
Hi Ben
You're right...
long string are already ok.
I made a lot of test with the string write to the sd-card (no interrupt)
The test are here: And every test is working fine. PERFECT!
But if I sample and save data, there is a problem with the long string.
On top I save short string 25 times. its ok.
On Botton I save a long string in one go. I get problem even if i use simulate the data but interrupt is on.
The result with short string is perfect.
but with the long string a lot of data is missing or wrong.
I'll see what I can do.
You're right...
long string are already ok.
I made a lot of test with the string write to the sd-card (no interrupt)
The test are here: And every test is working fine. PERFECT!
But if I sample and save data, there is a problem with the long string.
On top I save short string 25 times. its ok.
On Botton I save a long string in one go. I get problem even if i use simulate the data but interrupt is on.
The result with short string is perfect.
but with the long string a lot of data is missing or wrong.
I'll see what I can do.
-
BenR
- Matrix Staff
- Posts: 2343
- Joined: Mon Dec 07, 2020 10:06 am
- Has thanked: 647 times
- Been thanked: 856 times
Re: File (ESP32 SDMode) longer string possible?
Hello,
I think the problem may be doing the conversion to string inside the concatenate, there is a temporary string created to allow this but it is limited in size to 20 characters by default.
Try doing this instead to work around the problem.
.TempStr = ToString$(All_Data_Int[.count])
Save_Str = Save_Str + .TempStr
Save_Str = Save_Str + "\r\n"
I think the problem may be doing the conversion to string inside the concatenate, there is a temporary string created to allow this but it is limited in size to 20 characters by default.
Try doing this instead to work around the problem.
.TempStr = ToString$(All_Data_Int[.count])
Save_Str = Save_Str + .TempStr
Save_Str = Save_Str + "\r\n"
-
stefan.erni
- Valued Contributor
- Posts: 1305
- Joined: Wed Dec 02, 2020 10:53 am
- Has thanked: 246 times
- Been thanked: 258 times
Re: File (ESP32 SDMode) longer string possible?
Hi Ben
It didn't help, even when I briefly disabled the IRQ.
But 25 short strings work fine.
It didn't help, even when I briefly disabled the IRQ.
But 25 short strings work fine.