cancel
Showing results for 
Search instead for 
Did you mean: 

PSoC 5, 3 & 1 MCU

Anonymous
Not applicable

How to use semi hosting in POSC?

0 Likes
Reply
1 Solution
Employee

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)

View solution in original post

2 Replies
Employee

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)

View solution in original post

Anonymous
Not applicable

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?

0 Likes
Reply