-
Notifications
You must be signed in to change notification settings - Fork 521
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
STM32duino and SdFat #454
Comments
Looks like
You could try USE_SPI_ARRAY_TRANSFER set to one but I looked at the 2.7.0 version of I can't believe STMicroelectronics not providing fast DMA SPI for STM32 on Arduino. For a while I tried to use STM32Cube but then you give up all the Arduino libraries. I have done projects with ChibiOS, it is a great RTOS but you have to port Arduino libraries. I currently use Teensy 4.1 and RP2040 boards. There is great support for both. |
Thank you for your reply. Can I quote you on the provision of fast SPI DMA by STMicroelectronics ? |
I will remove the custom STM32 code. For now use the standard Arduino API by editing SdFatConfig.h and change this.
Yes. Bet they will hear from other users with apps that need fast SPI. STM32 is now slower than an UNO R3 Uno R3:
STM32 Nucleo L476RG
|
You can do better by using this in SdFatConfig.h
STM32 Nucleo L476RG
Please don't close this since I don't want to change SdFat for a while since I will break all apps using other versions of the STM32 board package before 2.7.0. I may just modify the STM32 code and keep a custom driver using Still the |
Here is Teensy 4.1 using DMA SPI with:
So even with the standard Arduino SPI API you can go fast. Teensy 4.1 also has 4-bit SDIO:
All of these test used 512 byte read/write size. |
Hi, |
@fpistm Here is a logic analyzer trace of transfer(buf, count) 40 MHz clock. almost 600 ns dead time between bytes. SPI transfer rate is about 1.27 MB/sec - DMA should be 5 MB/sec. Whats really sad is SDIO support for STM32. STM32Cube has the wrong approach to SDIO. I did a PIO SDIO for the RP2040 chip which costs $0.75 in quantity or $4 for a Pi Pico board. I get over 20 times faster write on RP2040 than the 1100 KB/sec I get on STM32. |
When I said "any contribution are welcome". I talk generally. This does not mean you should implement the SPI DMA support. :) |
I meant fix SdFat when you break the API. Why not have transfer(txBuf, rxBuf, count). Arduino won't add it to their "standard" API but most other popular board packages have it. transfer(buf, count) trashes buf so if you want to just send data you need to do a memcpy. |
That's the point, to be or not to be fully Arduino Compatible. 🤔 |
That would be great. Some versions of the the When a SPI device is full duplex like a SD card in SPI mode you can't send junk if you only want receive data. Many board support packages now have a API like this.
|
Hi @greiman |
Good morning, |
Fixes greiman#454. Signed-off-by: Frederic Pillon <[email protected]>
Good morning, |
Hello Greiman,
I used, under IDE Arduino 2.2.1, STM32duino 2.6.0 and SdFat 2.2.2 : perfect, it worked perfectly.
Since I upgraded from STM32duino 2.6.0 to 2.7.0, it generates errors, here they are:
Is there a solution by keeping the STM32duino 2.7.0 version ?
The text was updated successfully, but these errors were encountered: