How to use semi hosting in POSC?

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Anonymous
Not applicable

How to use semi hosting in POSC?

0 Likes
1 Solution
AnkitaS_51
Employee
Employee
100 likes received 50 likes received 25 likes received

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
AnkitaS_51
Employee
Employee
100 likes received 50 likes received 25 likes received

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)

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