Comments (5)
Looks like something may have changed in the RP2040 SPI driver. Array transfer(buf, count)
is just a slow loop:
void SPIClassRP2040::transfer(void *buf, size_t count) {
DEBUGSPI("SPI::transfer(%p, %d)\n", buf, count);
uint8_t *buff = reinterpret_cast<uint8_t *>(buf);
for (size_t i = 0; i < count; i++) {
*buff = transfer(*buff);
buff++;
}
DEBUGSPI("SPI::transfer completed\n");
}
However if I set:
#define USE_SPI_ARRAY_TRANSFER 2
For SdFat 2.2.3 I get:
write speed and latency
speed,max,min,avg
KB/Sec,usec,usec,usec
2308.25,960,216,220
2310.39,1055,216,220read speed and latency
speed,max,min,avg
KB/Sec,usec,usec,usec
2307.19,257,214,221
2307.19,284,214,221
I don't try to define USE_SPI_ARRAY_TRANSFER for every board any longer since I have been burned by SPI driver changes.
You may be interested in the next SdFat-beta. It will be released soon and have RP2040 PIO SDIO.
Here are current results:
CPU 133MHz:
write speed and latency
speed,max,min,avg
KB/Sec,usec,usec,usec
12819.69,2008,38,38
12657.42,2415,38,38read speed and latency
speed,max,min,avg
KB/Sec,usec,usec,usec
12593.65,77,39,39
12593.65,100,39,39](url)
CPU 250 MHz:
write speed and latency
speed,max,min,avg
KB/Sec,usec,usec,usec
23472.68,1177,20,21
23472.68,1224,20,21read speed and latency
speed,max,min,avg
KB/Sec,usec,usec,usec
23695.17,58,21,21
23695.17,50,21,21
from sdfat.
You may want to post a link to this on the arduino-pico site.
from sdfat.
Looks like something may have changed in the RP2040 SPI driver. Array
transfer(buf, count)
is just a slow loop:
I will write Earle Philhower about this, thank you.
However if I set:
#define USE_SPI_ARRAY_TRANSFER 2
For SdFat 2.2.3 I get:
write speed and latency
speed,max,min,avg
KB/Sec,usec,usec,usec
2308.25,960,216,220
2310.39,1055,216,220
Indeed, with USE_SPI_ARRAY_TRANSFER 2 I got my old performances back (v2.2.2 here)!
write speed and latency
speed,max,min,avg
KB/Sec,usec,usec,usec
2400.49,64444,27211,27302
2400.40,65321,27210,27303
read speed and latency
speed,max,min,avg
KB/Sec,usec,usec,usec
2434.39,26943,26904,26922
2434.43,26941,26905,26921
Thank you!
You may be interested in the next SdFat-beta. It will be released soon and have RP2040 PIO SDIO.
I did read about that in another thread, this is absolutely great!
Unfortunately I need PIO to read from a parallel camera interface, so I have to use regular SPI to write to SD.
from sdfat.
Unfortunately I need PIO to read from a parallel camera interface, so I have to use regular SPI to write to SD.
PIO SDIO uses one PIO. Does you camera use both PIO controllers?
from sdfat.
PIO SDIO uses one PIO. Does you camera use both PIO controllers?
A the moment, yes (one to supply clocks and the other to read data), but it's still WIP, the goal is to use just one PIO. In this case your PIO SDIO would come very handy.
from sdfat.
Related Issues (20)
- Did not work at ESP32-CAM HOT 6
- MMC_ERASE HOT 2
- Wrapper to fs::FS to use SDfat in ESPAsyncWebserver HOT 6
- pico-sdk only rp2040 implementation HOT 11
- ESP32 S3 always fails to mount card HOT 10
- Unable to format flat Spiflash module with ESP8266 HOT 4
- Mount issues for a Windows-formatted card HOT 35
- SD NAND XTSD01G (surface mounted chip) not formating HOT 1
- Unable to share the same SPI bus with TFT_eSPI on ESP32 HOT 3
- Problems with multiple SD card HOT 3
- Long timeout calling begin() on Teensy 4.1 when no card present HOT 5
- SdFat 2.22 with USER_SPI1 pin + another USER_SPI2 in SPI_Mode3 HOT 2
- Problem with SdFat and TwoWire instance. HOT 3
- sd.begin(SPI_CONFIG) breaks my DMA ADC datalogger on the SAMD51 HOT 5
- Issue after latest update. HOT 17
- exFat sd cards not working with Sdinfo.ino example, only FAT32 card HOT 7
- Allocating bin file with 0s HOT 2
- CS_Pin has to be driven high on ESP32 (to be low at the SDCARD) because of some logic inbetween HOT 3
- Initialization fails with ESP32 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sdfat.