I use T20 as the processor of a printer and I need it to backup the data so that if suddenly the power is off the variable data is retained and not lost.
How can I do that ?
If you store your critical data to the FlashDisk (as file using CreateFile) you are already good to go. If you format the FlashDisk please make sure you use TFAT. This ensures you don’t end up with a corrupted file system at a sudden power loss. You can find some more information about this here:
Thanks for your answer.
I need to clarify my question a bit more,
- We are using a T20 in a mains powered printer.
- We have files with continuously updating user data that must be backed up to the flash when
the printer is turned off.
- At power down we need the Tegra to back this data up and then shut down itself.
- We are assuming that Tegra needs a reserve power source to perform the backup.
- We are considering using a lithium battery or a high density electrolytic capacitor. Are these suitable ? or do you suggest any other way ?
- Currently we use PXA270 and perform a backup to flash every 5 minutes.
- This can affect the time
the printer takes to respond to a
- Ideally the backup process would not take place while the printer had mains power and only when mains power was lost.
- We are looking at designing the peripheral circuit so that the Tegra runs in a minimal configuration while it backs up when the power is lost. e.g we don’t need the user display on.
Thank you for the clarification. Since the Colibri T20 does not have a built in power failure detection, some extra hardware is required. You need to built a circuit on your carrier board that is detecting a power failure of the mains. The easiest way is changing the level of a GPIO that goes to the T20 as soon as the mains is removed.
Write a interrupt routine that will be triggered by this GPIO. This routine should switch off immediately all peripherals that are not needed for the backup process, such as the display. Start then saving the backup files. Finally you can shut down the module or you can simply remove its power since the OS image can be protected against power failure corruption by using TFAT.
As you have already assumed correctly, the whole backup process will need a reserve power to perform. Whether a high capacity capacitor is sufficient or a small lithium battery is required, depends on the duration of the backup process and how many unnecessary peripherals you can shut down. Please do the calculations by measuring the time and the current consumption. Please take in account that the current consumption of the T20 SoC depends on its temperature. At high temperatures, its consumption can be increased by up to 50%. Take enough margin in your calculations.
I shall contact you if I needed more help on this.