Комментарии:
the write function is as mentioned below:
int _write(int file, char *ptr, int len)
{
/* Implement your write code here, this is used by puts and printf for example */
int i=0;
for(i=0 ; i<len ; i++)
ITM_SendChar((*ptr++));
return len;
}
It doesn't show anything for me either (stm32f429I-DISC1). I connected the PB3 pin of the microcontroller to the SWO pin of the debugger with a wire. It started displaying characters, but not the string "Hello world". I changed in Serial Wire Viewer, Core Clock (MHz) to 16.0, and it displayed the string "Hello world" 😃.
Ответитьi have done the same procedure but neither the itm data trace nor the time line graph showed any thing
Ответитьhow abou iar ?
ОтветитьI TRIED THE SAME WRITE FUNCTION, BUT IT'S SHOWING UNDEFINED REFERENCE TO ITM_SendChar,,,,,,how to solve that?
😞
Hello , Guys..
This person has shown a true configuration for using printf() function. If you facing issue in printing context using printf() , then please try to use "/n" after the writing the context in printf() function.
printf("hello world") -> Nothing will print on SWV ITM Data Console
printf("hello world/n") -> Proper Output on serial console...
I have been binge watching your STM32 videos. They are well thought through and thorough. Thank you, Arun.
ОтветитьHi. Is it possible to save the port values to a text file?
ОтветитьSWV is working with the frequency of 16 MHZ but it didnt work with 168 MH.. Why ? my board ( stm32f407g)
Ответитьwhy STM do not support printf() in STM32CubeIDE ?
Seems me, this function is very useful and commonly provided almost IDE's. Is there any reason avoiding implement ?
Nice video. Although it doesn't work for me. Nothing is printed. I use an ST board as a debuguer for another board.
ОтветитьThanks! Now, I'm trying to make scanf input, but no results..
Ответитьbased thanks
ОтветитьI am using STM32F407VG board, shows error while debugging i.e. " Error in final launch sequence:
Failed to execute MI command:
load "G:\\udemy\\embedded c\\my_workspace\\target\\001HelloWorld\\Debug\\001HelloWorld.elf"
Error message from debugger back end:
Error finishing flash operation "
Thanks!
Really helpful :)
In STM32 HAL and LL , which one is best for creating big and complex projects ??
ОтветитьHey! Thanks for your support! It help me a lot!
ОтветитьI am using STM32L475 ..will it work ?
I am using micro usb only.
can it work with stm32f303 ?
ОтветитьHello,
Thank you for this tutorial! Really usfull. Two questions
- The printf are working even when I do not activate any comparator. Is it normal?
- When activating the comparator 1 (with address 0x0), it display a "data" 0x0 in the SWV Data trace Timeline Graph. Is it still the comparator 1 that should activate printf?
Hello. What if ITM is not available? I am programming stm32wb55 Nucleo board and I am trying to setup printf for debugging. This method does not seem to work due to the microcontroller not supporting ITM
ОтветитьI'm using a STM32L151CB and a legit ST-Link/V2 Isol. (Own custom PCB)
Strangely, when i click "start trace", the square around the circle lights up, then, when i press resume, the circle is greyed and unselected.
No data shows up in either of the SWV tabs, but i have the live expressions working fine.
but when i use any Hal_delay function in my int main while loop along with printf it doesnt print ot any thing on the console
ОтветитьHi Controllers Tech, thanks for the clear explanation. I could made a debug session but only show debug data in step by step execution. Any idea? Thanks again.
ОтветитьI really big thank you to you
Ответитьthanks for the extremely good content quality !
What's your OS desktop environment ? it's smooth
Wtf... why does a printf command has to be so needlessly complicated? In arduino or mbed you just write printf(...) and done. With stupid CubeIDE Shit you need a doctors degree to get a simple output... just ridiculous. Who can use that or create anything more complicated than a blink sketch? Speaking of which: A fucking blink sketch generated in cubeF(uck)X for my discovery board gives me a 700!!!! lines main.c file. WTF?!? 700 lines to to toggle an LED on and off???
ОтветитьGreat video! What IDE theme are you using?
Ответитьit looks like you got a reset button for the debugger. if so, how do i get the button ?
ОтветитьThanku for this video may god bless you
ОтветитьHi, thank you for the video. Works great, however, only in .c files. Is there a way to work in cpp files?
ОтветитьThanks. For the STM32F429i-DISCO, you need to solder SB9 (to connect SWO-PB3 to the ST-LINK) to make it work.
ОтветитьI have try this but not give ouput in swt port.
ОтветитьHello, I tried to set up the printf debuging with the bluepill board and the st_link v2 chinese dongle but can't make it work. The variable "count" in the live expression and the led toggle work but I got nothing on the console editor...Any idea? Thanks
Ответитьworked more or less with stm32f3discovery. one small problem though, in live expression
"Target not available"
was displayed in place of value for count variable.
Thanks, very helpful!
Small addition: if you don't have a newline at the end of what you're printf-ing, nothing will show up until a very large buffer has been filled, then you get it all at once, on a single line. At least that's my experience.
Hello, it's a great series with many information. One question: does it work with tasks? Meaning some printf in tasks don't show at my board. Does anyone have a solution?
ОтветитьI've been helped. This is a great tutorial! Keep up the good work.
Ответитьhow can i change/modify variable's values while code runinng ?
ОтветитьNot working on Nucleo F303RE before setting Debug Mode to Trace Asynchronous Sw. After that it just works fine!
ОтветитьWorks like a charm! Thanks!
ОтветитьThanks so much 💞
ОтветитьITM debugging is only for Cortex-M3 / Cortex-M4 / Cortex-M7 chips. Make sure your stm32 has one of the aforementioned controller.
ОтветитьI think God punishes me because I made exactly the same thing as you and nothing happens. I use the original ST-Link V2 debugger and STM32F446RET MCU.
Edit: After 7 month of trying this again on my Nucleo, now it works!
STM32 F0 doesn't support the SWV (viewer) , too bad
ОтветитьThank you for this. What is the serial comm program are you using it looks like it is integrated with eclipse.
ОтветитьAlternatively, you could overwrite __io_putchar(). _write() calls __io_putchar.
ОтветитьIs it possible to have the swv console always active? I hate clicking the record button every time.
ОтветитьWhich debugger did you use ?
I'm using ST-Link V2 and STM32F407VE but it doesn't work.