I am using ARM FVP simulator and trying to read data from a binary file in the host PC to a program running in ARM,
const char *filename = "home/dinusha/executorch/examples/arm/executor_runner/cmake-out/input.bin";
FILE* fp = fopen(filename, "rb"); if (!fp) { ET_LOG( Fatal, "Could not open file %s (errno: %d) for reading, exiting!", filename, errno); _exit(1); }
FILE* fp = fopen(filename, "rb");
if (!fp) {
ET_LOG(
Fatal,
"Could not open file %s (errno: %d) for reading, exiting!",
filename,
errno);
_exit(1);
}
Error : Could not open file home//dinusha//executorch//examples//arm//executor_runner//cmake-out//input.bin (errno: 0) for reading, exiting!
Any idea how to solve this,
Thanks
Hi,My name is Stephen and I work at Arm.Are you simply missing the leading forward slash in front of "home" in the path?The following works for me:#include <stdio.h>#include <stdlib.h>int main(void){ const char *filename = "/home/stephen/test/executorch/examples/input.bin"; FILE* fp = fopen(filename, "rb"); if (!fp) { printf("fopen failed\n"); } else { printf("fopen success\n"); }}Note that on Windows, double backslashes must be used (to escape the path separator) in the file name.If that doesn't fix the issue, please let us know which version of Arm DS and which compiler (Arm Compiler 6?, GCC?) you are using.Hope this helpsStephen
#include <stdio.h>
#include <stdlib.h>
int main(void)
{
const char *filename = "/home/stephen/test/executorch/examples/input.bin";
printf("fopen failed\n");
else {
printf("fopen success\n");
Hi Stephen,
Thanks for the reply, unfortunately adding a forward slash before home did not work,
I am using Corstone-300 Ecosystem FVP and my toolchain is arm-gnu-toolchain-13.3.rel1-x86_64-arm-none-eabi, , I used the following link to download it
https://developer.arm.com/-/media/Arm%20Developer%20Community/Downloads/OSS/FVP/Corstone-300/FVP_Corstone_SSE-300_11.22_20_Linux64.tgz?rev=018659bd574f4e7b95fa647e7836ccf4&hash=22A79103C6FA5FFA7AFF3BE0447F3FF9
following is the command I used to run the FVP
/home/dinusha/executorch/examples/arm/ethos-u-scratch/FVP-corstone300/models/Linux64_GCC-9.3/FVP_Corstone_SSE-300_Ethos-U55 \ -C ethosu.num_macs=${num_macs} \ -C mps3_board.visualisation.disable-visualisation=1 \ -C mps3_board.telnetterminal0.start_telnet=0 \ -C mps3_board.uart0.out_file='-' \ -C mps3_board.uart0.shutdown_on_eot=1 \ -a ./executor_runner/cmake-out/arm_executor_runner \ --timelimit 220 || true # seconds
Hi againI've tested the same source code, compiled with arm-none-eabi-gcc 13.3.1 for Cortex-M55, and it runs successfully on a Cortex-M55 FVP as supplied in Arm DS.I then tried running the same image on FVP_Corstone_SSE-300_Ethos-U55, but so far without success, probably because my simple image doesn't match the memory map or software environment of the SSE-300.fopen requires the use of "semihosting", to allow the Cortex-M55 (target) code to open a file on your Ubuntu (host) filing system.I noticed that FVP_Corstone_SSE-300_Ethos-U55 has semihosting _disabled_ by default.You can see this yourself with./FVP_Corstone_SSE-300_Ethos-U55 --list-params | grep "semihosting"To enable semihosting, you must add "-C cpu0.semihosting-enable=1". Please could you try that?If that doesn't work, I may have to pass this enquiry to the SoC Design and Simulation forum, where there are people more familiar with the SSE-300 model.Stephen
Hi Stephan,
Thanks for checking on this, I tried with "-C cpu0.semihosting-enable=1" and still had no success
Hi againI'm moving this enquiry to the SoC Design and Simulation forum in case anyone there can help with your failing fopen() on FVP_Corstone_SSE-300_Ethos-U55 issue.In the meantime, have you linked with --specs=rdimon.specs, to select the gcc semihosting libraries, and checked the access permissions to input.bin?Stephen