B4R Question rSD32 lib and rSD lib with ESP32

peacemaker

Expert
Licensed User
Longtime User
Hi, All and @candide

My test MicroSD card is rather old, 2 GB one.

1) Strange, but rSD32 lib cannot be used - ESP32 MCU is rebooted at SD.totalBytes, but previous SD.cardSize works OK:
load:0x40080400,len:4
load:0x40080404,len:3504
entry 0x400805cc
AppStart
SD card attached
check type of card:
SD Card Type: SD
SD Card Size: 1882
assert failed: xQueueSemaphoreTake queue.c:1653 (( pxQueue ))
Backtrace: 0x40082601:0x3ffb1ee0 0x400899fd:0x3ffb1f00 0x4008ea86:0x3ffb1f20 0x4008a176:0x3ffb2050 0x400d5a44:0x3ffb2090 0x400d4b73:0x3ffb20c0 0x400d4ef7:0x3ffb20f0 0x400e696d:0x3ffb2120 0x400e7299:0x3ffb2140 0x400e8d5f:0x3ffb2180 0x400d4a2a:0x3ffb21c0 0x400d3866:0x3ffb21f0 0x400d270d:0x3ffb2210 0x400d27af:0x3ffb2230 0x400d3aea:0x3ffb2250 0x400d8fbe:0x3ffb2270 0x4008bdc6:0x3ffb2290
ELF file SHA256: 462c4bd8e0f23235
Rebooting...
ets Jul 29 2019 12:21:46
rst:0xc (SW_CPU_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:1
load:0x3fff0030,len:4832
load:0x40078000,len:16460
load:0x40080400,len:4
load:0x40080404,len:3504
entry 0x400805cc
AppStart
SD card attached
check type of card:
SD Card Type: SD
SD Card Size: 1882
I was trying to init with low frequency also, but in vain.
Any idea why ?


2) Regular rSD works (not fully OK writing, debugging yet), reads and writes, but found that each 100 text lines (20 bytes each) - are written during ... 6+ seconds !
It is very slow.
What are your writing speed results ?

3)
21:22:01.745 -> Reading file: /hello.txt

21:22:01.745 -> Read from file: Hello World!

21:22:01.745 -> Deleting file: /foo.txt

21:22:01.745 -> File deleted

21:22:01.745 -> Renaming file /hello.txt to /foo.txt

21:22:01.782 -> File renamed

21:22:01.782 -> Reading file: /foo.txt

21:22:01.782 -> Read from file: Hello World!

21:22:04.268 -> 1048576 bytes read for 2475 ms

21:22:08.076 -> 1048576 bytes written for 3773 ms

21:22:08.647 -> Total space: 1881MB

21:22:08.647 -> Used space: 21MB
 
Last edited:

peacemaker

Expert
Licensed User
Longtime User
If to save the same 100 text lines (20 bytes each) by Inline C++ code - it works 3 times faster !
but its too early to be glad...
 
Upvote 0

candide

Active Member
Licensed User
for SD32 library,
difficult to understand where is the problem, sd32 is similar to SD except for initialize

please to share code used (initialize used) and hard configuration (esp32 version, pins, SPI version)
also, add several Log("stack: ",StackBufferUsage) in your code and you will see if you have stack issue
did you try to lock SD.totalBytes and to check if your code can continue to run ?

i will try to do some tests in next days
 
Upvote 0

peacemaker

Expert
Licensed User
Longtime User
I have tried just your example project of rSD32 on classic ESP32 (old NodeMCU CH340 Type-C module), with default pinout (VSPI = 3, uses SPI3 => MOSI (23), SCK (18), MISO (19), SS (5)), but at the latest B4R v4.0 and ESP32 SDK v3.0.4.
I guess, the latest SDK may give some difference, please, check at your side.
 
Upvote 0
Top