SWV ITM Console is not Enabled...Why Not?
I had created a Project using STM32Cube MX/IDE (versions 6.17 and 2.1.1 respectively)
in which I had set up the SWV ITM Console as the output of printf().
This was working as expected
Then, I moved the same project to a new machine under STM32Cube MX/IDE (versions 6.18 and 2.20 respectively)
When I’m debugging with my new machine, the SWV ITM Console gets no visible output.
I was able to confirm (with breakpoints) that the function ITM_SendChar() *is* getting called as expected.
However, referring to the source code below:
__STATIC_INLINE uint32_t ITM_SendChar (uint32_t ch)
{
if (((ITM->TCR & ITM_TCR_ITMENA_Msk) != 0UL) && /* ITM enabled */
((ITM->TER & 1UL ) != 0UL) ) /* ITM Port #0 enabled */
{
while (ITM->PORT[0U].u32 == 0UL)
{
__NOP();
}
ITM->PORT[0U].u8 = (uint8_t)ch;
}
return (ch);
}
...the breakpoints show that the “if()” statement at the start is failing,
so no characters are being written to the PORT.
(On the previous machine, this was working correctly...the “if ()” statement
would succeed and the characters would be written)
So, then...I diligently compared my MX and my IDE configurations for the SWV ITM
on both machines, and I CANNOT see any difference in what I’ve set up.
Yet--on the new machine, it seems that the ITM (per the TCR and TER regs)
is NOT enabled! Whereas, on the original machine it was enabled!
Is there yet-another-esoteric setting (MX or IDE) that I have overlooked?
Any one have some advice that starts with “Don’t forget to...” ?
Thanks!
Paul++
