Can't seem to get printf working with RTX.

- Have printf working in other programs using serial.c/h and redirect_io.c.
- Using a Segger JLink
- Keil MCBSTM32F200
- RTX Blinky example
- Added STDOUT redirect using the RTE

If I enable trace with bit 31, my program will never start the RTOS and get hung here:

#ifdef DBG_MSG
void dbg_task_notify (P_TCB p_tcb, BOOL create) { while (ITM_PORT31_U32 == 0); ITM_PORT31_U32 = (U32)p_tcb->ptask; while (ITM_PORT31_U32 == 0); ITM_PORT31_U16 = (create << 8) | p_tcb->task_id;
} #endif

If I disable bit31, the Keil RTX tracing the OS / the System and Thread Viewer tab works, but maybe that's something else because the Performance Analyzer tab does not seem to work, it's 0us on all values... If I try and use printf() I get hung here:

uint32_t ITM_SendChar (uint32_t ch) { if ((ITM_TCR & ITM_TCR_ITMENA_Msk) && /* ITM enabled */ (ITM_TER & (1UL << 0) )) { /* ITM Port #0 enabled */ while (ITM_PORT0_U32 == 0); ITM_PORT0_U8 = (uint8_t)ch; } return (ch);

Until I disable the bit0 checkbox in the trace tab. Then the program runs well again, the printf() command "does" nothing though. I can't ever seem to get a message to show up in the serial window.

Does anyone have any thoughts? I'm really not sure where I'm supposed to learn how to initialize the RTX for this or Trace Settings, etc.

More questions in this forum