This document provides a way to use the LOCK / UNLOCK command (CMD42) and Secure Erase via Transcend RDF5 Card Reader on Raspberry Pi / NVIDIA Jetson Nano.
After the host sets the password and sends it to the card, the card will be locked. Data will be read and write protected, and can be viewed and changed only by entering the correct password. Where an incorrect password is provided, the card will remain locked.
A password-protected card will be automatically locked after power reset. To permanently unlock a card, please remove the password.
-
Supported Platform
- Raspberry Pi 4 or later
- NVIDIA Jetson Nano
-
Supported SD cards
- Transcend Embedded microSD 430T / 450I / 460I / 460T / 465T
- Transcend Embedded SD SDC460T / SDC400I / SDC240T
-
Supported Card Reader
- Transcend RDF5
Go to the project folder and use the command line below to build an executable file named 'sdsecure'.
gcc main.c libscsi.c -o sdsecure
Please change the < device > parameter by the USB card reader device. ex. /dev/sda
Note:The following functions have to work with Transcend RDF5 card reader.
- Set password for SD card
sudo ./sdsecure --set-pwd <Password> <device>
- After setting the password, lock SD card with the password
sudo ./sdsecure --lock <Password> <device>
- Quick-lock command : replace the steps of setting the password and locking the SD card. The SD card will be locked immediately.
sudo ./sdsecure --quick-lock <Password> <device>
- Unlock the SD card with the password
sudo ./sdsecure --unlock <Password> <device>
- Remove the password of the SD card using the following command.
sudo ./sdsecure --clear <Password> <device>
Force erase all data on the SD card
sudo ./sdsecure --erase <device>
sudo ./sdsecure --status <device>