I stumbled on a problem with NXP LPC845 (ARM Cortex-M0+):
The RTT output was very, very slow like it was stuck in the pipe (not flushed).
I have found a report of the same problem here: LPC82x, FreeRTOS, RTT Not Flushing
Finally, I have found the problem (and the solution):
the problem is related to low power mode on the LPC. In FreeRTOS it enters low power mode with the WFI instruction, causing the RTT communication to stuck.
Interestingly, the same WFI works fine on ARM Cortex-M4, so not sure why it affects M0+.
Anyway, the 'solution' was to turn off WFI for Cortex-M0:
Display All
I hope this saves someone else time and efforts,
Erich
The RTT output was very, very slow like it was stuck in the pipe (not flushed).
I have found a report of the same problem here: LPC82x, FreeRTOS, RTT Not Flushing
Finally, I have found the problem (and the solution):
the problem is related to low power mode on the LPC. In FreeRTOS it enters low power mode with the WFI instruction, causing the RTT communication to stuck.
Interestingly, the same WFI works fine on ARM Cortex-M4, so not sure why it affects M0+.
Anyway, the 'solution' was to turn off WFI for Cortex-M0:
Source Code
- void McuRTOS_vApplicationIdleHook(void)
- {
- /* Called whenever the RTOS is idle (from the IDLE task).
- Here would be a good place to put the CPU into low power mode. */
- /* Write your code here ... */
- #if McuLib_CONFIG_CORTEX_M==0 && PL_CONFIG_USE_RTT
- /* somehow on LPC this does slow down RTT communication a lot! */
- #else
- __asm volatile("dsb");
- __asm volatile("wfi");
- __asm volatile("isb");
- #endif
- }
Erich