How to replace files in fat partition in u-boot stage

1.3k views Asked by At

The system has an MMC with FAT partition. The FAT partition contains some files, two of them are called "file_A" and "file_B". I need to prepare a script to toggle between file_A and file_B at the u-boot stage without knowing the file's size in advance. I thought to use fatload and fatwrite commands. I loaded the file to the RAM using fatload without issues using: fatload mmc 0:1 0x0 file_A

Now I have issues with copying the file residing in the RAM to the fat partition using fatwrite, again I don't now the file size in advance (I've noticed that the fatload print information contains the file size, maybe I can use it somehow?).

1

There are 1 answers

3
Tom Rini On

Most commands to load something in to memory set the filesize variable to how much was loaded in to memory.