Welcome to the Pycom forum Forum
    • \[\[global:header.categories\]\]
    • \[\[global:header.recent\]\]
    • \[\[global:header.tags\]\]
    • \[\[global:header.popular\]\]
    • Login

    Explore Pybytes | Official Documentation | Report a Firmware Bug/Issue | GitHub

    LoPy doesn't boot from sd card

    Scheduled Pinned Locked Moved LoPy
    lopysdcardboot.py
    6 Posts 3 Posters 2.6k Views 3 Watching
    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
      mmarkvoort
      last edited by

      Hello,

      On the pycom github page it says if you have a sd card in you lopy, it will boot from it. https://github.com/pycom/pycom-micropython/blob/master/docs/pyboard/general.rst

      I have the boot.py and the main.py on the sd card. But still it isn't booting.
      I have formatted the sd card to fat32.

      When i copied the main.py and boot.py it gives me a message that it will be copied without any settings. Might this be the problem? or am i doing something else wrong?

      Kind regards.

      L 1 Reply Last reply Reply Quote 0
      • L Offline
        livius @mmarkvoort
        last edited by livius

        @mmarkvoort

        I suppose this is not valid for pycom only pyboard

        You must mount sd card self, e.g.

        boot.py in /flash

        from machine import SD
        
        try:
            sd = SD()
            os.mount(sd, '/sd')
            execfile('/sd/boot.py')
        except:
            sd = None
            
        

        in main.py in /flash

        if (sd<>None):
           execfile('/sd/main.py')
        

        but maybe i am wrong and sd should be mounted automatically
        then someone fix me

        think about people first, then computers

        1 Reply Last reply Reply Quote 0
        • M Offline
          mmarkvoort
          last edited by

          @livius

          Your suggestion is working, thanks for that!
          I have added the code in the main.py in /flash. In my boot.py in /flash I mount my sd card like you said, but not with the execfile('/sd/boot.py'). When the main of /flash is executed, the main of /sd will automatically be executed.

          This is working now, but I still think this isn't like it supposed to be.
          Maybe any one else can help?

          M 1 Reply Last reply Reply Quote 0
          • M Offline
            mmarkvoort @mmarkvoort
            last edited by

            My LoPy can detect de SD card and i can run from the SD card.
            But I still can't boot from it.

            Anyone who managed to boot from the SD card?

            J 1 Reply Last reply Reply Quote 0
            • J Offline
              jmarcelino @mmarkvoort
              last edited by jmarcelino

              @mmarkvoort
              As livius explained the instructions you found are for the original pyboard - not the Pycom boards! The pyboard has a SD card slot on the board itself so the pins are already allocated and dedicated to it.

              On the Pycom boards the SD card is an optional add-on, you might have used the pins to attach other devices which could get confused or even damaged if the LoPy tries to communicate with them as if they were an SD card.

              With this in mind I don't think automatically booting from the SD card will be possible, at least not in a general way that is safe and without establishing some sort of resource discovery/plug'n'play communication protocol between the LoPy and Expansion boards (something nice but maybe be a bit outside the scope of these boards)

              M 1 Reply Last reply Reply Quote 0
              • M Offline
                mmarkvoort @jmarcelino
                last edited by

                @jmarcelino

                Thanks for the clear explanation.

                I asked again because i read somewhere that it was possible, but i can't find that page anymore. But maybe that was the original pyboard too.

                Well, then I will continue without :)

                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
                • 1 / 1
                • First post
                  Last post

                Pycom on Twitter

                Pycom