🤖Have you ever tried Chat.M5Stack.com before asking??😎
    M5Stack Community
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Register
    • Login

    ATOM TF-CARD Kit SPI pins are not default SPI pins?

    Scheduled Pinned Locked Moved Atom
    5 Posts 3 Posters 8.9k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • M Offline
      mviewlab
      last edited by

      Hi,

      I just wanted to ask if the pins used for SD card interface on ATOM TF-CARD Kit are just GPIO pins and they not default SPI pins of ESP32 Pico?
      Because I tried to use it with esp-idf and it does not work. Because SD card driver of esp-idf uses default SPI pins.

      Can you please suggest any way to use ATOM TF-CARD Kit with esp-idf?

      Thanks

      1 Reply Last reply Reply Quote 0
      • felmueF Offline
        felmue
        last edited by

        Hello @mviewlab

        yes, they are just GPIO pins. Please checkout the pinmap here.

        Thanks
        Felix

        GPIO translation table M5Stack / M5Core2
        Information about various M5Stack products.
        Code examples

        1 Reply Last reply Reply Quote 0
        • P Offline
          pieter
          last edited by

          How to use the ATOM TF-Card in Python?

          I tried to mount the TF-CARD as below with my ATOM Matrix but it when I load my code I get a red cross on the display. (I use cs=21 because it is not used in the ATOM)

          import uos
          uos.sdconfig(uos.SDMODE_SPI,clk=23,mosi=19,miso=33,cs =21)
          uos.mountsd()

          1 Reply Last reply Reply Quote 0
          • felmueF Offline
            felmue
            last edited by

            Hello @pieter

            this works for me:

            from machine import SDCard
            from machine import Pin
            import os
            
            try:
                sd = SDCard(slot=3, miso=Pin(33), mosi=Pin(19), sck=Pin(23), cs=Pin(4))
                sd.info()
                os.mount(sd, '/sd')
                print("SD card mounted at \"/sd\"")
            except (KeyboardInterrupt, Exception) as e:
                print('SD mount caught exception {} {}'.format(type(e).__name__, e))
                pass
            
            print(os.listdir('/sd'))
            

            Note: mostly taken from boot.py from an M5Core2 with modified pin config. CS pin is not really required as the SD card always selected anyways.

            Thanks
            Felix

            GPIO translation table M5Stack / M5Core2
            Information about various M5Stack products.
            Code examples

            P 1 Reply Last reply Reply Quote 0
            • P Offline
              pieter @felmue
              last edited by

              @felmue said in ATOM TF-CARD Kit SPI pins are not default SPI pins?:

              sd.info()

              Hi Felix,
              Thanks a lot.
              Your solution also works for me.

              1 Reply Last reply Reply Quote 0

              Hello! It looks like you're interested in this conversation, but you don't have an account yet.

              Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

              With your input, this post could be even better 💗

              Register Login
              • First post
                Last post