cancel
Showing results for 
Search instead for 
Did you mean: 

Is there multiple partition support for SDCards in the STM32 processor's HAL or libraries?

Rstua.1
Senior

We need to erase sensitive data in the field in our STM32 controlled devices. The data is stored on an SDCard. It is assumed a secure erasure of, say, a 16GB SDCard will take a long time. Guessing 30 minutes? We don't have that amount of time. We need to erase sensitive data in seconds. Fortunately we only need to erase files totaling several 100KBytes. The easiest way to do this successfully and totally is to put all the secure files into their own partition of, say, 500KBytes size. But... can we access a Mass Storage devices such as an SDCard using the STM32's HAL or libraries when multiple partitions exist on the SDCard?!

4 REPLIES 4

The MSC doesn't care, it's a block storage device

The HOST OS would have an MBR in the first sector describing the partitions, and their relative offset and size as blocks on the media.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Rstua.1
Senior

I hear what you are saying about the host OS. But I believe we are using STMicros Hardware Abstraction Layer (HAL) and STMicro libraries. That is, we are using the STMicro's IDE to create everything but our application. I did not write the bit of the project that deals with the SDCard. But assumed it is STMicro's code which deals with partitions on the SDCard.

I do apologize. I mentioned Mass Strorage Class (MSC) which, I believe, implies a USB connection. I believe the SDCard is talking directly to the STM32 processor. No USB involved.

Pavel A.
Evangelist III

The fast and reliable way to erase large storage is encryption. The key is deleted, the content is lost instantly. Guess what the S in SD card stands for?

KnarfB
Principal III

You probably already use FatFS for file access on the SD card, which is 3rd party software. It supports multiple partitions, see http://elm-chan.org/fsw/ff/doc/fdisk.html

hth

KnarfB