[U-Boot] load file to memory in standalone program

Hi,I am attempting to read a set of files from the fat file system into a location in memory.This is easy using the command interface using something likefatload mmc 0:1 0x48000000 file.txt However i want to do this in a standalone program. Is there a function call available to do this in a standalone program.if so could someone give an example. Note: i tried do_fat_fsload function call however compiling threw undefined reference. If this is the correct method maybe i am just using it wrong. Thanks Scott

lör 2013-05-18 klockan 15:14 +0000 skrev Scott A:
Hi,I am attempting to read a set of files from the fat file system into a location in memory.This is easy using the command interface using something likefatload mmc 0:1 0x48000000 file.txt However i want to do this in a standalone program. Is there a function call available to do this in a standalone program.if so could someone give an example.
The standalone API do not include filesystem operations, only raw device operations.
I think it would be a great addition to add generic filesystem operations to the standalone API. The fs_read() and fs_write() functions should be possible to export via the standalone API as-is, but should probably be wrapped a little bit to select which filesystem/partition to operate on, similar to do_load() but without the u-boot env magics or variable arguments.
any specification of filesystem type in the API (if needed) should be done in string form to ensure a long term stable API I think.
Regards Henrik

Dear Henrik,
In message 1368920138.23379.14.camel@localhost you wrote:
I think it would be a great addition to add generic filesystem operations to the standalone API. The fs_read() and fs_write() functions should be possible to export via the standalone API as-is, but should probably be wrapped a little bit to select which filesystem/partition to operate on, similar to do_load() but without the u-boot env magics or variable arguments.
Technically you may be right. The reason why we intentionally maintain a very lean interface to standalone programs is that we allow such applications to be distributed even under non-GPL licenses.
If you need more fancy features, just add your code to U-Boot and distribute it under GPL.
Best regards,
Wolfgang Denk

Dear Scott A,
In message COL126-W15B9EDAC5841A2C364A531B6AD0@phx.gbl you wrote:
Hi,I am attempting to read a set of files from the fat file system into a location in memory.This is easy using the command interface using somethin g likefatload mmc 0:1 0x48000000 file.txt However i want to do this in a standalone program. Is there a function call available to do this in a standalone program.if so could someone give an e xample. Note: i tried do_fat_fsload function call however compiling threw undefined reference. If this is the correct method maybe i am just using it wrong.
No, such functionality is not available in standalone programs.
Best regards,
Wolfgang Denk
participants (3)
-
Henrik Nordström
-
Scott A
-
Wolfgang Denk