Giter Site home page Giter Site logo

Comments (6)

Ellerbach avatar Ellerbach commented on May 20, 2024

Related to #1447 for the alternative way. Which indeed should be the best because with the ESP32 family, we now have various pins depending on the platform. So, it should be parameterized.

from home.

CoryCharlton avatar CoryCharlton commented on May 20, 2024

I'm happy to work on this but it looks like nanoframework/nf-interpreter#2829 is close so I'll wait for that to get merged first.

from home.

josesimoes avatar josesimoes commented on May 20, 2024

This requires some thinking about the feature design. So far we've been trying (and succedded) in NOT having platform specific stuff in the "general" class libraries. The platform specifics are all in the various nanoFramework.NNNN.
Worth give it some though before we decide how to implement this.

from home.

CoryCharlton avatar CoryCharlton commented on May 20, 2024

@Ellerbach I'm not sure that this is directly related to #1447.

@josesimoes was your comment meant for #1447?

This doesn't appear to be platform specific but rather specific to the hardware implementation. We're assuming that the card detect pin has a mode of InputPullUp. However there is nothing preventing the user from using an InputPullDown pin.

Additionally I don't believe that we can infer what LOW or HIGH represent with relation to the physical card state as this input doesn't necessarily even need to be directly related to SD card slot.

from home.

josesimoes avatar josesimoes commented on May 20, 2024

@CoryCharlton you are correct. I've added the above comment thinking about #1447... 🤦🏻‍♂️
Despite that it's also valid for the detect pin.

Adding to the above, but I get it that this could be a bit more tricky to implement, I would like to see for ESP32 the same implementation that the STM32 devices have: the card detection GPIO is handled internally, and the mounting takes place auto-magically after insertion. This frees the developer from the hassle of having to programatically call the mount operation, which is something that's most obviously going to happen. Note that the storage device inserted event is still fired, of course.

from home.

CoryCharlton avatar CoryCharlton commented on May 20, 2024

@josesimoes I'm not clear how the SDCard is handled in the STM32 devices as I'm unable to find an implementation of nanoFramework.System.IO.FileSystem.SDCard in any target other than ESP32.

I'm assuming that SDCard is not used in the STM32 devices and instead the drive is just automatically mounted like you mention (I think I see evidence of that here.

If that's the case then I think the STM32 implementation is incorrect (or at least doesn't cover all use cases). A card detect pin does not need to be attached in order for an SD card to function. I have several SD card modules that do not even expose a card detect pin.

Even for the modules that do expose a card detect pin I often don't bother wasting a GPIO for it because my use cases have always required that an SD card be available. I handle this during application initialization and fail if it does not mount.

Long story short we can't rely on card detect for mounting. SDCard could be extended to auto-mount but I think it should still be configurable as there may be use cases where manual mounting is preferred.

I'll start a conversation in Discord to get more input into this. Link

from home.

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.