Code Monkey home page Code Monkey logo

Comments (5)

greiman avatar greiman commented on August 17, 2024

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,220

read 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,38

read 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,21

read speed and latency
speed,max,min,avg
KB/Sec,usec,usec,usec
23695.17,58,21,21
23695.17,50,21,21

from sdfat.

greiman avatar greiman commented on August 17, 2024

You may want to post a link to this on the arduino-pico site.

from sdfat.

FerGT50 avatar FerGT50 commented on August 17, 2024

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.

greiman avatar greiman commented on August 17, 2024

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.

FerGT50 avatar FerGT50 commented on August 17, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.