2022-08-08 04:43 PM
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?!
2022-08-08 06:10 PM
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.
2022-08-08 09:03 PM
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.
2022-08-08 11:19 PM
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?
2022-08-09 12:10 AM
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