RTEMS / Zynq (microZed) - Writing data to a file on removable media (SD card)
Siddons, David
siddons at bnl.gov
Thu Jul 18 21:07:26 UTC 2019
Hi Jim,
I suspect you need to look at this:
https://devel.rtems.org/wiki/TBR/UserManual/Using_the_RTEMS_DOS_File_System
or similar.
Pete.
On 7/18/19 4:48 PM, Jim Elliott wrote:
Hello,
Could someone please point me to a resource which explains in as simple terms as possible how to write data to a file on removable media?
I compiled a test application and installed it on a zynq processor (microZed). My BOOT.bin is located in the root directory of a SD card. How can I write files to that SD card?? My application runs fine, I just can't seem to write any data to a file...
The process which I am following is simply:
1) Open file -> fopen( ... )
2) Write to file -> fprintf( ... )
3) Flush file -> fflush( ... )
4) Close file -> fclose( ... )
If I create my file on the root directory I can see it using the built in shell. However, when I take my SD card out and try to open it on my computer the file is gone.
I saw the following mentioned at https://devel.rtems.org/wiki/Developer/FileSystems<https://urldefense.proofpoint.com/v2/url?u=https-3A__devel.rtems.org_wiki_Developer_FileSystems&d=DwMFAw&c=aTOVZmpUfPKZuaG9NO7J7Mh6imZbfhL47t9CpZ-pCOw&r=fGrfLoYyW57FVa-DUXJrrg&m=FuO01lFAGNr49p5k_GtGk_BMrhZtN_V878pZrOkvEHM&s=VP1cIsK6z9dgXzCnpvEXeZWh5v4z_ZfqKW-kLDIU8RA&e=>
"The In Memory File Systems is always the root file system and uses the standard C library heap for storage. The file system will only consume memory for the nodes and files it holds and releases memory back to the heap when no longer used. The design of this file systems is full standards support, small foot print and lower memory overhead. The file system is also fast for small sized files and directories. This suits small configuration files and device driver nodes.
This file system is volatile. After an application restart you will need to construct its contents. RTEMS provides some supporting calls for this plus there is the ability to tar files into it."
... so that explains why my file is gone when I try to check it out on my computer. BUT, using my computer, if I create a subdirectory under root, say "/logs" I am unable to see that directory using the RTEMS shell...
Please forgive what might be a simple oversight here. Clearly I do not know what I am doing. Any help would be greatly appreciated.
Thanks,
Jim
________________________________
CONFIDENTIALITY NOTICE: The contents of this e-mail message may be privileged, confidential, proprietary, Controlled Unclassified Information (CUI) or otherwise protected against disclosure or dissemination. This e-mail message and any files transmitted with it are intended solely for the use of the individual/individuals or entity/entities to whom they are addressed. If you are not the intended recipient of this message, any dissemination, distribution, printing or copying is strictly prohibited. If you have received this message in error, please e-mail or call the sender (jim.elliott at nta-inc.net<mailto:jim.elliott at nta-inc.net>, ) and destroy all copies.
_______________________________________________
users mailing list
users at rtems.org<mailto:users at rtems.org>
https://urldefense.proofpoint.com/v2/url?u=http-3A__lists.rtems.org_mailman_listinfo_users&d=DwICAg&c=aTOVZmpUfPKZuaG9NO7J7Mh6imZbfhL47t9CpZ-pCOw&r=fGrfLoYyW57FVa-DUXJrrg&m=FuO01lFAGNr49p5k_GtGk_BMrhZtN_V878pZrOkvEHM&s=mpxlTdLP1HCKw5ZX38daLLl5xbxfkn9QHg-HvbJrZzE&e=
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/users/attachments/20190718/77d103bf/attachment-0002.html>
More information about the users
mailing list