Clear CF data » Historique » Version 13
- Clear CF data
Clear CF data¶
The easiest way to clear the CF card is to extract it from the mCCNC (power off first !), insert it in a card reader and delete the directories and only the directories from a file explorer. However, when no card reader is available or the mCCNC is operated remotely, this is not possible. The procedure detailed hereafter applies when the mCCNC is attached to a Linux box.The data on the mCCNC flash disk are organized in subdirectories under C:\, making it more complicated than a mere
del *.datto clear the data. To do so, you will have to :
- create a file, listing all the directory names you want to delete
- use the Bash script mk-clrtree to create a custom PicoDOS batch file
- transfer the batch file to the mCCNC flash disk and run it from the PicoDOS prompt.
Create the directory list¶
Connect to the mCCNC, capturing the output :
$ minicom -C capture.txt ccn
From the PicoDOS prompt, list all directories, and only directories, in a bare format :
C:\>dir /ad /b
Exit Minicom. Now, there should be a
capture.txt file in the current directory, containing all that you saw in the PicoDOS shell. But it needs some clean-up. Edit the file, and remove all the lines before and after the directory listing, as well as all empty lines, including the last line.
Example directory listing :
14-03-03 14-03-04 14-03-05 14-03-06 14-03-07 14-03-08 14-03-09 14-03-10
Create the PicoDOS batch file¶
It's as simple as :
mk-clrtree capture.txt > clrtree.bat
Check the file, to make sure you're not going to delete important stuff.
Transfer the PicoDOS batch file to the mCCNC flash disk¶
Connect to the mCCNC with Minicom and put it in capture mode. At the PicoDOS prompt, type :
In another Linux terminal, send the batch file to the mCCNC :
$ cat clrtree.bat > /dev/ttyS0
Return to the PicoDOS shell, and type Ctrl+C to exit the capture mode.
if the CompactFlash has 0 byte free, PicoDOS won't be able to capture the file from the PC. Clear one or two directories first.
Running the batch file¶
At the PicoDOS prompt, type :
PicoDOS will prompt for every directory, before deleting the files. You can hit the 'Y' key repeatedly (10-20 times) to try to make the process a bit faster...
When you're done, it is safe to delete the batch file :