sd card mount check/os.mount problem

RP2040 based microcontroller boards running MicroPython.
Target audience: MicroPython users with an RP2040 boards.
This does not include conventional Linux-based Raspberry Pi boards.
Post Reply
User avatar
douglas.young
Posts: 3
Joined: Thu Nov 12, 2020 3:16 am

sd card mount check/os.mount problem

Post by douglas.young » Sat May 28, 2022 5:04 am

I am trying to write a datalogging program for a pi pico.

When I run the following code everything works fine:

import os, sdcard
import machine

sd = sdcard.SDCard(machine.SPI(1), machine.Pin(13))
try:
os.mount(sd, '/sd')
except OSError :
print('already mounted')

If I run it a second time, I do not get the print('already mounted') message to come up. Is there something else I should be doing to get to code to run other commands is the sd card is already mounted?

Thank,

Doug

Post Reply