In e2studio (Synergy project), when I read a .txt file from emmc I put all the data in a structure in RAM and when I write, I copy all the data of the structure in the file. So the .txt file and the structure contains the same quantity of data.
What I need to do now is use a bigger .txt file (so the data in the file are more than the data that the structure contains), from which I want to read only a part of it and put the data in the same structure I already use.
I should read the data in the file from a specified position (an offset) instead of from the beginning. Is it possible?
In the same way, I need to write the data of the structure in a specified position in the file instead of from the beginning.
These are the functions that I am using now:
char nameFile_ReportCycle[] = "Report_cycle.txt";FX_FILE g_file_report_cycle;struct TypeReportCycle ReportCycle[NUM_CYCLE];
#define fx_file_read _fxe_file_read#define fx_file_write _fxe_file_write
fx_file_read(&g_file_list_cycle, &ListCycle, sizeof(struct TypeListCycle)*(NUM_CYCLE), &tmp);fx_file_write(&g_file_report_cycle, &ReportCycle, sizeof(struct TypeReportCycle) * NUM_CYCLE);
Thank you
Hello, stage.
If you really want to read and write files, you should go Synergy community and ask about using FileX.However you just would like to use file data in your program, you could static link files…
Solved. Thank you.
If you really want to read and write files, you should go Synergy community and ask about using FileX.However you just would like to use file data in your program, you could static link files by using ".incbin" directive in an asm file.cf. https://japan.renesasrulz.com/cafe_rene/f/forum21/4964/e2-studio/27723#27723
Or, directly include files using INPUT( ) in the linker script.cf. https://community.nxp.com/t5/S32-Design-Studio-Knowledge-Base/HOWTO-Link-a-binary-file-s-into-the-application-project-using/ta-p/1111536https://sourceware.org/binutils/docs/ld/File-Commands.html#index-input-files-in-linker-scripts
Hi Laser,
I hope Okra's answer help you with this. Were you able to read/write to a file from a specified point now? Please confirm so that we can close this thread now. Thank you!
JBRenesasRulz Forum Moderator
https://renesasrulz.com/https://academy.renesas.com/https://en-us.knowledgebase.renesas.com/