Enable Semihosting in ARM DS 2024, ARM Compiler

Hi

I want to enable semihosting on ARM DS 2024 so I can create an output file. 
Can you tell me how to do that?

I am using Arm Compiler for Embeded 6 toolchain and Gnu Make Builder.

Warm regards


Parents
  • Hi Stephen

    I noticed "wt" and changed it to "w" before I run the file.
    However, I started debugging using your code and another files that I had been created.
    Although I get "fopen success 
    Hello World!" print in the app console, I can see no folder is created, and even if I create the folder and the file, it would not write anything on that.

    Is there any options that I have to check in ARM DS? (for example in debugging section)

    As you know I am using Arm Compiler for Embedded 6 and I did these changes on ARM DS commands:
    set semihosting enabled on
    set semihosting policy allow


    Thank you in advance for your kind cooperation.





Reply
  • Hi Stephen

    I noticed "wt" and changed it to "w" before I run the file.
    However, I started debugging using your code and another files that I had been created.
    Although I get "fopen success 
    Hello World!" print in the app console, I can see no folder is created, and even if I create the folder and the file, it would not write anything on that.

    Is there any options that I have to check in ARM DS? (for example in debugging section)

    As you know I am using Arm Compiler for Embedded 6 and I did these changes on ARM DS commands:
    set semihosting enabled on
    set semihosting policy allow


    Thank you in advance for your kind cooperation.





Children
  • Hi again

    Apologies for the delay in responding.  Are you still having problems with this?

    I've re-tested the code above and it works for me.  Here's what I did (on my Windows laptop):

    1) Launch Arm DS
    2) Import the startup_Cortex-M7_AC6 example
    3) Replace its main() with the main() I gave above
    4) Compile the project
    5) Create a folder C:\Temp\semihosting
    6) Modify startup_Cortex-M7_AC6-MPS2.launch to use a known-good Cortex-M7 board via DSTREAM
    7) Connect/Debug
    8) Enter "set semihosting policy allow"
    9) Run

    "fopen success" is printed in the App Console, and "Hello World!" is written to out.txt.

    Can you try repeating the above with your own board?

    Stephen

  • Hi and thank you for your support! highly appreciated!

    After we discussed I tried the procedure until I found that I have to Enter "set semihosting policy allow" just before run.
    Then I put this command in run debug initialization, so the problem is solved.

    Warm regards