Currently I am using the example-application for Audio Weaver, which I am using with an STM32F407 board.
When I am using printf() or ITM_SendChar(), the output is not visable with the "Serial Wire Viewer" of the 'STM32 ST-Link Utility', which normally would work perfectly with other STM32-based applications.
I am using a system clock of 168 Mhz and a Stimulus of '0' inside the 'STM32 ST-Link Utility' , but also tried other common settings like Stimulus 'all' without success.
Menu-item in ST-Link Utility: ST-LINK->printf for SWO viewer.
Because ITM_SendChar() is used to redirect the output of printf() in your "AWECore ST_EVAL_CortexM4 Release-8.B.5.1_ST_Eval_build61" application,
I guess it worked for you. It is defined in "BoardSetup.c" fputc(), but to be sure, as explained I also used ITM_SendChar() directly inside "Platform.c" like this:
... if (g_bBlinkLED4ForBoardAlive)
{
static INT32 nLoopCount = 0;
// Blink LED4 to show board is alive
nLoopCount++;
if (nLoopCount == 500000)
{
// Indicate board running by toggling LED4
HAL_GPIO_TogglePin(GPIOD, GPIO_PIN_12); // MB 20200828 chaned PIN12 to active by setting the bool-value
printf("hi\n");
ITM_SendChar('x');
nLoopCount = 0;
}
}
} // End while
So, could you please explain the needed settings to make this work?
Thanks a lot!
5:21pm
Hi, just to let you know, I found out myself, that an initialisation was missing, so I guess in Release-mode ITM_SendChar() / printf() never would have worked with the example application "AWECore ST_EVAL_CortexM4 Release-8.B.5.1_ST_Eval_build61\SampleApps\STM32F407"?
Anyways, I added DBGMCU->CR = 0x00000020; to be executed only once to main.c and now I can see the trace with the "serial wire viewer" of the ST-Link utility. System clock is 168000000, Stimulus is 0 - as expected
3:47pm
Hello Visuelle-musik,
Sorry we couldn't get to your question before you were able to figure it out on your own. Nonetheless, glad you figured it out. Thanks for letting us know!
Thanks,
Kevin