I want to perform file operations like fopen, fread, fwrite etc in DS-5 IDE. Currently using redirect I can use printf and redirect the print on UART terminal.
How to perform file operations in my application?
Hi there, I have moved your question to the Arm DS forum. Please let me know if this is incorrect and I can move it to another forum. Thanks for asking your question in the Arm Community.
HiMy name is Stephen and I work at Arm.You say that you currently redirect printf to a UART terminal.I assume that you are using a file such as "retarget.c" (that you can find in the DS-5/ArmDS Examples) which provides your own implementation of fputc().Do you want fopen, fread, fwrite to access a file system on your target system? If so, you'll need to provide your own implementations of fopen(), etc in the same retarget.c.If you want your application to access the file system of the host debugger, then you can use the default "semihosted" versions of fopen(), etc.
For more information, please see:developer.arm.com/.../Redefining-low-level-library-functions-to-enable-direct-use-of-high-level-library-functions-in-the-C-librarydeveloper.arm.com/.../Tailoring-the-C-library-to-your-target-hardwaredeveloper.arm.com/.../Using-semihosting-to-access-resources-on-the-host-computerHope this helps,Stephen