[SOLVED] Ozone and fopen, how does it work ?

This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

  • [SOLVED] Ozone and fopen, how does it work ?


    Normally when using fopen(), I only need to specify the file name and the file gets created in the project directory (It works with IAR and Eclipse).
    But with ozone, there is a problem. For example :

    C Source Code

    1. fopen ("Image.bmp", "w"); // This function return Null and no file is created

    So, I tired this:

    C Source Code

    1. fopen ("\\Image.bmp", "w");
    Now it works fine but the file get created in the C drive not in the project directory.

    Is there a way to specify where the files created by Semi-hosting should be saved in Ozone ? And is It possible to save them in the project directory ?
    I looked at the reference manual and i couldn't figure out how to do it. Could you help me ?

  • Hello,

    Thank you for your inquiry.
    Ozone does not implement fopen for semihosting as Ozone is a host PC application and does not execute code on the target device.
    You can use fopen in your C source code however that runs on the target device which then will open the file on your host PC as expected.
    More information can be found in the J-Link user manual UM08001 and in this thread: [SOLVED] Semihosting and JLink 6.32a

    Best regards,
    Please read the forum rules before posting: Forum Rules

    Keep in mind, this is not a support forum. Its main purpose is user to user interaction.
    Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
    Should you be entitled to support contact us per e-mail.
    Alternatively our support system can be used as well: segger.com/ticket/