Problem with STM32 and SDFat lib on other SPI port

Arduino Asked by LucasN on December 28, 2021

I am using STM32F103C8 and I am triing to compile a code with SDFat library. The problem is I need to use the second channel of the SPI1 (pins PB5,PB4,PB3, PA15):

enter image description here

I found out that is possible to use SDFat lib and include SPIClass inside its constructor. Then I could use this code:

SPIClass SPI_1(PB5,PB4,PB3, PA15);
SdFat sd(&SPI_1); 

The problem is this compliation error:

no matching function for call to 'SdFat::SdFat(SPIClass*)'

Do you have any idea how to solve this error or how to work with SD card on different pins?

Here is source code of this library:

enter image description here

One Answer

Ok, I found out that the sdFat library is not supported on stm32 bluepill (sd card HAL peripherals are not enabled), so I decided to use basic Arduino SD library (it uses SPI commands, not HAL).

Also I have to change pins (from SPI1_1 to SPI1_2) in variant.h and PeripheralPins.c files of bluepill board. - And finally it works (SPI1_2).

Answered by LucasN on December 28, 2021

Add your own answers!

Related Questions

AsyncWebServer giving wdt reset

1  Asked on September 14, 2020 by java-bee


serial 1 was not declared in the scope

1  Asked on July 30, 2020 by mian-yasir-shah


How can I set a timer?

2  Asked on July 24, 2020 by damon-swart


Ask a Question

Get help from others!

© 2022 All rights reserved. Sites we Love: PCI Database, MenuIva, UKBizDB, Menu Kuliner, Sharing RPP, SolveDir