2018-03-05 06:46 AM
Hi
I am using Atollic studio and the STM32F769 Discovery board.
I removed resistor R93 and fitted a 0R link to R92 so that the SWO line is connected to the ST-Link on the discovery board.
I have followed this tutorial to enable SWV and make use of ITM_SendChar:
I have enabled SWV and set the core clock frequency: currently 200MHz. (I verified this by calling SystemCoreClockUpdate() and checking the value of SystemCoreClock 200000000)
I have set the SWO clock to 2000kHz.
Unfortunately i do no receive any characters in the SWV console window within Atollic.
If i breakpoint the ITM_SendChar function i can see that its getting to the line 'ITM->PORT[0U].u8 = (uint8_t)ch;' without issue.I also just tried the 'STM32 ST-Link Utility' with SWO viewer and can see a few characters when I press start but do not see a continuous stream of characters as i expect.
Anyone have a suggestion?
Thanls
Chris
Solved! Go to Solution.
2018-03-05 10:21 AM
Ok, so not exactly an oranges-to-oranges comparison, I did bring up one of the Nucleo-F767ZI boards where I output to the USART and SWV, no mag-ic incantations involved.
//****************************************************************************
// Hosting of stdio functionality through USART//****************************************************************************/* Implementation of putchar (also used by printf function to output data) */
int SendChar(int ch) /* Write character to Serial Port */{ ♯ if 0 ITM_SendChar(ch); // From core_cm4.c ♯ else OutChar((char)ch); ITM_SendChar(ch); // From core_cm4.c ♯ endifreturn(ch);
}volatile int32_t ITM_RxBuffer;
//****************************************************************************
void OutChar(char c) // USART_RS232 is USART3, PD8/PD9
{ while((USART_RS232->ISR & USART_ISR_TXE) == 0); // Wait for EmptyUSART_RS232->TDR = c; // Send Char
}//****************************************************************************
2018-03-05 10:31 AM
The firmware version I had on the ST-LInk was V2.J30.M19 but it seems to have issues with SWO.
I just reverted back to V2.J29.M18 and SWO is now working fine
Follow up:
In case anyone is interested I just updated the ST-Link firmware to the Segger J-Link firmware which allows me to use 'Live Expressions' within Atollic studio:
https://www.segger.com/products/debug-probes/j-link/models/other-j-links/st-link-on-board/
2018-03-05 11:31 AM
@Chris Lynch, do the characters you see resemble what you print?
-- pa
2018-03-06 01:31 AM
Pavel,
Thanks for asking.
Yes they did, but i only received about 4 characters when i should have received a character every 100ms.
See my answer above regarding the ST-Link firmware as the actual problem.
Chris