LoPy doesn't boot from sd card



  • 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.



  • @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 :)



  • @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)



  • 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?



  • @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?



  • @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


Log in to reply
 

Pycom on Twitter