[SPAM] Re: RTEMS / Zynq (microZed) - Writing data to a file on removable media (SD card)

Jim Elliott jim.elliott at nta-inc.net
Fri Jul 19 16:51:11 UTC 2019


Pete,

Thank you for sending that. I read that document yesterday before I sent my plea for help that but I have to be honest, it left me more confused more than anything. I am using a SD Card, not ATA, NV, or RAM disk. The ATA, NV, & RAM disk sections all have different procedures and I do not know enough in order to extract certain information from each section to apply to my situation.

In addition to some other defines, I defined the following based on the "Using the RTEMS DOS File System" document:
#define CONFIGURE_MAXIMUM_DRIVERS 10
#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
#define CONFIGURE_APPLICATION_NEEDS_LIBBLOCK
#define CONFIGURE_USE_IMFS_AS_BASE_FILESYSTEM
#define CONFIGURE_LIBIO_MAXIMUM_FILE_DESCRIPTORS 32
#define CONFIGURE_BDBUF_MAX_READ_AHEAD_BLOCKS 32
#define CONFIGURE_BDBUF_MAX_WRITE_BLOCKS      16
#define CONFIGURE_SWAPOUT_TASK_PRIORITY       10
#define CONFIGURE_SWAPOUT_SWAP_PERIOD         250
#define CONFIGURE_SWAPOUT_BLOCK_HOLD          1000

Beyond that I have no idea what to do.

The only devices listed in /dev is:
bpf
bpf0
console
ttyS0
ttyS1

I do not think any of these devices are what I am looking for.

Again, I have no idea what I am doing. This is my very first time using RTEMS. I have never written a driver before. I am not familiar with the particulars on the underlying mechanisms of different filesystems. I am willing to do the work in order to get this going but I need some guidance which I can understand. Any help pointing me to some nice overview / procedure / example / etc would be very helpful.

My development board is a microzed with a zynq processor.

Thanks,

Jim



________________________________
From: users <users-bounces at rtems.org> on behalf of Siddons, David <siddons at bnl.gov>
Sent: Thursday, July 18, 2019 4:07 PM
To: users at rtems.org <users at rtems.org>
Subject: [SPAM] Re: RTEMS / Zynq (microZed) - Writing data to a file on removable media (SD card)


Hi Jim,

   I suspect you need to look at this:

https://devel.rtems.org/wiki/TBR/UserManual/Using_the_RTEMS_DOS_File_System<https://nam03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fdevel.rtems.org%2Fwiki%2FTBR%2FUserManual%2FUsing_the_RTEMS_DOS_File_System&data=02%7C01%7C%7C228965b63ce346aa42d508d70bc3f4e2%7Ca031ec362ef248beab1ed59fe73ec959%7C0%7C0%7C636990808593422771&sdata=RUwaV0J2qJr%2BadqW8C4gKccwwPZxS4Jb2X9U1gbS%2FiY%3D&reserved=0>

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://nam03.safelinks.protection.outlook.com/?url=https%3A%2F%2Furldefense.proofpoint.com%2Fv2%2Furl%3Fu%3Dhttps-3A__devel.rtems.org_wiki_Developer_FileSystems%26d%3DDwMFAw%26c%3DaTOVZmpUfPKZuaG9NO7J7Mh6imZbfhL47t9CpZ-pCOw%26r%3DfGrfLoYyW57FVa-DUXJrrg%26m%3DFuO01lFAGNr49p5k_GtGk_BMrhZtN_V878pZrOkvEHM%26s%3DVP1cIsK6z9dgXzCnpvEXeZWh5v4z_ZfqKW-kLDIU8RA%26e%3D&data=02%7C01%7C%7C228965b63ce346aa42d508d70bc3f4e2%7Ca031ec362ef248beab1ed59fe73ec959%7C0%7C0%7C636990808593422771&sdata=xEP0FZvjf5sYT9mznPTFoGIQa2YAQVmhY9SGUcL13iM%3D&reserved=0>


"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=<https://nam03.safelinks.protection.outlook.com/?url=https%3A%2F%2Furldefense.proofpoint.com%2Fv2%2Furl%3Fu%3Dhttp-3A__lists.rtems.org_mailman_listinfo_users%26d%3DDwICAg%26c%3DaTOVZmpUfPKZuaG9NO7J7Mh6imZbfhL47t9CpZ-pCOw%26r%3DfGrfLoYyW57FVa-DUXJrrg%26m%3DFuO01lFAGNr49p5k_GtGk_BMrhZtN_V878pZrOkvEHM%26s%3DmpxlTdLP1HCKw5ZX38daLLl5xbxfkn9QHg-HvbJrZzE%26e%3D&data=02%7C01%7C%7C228965b63ce346aa42d508d70bc3f4e2%7Ca031ec362ef248beab1ed59fe73ec959%7C0%7C0%7C636990808593432763&sdata=WJhjOjd2WiS61ElddoUQYotDO%2F1aJCe2JpEetFRYnHk%3D&reserved=0>

________________________________

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, ) and destroy all copies.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/users/attachments/20190719/f494d542/attachment-0002.html>


More information about the users mailing list