2017-02-20 07:53 PM
Hello everyone,
I am trying to redirect printf() to ITM using the tutorial in
https://www.youtube.com/watch?v=BwgPV3uKuzY
and view the output. I followed the steps as shown in that video but I was unable to see the output because I have a FREE version. I noticed that STM32 ST-LINK utility software also has SWV option. So I tried the following.1. ST-LINK firmware update (successful)
2. Target connect (successful)
3. Clicked SWV icon
4. Entered 216 MHz in System clock and stimulus port is set to 0
5. Clicked start
I can't see any output here.
My project cubeMX configuration is as follows:
SYS is configured as Trace Asynchronous SW. The rest of the pins are in default state. I am using printf() to print output.
I connected my board via ST-LINK USB port to my computer. How do I see the printf() output?
I also tried to define a _write function main.c and calling printf() as described in 10_Complementary debug tools - printf.pdf in STM material\USER_MATERIAL\Slides but that didn't help either. Any ideas on how to get this ITM work?
#printf #stm32f7 #gcc2017-02-21 07:24 AM
Hello
Dake.Dheeraj
,Maybe you shouldcheck yourconfiguration and assignment following your board schematic.
-
User manual Discovery kit with STM32F769NI MCU-
User manual ST-LINK/V2 in-circuit debugger/programmer for STM8 and STM32 (Table 4. JTAG/SWD cable connections )Imen
2017-02-21 08:18 AM
Check if there is any solder-bridge configuration on the board impacting the connectivity of PB3 (SWO) to the ST-LINK portion of the board.
Check that the core is actually running at 216 MHz.
On the F7 you may have to enable access to the ITM prior to using ITM_SendChar()
volatile uint32_t *ITM_LAR = (volatile uint32_t *)0xE0000FB0; // ITM->LAR
*ITM_LAR = 0xC5ACCE55; // Enable AccessYou could try using the USART/VCP method to output diagnostic information, that's how I'd confirm the internal configuration on the F7 NUCLEO boards.
2017-02-21 11:38 PM
Hello Clive,
Thanks for replying. I looked at the schematics and PB3 is connected to SB21. I believe that SB21 connection is already soldered isn't it?
I checked the clock configuration in cubeMX and it is as follows. I tried setting the System clock to 16 MHz and added these lines in __write() function.
volatile uint32_t *ITM_LAR = (volatile uint32_t *)0xE0000FB0; // ITM->LAR
*ITM_LAR = 0xC5ACCE55; // Enable Access
Still I didn't see cannot see any output. I am not sure how you got to these 2 lines above?
Regarding this ''
You could try using the USART/VCP method to output diagnostic information, that's how I'd confirm the internal configuration on the F7 NUCLEO boards.
''In the schematics, the VCP_RX and VCP_TX are connected to PA10 and PA9 respectively. So I configured PA9 and PA10 as USART1_TX and USART1_RX respectively. Then I configured USART1 and was able to print using HAL_UART_Transmit(). I was able to see the output via virtual COM port.
Now how to output the diagnostic information you asked?
2017-02-21 11:46 PM
Hello IMEN,
I checked these already. In UM2033, page 20, 6.15 it is said that 'The serial interface USART3 is directly available as a virtual COM port of the PC,'. But according to the schematics, the virtual COM port is connected to USART1(I verified it too).
Thanks
Dheeraj
2017-09-01 10:07 AM
You have to solder R92 (between the the SD card connector and the MCU)