fopen fails with absolute path in linux host (ubuntu 20.04)

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);
}

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

Parents
  • Hi again

    I'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

Reply
  • Hi again

    I'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

Children