first of all thanks a lot for this forum (and the core team of people answering) and micropython in general. I really enjoy working with it and the forum has already helped me a lot.
Now my question:
I was wondering whether it is possible be able to get the machine.SDCard() in main.py also?
If I declare it again, like in the example below, I get an error. But is it somehow possible to get the existing sd card that was declared in boot.py?
Currently using an esp32 ai thinker camera board.
Background is that I would like to deinit the SD card in main.py and then use the pins for sth else and once that's done init the sd card again.
Code: Select all
# in boot.py
>>> sd = machine.SDCard(slot=1, width=1)
# in main.py (would like to deinit the sd card)
>>> sd = machine.SDCard(slot=1, width=1)
OSError: (-259, 'ESP_ERR_INVALID_STATE')
Lorenz