Hi, I’m trying to run main.py from an external SD card on a LiPo powered OpenMV Cam H7 Plus.
From the docs and forum posts it seems that if an SD card is present, containing a file named main.py, the bootloader should run it, however that does not seem to work on my cam.
Here’s what I tried, on MacOS Monterey:
- Updated OpenMV IDE today and flashed newest firmware when the IDE prompted me.
- Erased the internal flash with OpenMV IDE > Tools > Erase Onboard Data Flash.
- Manually deleted the content of the NO NAME drive that shows up when the cam is connected.
- Formatted the external SD card with ExFAT (also MS DOS FAT before), named it OPENMV.
- Saved your blink example in a file called main.py to the SD card.
- Ejected the OPENMV SD card from MacOS.
- Inserted the OPENMV SD card to OpenMV cam.
- Powered the OpenMV cam (first with USB and later with just a fully charged LiPo battery).
- No blinking (!) which probably means the code does not run.
(If I “Save open Script to OpenMV Cam” the exact same code runs as expected, but from flash.)
Did the default bootloader change, or do I miss a file (e.g. boot.py, and if yes, how should it look)?
Hi, after saving the file did you safety remove the hard drive?
Generally, the issue would be because the script either has an error or it was not written.
This should not be complex.
The script should be called main.py.
Thanks for the quick reply.
Yes, the file is called main.py and I did eject the SD card via MacOS.
The content of the script is the same as
OpenMV IDE > File > Examples > OpenMV > Basics > main.py
Might want to try reformatting the SD with exFAT, or trying a different card.
Tried ExFAT and MS-DOS FAT.
Also tried to read the (same) card on a Linux machine, works fine.
Will try to find another card.
Some cards just don’t work with ST SDIO core and/or drivers. I know for sure that Samsung EVO works very well with the cam, but you could try any other card. main.py should run from any available storage (flash or sd).
You were right, using a different SD card seems to solve the issue. Thanks a lot.
OK, after further investigation I guess it was my sloppy formatting that caused the issue. MacOS Diskutil shows two entries for a single SD card. Seems to be important to select the “Generic STORAGE DEVICE Media” one (not its child entry) and select “Master Boot Record” in addition to “ExFAT”. Anyway, now both (Kingston 16 GB) cards work fine with the cam.