cancel
Showing results for 
Search instead for 
Did you mean: 

Why does Terminal I/O redirection break on IAR when enabling CubeMX FreeRTOS?

Legacy member
Not applicable

I created two CubeMX projects for an STM32L412K Nucleo and IAR EWARM 8.50.9 (licensed).

Project A is a simple default, I don't modify anything at all.

Project B takes project A and enables FreeRTOS in the Middlewares.

I add "printf("test") before while(1) in Project A, and before osKernelStart() in Project B.

When I debug Project A, the test message appears in Terminal IO. The implementation appears to follow _DLIB_FILE_DESCRIPTOR=0, because putchar calls _write as shown in the DLIB library file source.

However, Project B does NOT print anything. And the disassembly shows that putchar calls fputc, which looks like DLIB putchar.c was compiled with _DLIB_FILE_DESCRIPTOR=1.

  1. Nowhere is DLIB_FILE_DESCRIPTOR reconfigured in either project. And manually setting it to zero doesn't fix Project B.
  2. Nowhere is weak putchar() overridden in either project.

I can't figure out what is causing this behavior.

1 ACCEPTED SOLUTION

Accepted Solutions
Legacy member
Not applicable

Solved. printf() was called before the osKernelStart(). Placing a printf() in a task worked fine.

View solution in original post

1 REPLY 1
Legacy member
Not applicable

Solved. printf() was called before the osKernelStart(). Placing a printf() in a task worked fine.