2 Replies Latest reply on Oct 23, 2017 11:50 PM by nareshsudhaakar_2814371

    How to use semi hosting in POSC?

    nareshsudhaakar_2814371

      How to use semi hosting in POSC?

        • 1. Re: How to use semi hosting in POSC?
          anks

          PSoC Creator does not support semihosting. Some third-party debuggers including DS-5 and IAR-EWARM support semihosting.

           

          A linker option is required to use semihosting with some toolchains-

          gcc-arm-embedded: --specs=rdimon.specs (linker option, replaces --specs=nosys.specs)

          MDK: (no options required)

          IAR: --semihosting (linker option)

          1 of 1 people found this helpful
          • 2. Re: How to use semi hosting in POSC?
            nareshsudhaakar_2814371

            Thanks anks !!!

             

             

            Can you still help me a bit, please? I'm using PSOC creator 5 with arm-gcc compiler toolchain and are wanted to enable semihosting feature. As you said I've added -specs=rdimon.specs into the linker options and created a trivial code as below :

            void fdtest(void)

            {

              FILE* f1 = fopen("C:/tmp/fdtest.txt", "w");

              if (!f1) {

                puts("Can't open FILE!");

                return;

              }

              if (fputs("Hello from FD-Test!", f1) == EOF) {

                puts("Can't write FILE!");

              }

              if (fclose(f1)) {

                puts("Can't close FILE!");

              }

            }

            int main()

            {

              puts("Hello from main()!");

              fdtest();

              return 0;

            }

             

             

            But nothing made it work. Am I missing something in the setup?