Code Monkey home page Code Monkey logo

Comments (3)

alexandrumot avatar alexandrumot commented on August 17, 2024

It appears there is some collision between I2C2 pins PB11 SDA, PB10 SCL, and SdFat. When I use I2C1 PB8 SCL and PB9 SDA, it writes to SD correctly. One more interesting fact is that it fails to write only when the MCU successfully gets data from BMP280 on I2C2. But I really have to use I2C2 for the BMP.

from sdfat.

greiman avatar greiman commented on August 17, 2024

I have never mapped pins on a Bluepill and don't have one so I can't try anything or help.

If you map SPI pins with SdFat, you may need to call SPI.begin(<args>) before sd.begin() if any arguments are required in the SPI.begin() call.

Add USER_SPI_BEGIN to this definition like this:

#define SD1_CONFIG SdSpiConfig(SD_CS_PIN, USER_SPI_BEGIN | DEDICATED_SPI, SD_SCK_MHZ(18), &sdSPI)

If this fails, try the stm32duino forum for help.

Edit: SdFat never calls any SPI function with pin number arguments. SdFat only calls SPI.begin() with no arguments, SPI.beginTransaction(), SPI.transfer(), SPI.endTransaction() and possibly SPI.end() if sd.end() is called

from sdfat.

alexandrumot avatar alexandrumot commented on August 17, 2024

I see... It appears to be a STM32 core problem. I managed to remap default I2C pins. It writes now.

Thanks

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.