External SD card access

Discussion related to "under the hood" OpenMV topics.
User avatar
kwiley
Posts: 107
Joined: Fri Dec 21, 2018 5:22 pm

External SD card access

Postby kwiley » Fri Feb 01, 2019 5:40 pm

I realize OpenMV provides its own SD card, but sometimes you want to utilize an external SD card. For example, I'm working with an Arduino shield that has its own SD card. In Arduinoland, it is accessed from the Arduino SD.h library, which uses SPI to interact with the SD card. There is an SS pin on the shield that you set high or low accordingly, and then SD.h can read and write from the SD card.

Over in PyBoardland, the machine module includes SD support, although emphasizes that it is only intended for some specific one-off use, so I'm not sure this would work on PyBoard anyway, but in OpenMV, machine doesn't even seem to include those SD options. Is there a completely different module or set of routines I should be using? Can I use an SD card that is on some external SPI-based system?

I realize that with enough elbow grease I could write an SPI SD library from scratch, since SPI is already supported, but I'm asking if there is a SD support already included that I have somehow overlooked?

Thanks.
User avatar
iabdalkader
Posts: 918
Joined: Sun May 24, 2015 3:53 pm

Re: External SD card access

Postby iabdalkader » Fri Feb 01, 2019 6:08 pm

kwiley wrote:
Fri Feb 01, 2019 5:40 pm
I realize OpenMV provides its own SD card, but sometimes you want to utilize an external SD card. For example, I'm working with an Arduino shield that has its own SD card. In Arduinoland, it is accessed from the Arduino SD.h library, which uses SPI to interact with the SD card. There is an SS pin on the shield that you set high or low accordingly, and then SD.h can read and write from the SD card.

Over in PyBoardland, the machine module includes SD support, although emphasizes that it is only intended for some specific one-off use, so I'm not sure this would work on PyBoard anyway, but in OpenMV, machine doesn't even seem to include those SD options. Is there a completely different module or set of routines I should be using? Can I use an SD card that is on some external SPI-based system?

I realize that with enough elbow grease I could write an SPI SD library from scratch, since SPI is already supported, but I'm asking if there is a SD support already included that I have somehow overlooked?

Thanks.
That SD module is for a specific port (WiPy), we use the MicroPython SDIO driver in the stm32 port, also the storage needs to be mounted at boot time (and can't be changed later). Anyway at some point we used our own SDIO and SPI drivers, the old SPI driver is still around if you want to use it as a start:

https://github.com/openmv/openmv/blob/m ... card_spi.c

There's no guarantee that it still works or that it will even compile, I just kept it for no reason.
User avatar
kwagyeman
Posts: 3207
Joined: Sun May 24, 2015 2:10 pm

Re: External SD card access

Postby kwagyeman » Fri Feb 01, 2019 6:11 pm

@kwiley - Now this is a feature request too far :)
Nyamekye,
User avatar
kwiley
Posts: 107
Joined: Fri Dec 21, 2018 5:22 pm

Re: External SD card access

Postby kwiley » Fri Feb 01, 2019 7:29 pm

Never a feature request, always an inquiry to current capabilities that I'm unsure I'm aware of. No worries.
allensmith
Posts: 1
Joined: Fri Feb 08, 2019 12:00 am

Re: External SD card access

Postby allensmith » Fri Feb 08, 2019 12:21 am

The external card is not working properly on Windows 10. It is happening after updating my device. I want to fix Windows 10 Automatic Repair. Is there any solution?
User avatar
kwagyeman
Posts: 3207
Joined: Sun May 24, 2015 2:10 pm

Re: External SD card access

Postby kwagyeman » Fri Feb 08, 2019 12:28 am

Um, I'm not sure what you are talking about. He link you gave is too your computer being broken.
Nyamekye,

Return to “Technical Discussion”

Who is online

Users browsing this forum: No registered users and 13 guests