2021-03-13 05:45 AM
I am doing my first steps on the NUCLEO-WL55JC1 and one of the first things I like to get working is of course some debug printfs. Though I could of course use the VCP via the integrated STLink I'd like to use ITM_SendChar() to output some informtion. Though I think I did everything the same as when I also configured the STM32H735-Discovery, where I got ITM working, nothing is output with the WL55 board. As far as I understood from the documentation SWO output via PB3 should be possible on this board as well? Using WL55 Firmware pack v1.0.0 with CubeIDE 1.6.0
Below are the steps I did to configure my app:
Add to <Projectname>_CM4/Core/Src/main.c in the central while(1)-Loop in main():
uint32_t cnt = 0;
while (1)
{
cnt++;
if (cnt>=65535)
{
ITM_SendChar(0x41);
cnt=0;
}
cnt++;
/* USER CODE END WHILE */
/* USER CODE BEGIN 3 */
}
/* USER CODE END 3 */
To my understanding every 65k iterations an "A" should be printed via ITM and logged to the view. Also the Trace Log View should show some infos about clocks, timestamps, etc (It did with the STMH7)
Nothing is output to the SWV windows.
What am I missing?
2021-03-14 09:17 AM
Are you sure that global variable SystemCoreClock is indeed 48000000? Check using debugger.
Send LF characters after every so many text chars. Try in your test:
ITM_SendChar(0x41);
ITM_SendChar('\n');
2021-03-14 01:17 PM
Yes, the clock was indeed 48 MHz, and basically also sending strings without newline works. I think I found the reason.... if I read the schematics and board specs correctly, the PB3\SWO pin of the MCU is simply not connected to the ST-STLink... solder bridge SB8 (chapter 6.7) is open per default and thus PB3 is used as an alternate pin for timer 2 (TIM_CH2)
The same code to print some ITM debug messages worked perfectly on a NUCLEO-STM32F413 board and the STM32H735-Disco board.
References: