How to use Printf with STM32 Microcontroller- Serial Wire Viewer (SWV)

  Рет қаралды 19,277

BINARYUPDATES

BINARYUPDATES

Күн бұрын

Пікірлер: 33
@giupeppe6380
@giupeppe6380 Жыл бұрын
2:52 you forgot to add it in the description
@oieieio741
@oieieio741 Жыл бұрын
I found this very helpful, quickly got me using and understanding stm32 swv. Thank you very much.
@BINARYUPDATES
@BINARYUPDATES Жыл бұрын
Hi Oieieio, Glad it helped! thank you!
@khuenguyencreator
@khuenguyencreator Ай бұрын
thank bro. Very useful
@hligfl
@hligfl Жыл бұрын
yw #define ITM_TRACE_EN *((volatile uint32_t*) 0xE00000E00) #define DEMCR *((volatile uint32_t*) 0xE000EDFCU) #define ITM_STIMULUS_PORT0 *((volatile uint32_t*) 0xE00000000) /* Debug function for printf used in __write() */ void ITM_SendChar(uint8_t ch) { // Enable TRCENA DEMCR |= (1
@andreineagu1878
@andreineagu1878 11 ай бұрын
kiss you
@nothingandmorenothing2736
@nothingandmorenothing2736 6 ай бұрын
love you
@hligfl
@hligfl 6 ай бұрын
🫶 I like to be kissed
@carlesls
@carlesls 5 ай бұрын
hardfault...
@Zorokolo
@Zorokolo 4 ай бұрын
ty
@industrialautomation1992
@industrialautomation1992 10 ай бұрын
Did the same way but output is not came In serial monitor no output
@micha68v
@micha68v 11 ай бұрын
Hi! I didnt get any output. Did exactly like showed. STM stucks in while(!(ITM_STIMULUS_PORT0 & 1)); Ideas?
@micha68v
@micha68v 11 ай бұрын
Same Board, Nucleo F446RE
@lunchbreak1040
@lunchbreak1040 6 ай бұрын
same. Have you found the answer?
@gcom2286
@gcom2286 5 ай бұрын
above printf try to define count as it is not defined here int count=0; printf("the counter value:%d ",count); count++; fflush(stdout); HAL_Delay(1000);
@adilmubashirchaudhry4115
@adilmubashirchaudhry4115 Жыл бұрын
Hi! Great tutorial and it does work on the STM32 Nucleo board however I have the STM32f411 Blackpill board which needs to be connected to an external ST-Link v2 debugger. This doesnt print on that. From what I looked into the datasheets the memory addresses for the registers used in code that we added in the syscall is the same. Any suggestions on what to do?
@BINARYUPDATES
@BINARYUPDATES Жыл бұрын
Hi Adil, thank you. You're right in case of STM32 Blackpill board we don't have built-in STLink programmer and debugger support. So need you need external STM32 programmer and debugger. I want you to check for SWO Pin where it is connected in case of blackpill between STLinkV2. Because the SWV data transmission uses SWO pin for sending debug messages. And if its not soldered then it may not work. I'm not sure as I still have to work on blackpill I've ordered some in future I'll make videos on this topics. Good luck and best wishes!
@incxxxx
@incxxxx 8 күн бұрын
It is simple solution. Use FTDI, connect to A9, A10 pins. And you have it, printf works on putty, TeraTerm, Hercules or other.
@ioan1183
@ioan1183 29 күн бұрын
TRACE button is greyed out. What to do?
@PerOveHusy
@PerOveHusy 5 ай бұрын
The constants used both in the video and in the comments below are erroneous. Gave no output. I removed the extra U (??) and made all 4 bytes long (not 4.5) #define ITM_TRACE_EN *((volatile uint32_t*) 0xE00000E00) #define DEMCR *((volatile uint32_t*) 0xE000EDFCU) #define ITM_STIMULUS_PORT0 *((volatile uint32_t*) 0xE00000000)
@SurvivalSquirrel
@SurvivalSquirrel Ай бұрын
_write is never called. And i cant figure out, where _write would be called from.
@Llammars
@Llammars 10 ай бұрын
Thanks for the guide! I've been having trouble getting this to work though. I'm hoping you might be able to help. I've been trying to get this setup on the b-g431-b-esc1 discovery board, which uses STM32G431CB. At this moment nothing is printing, but I have noticed while debugging that I get stuck in the ITM_SendChar() function - specifically in the while loop - while(!ITM_STIMULUS_PORT0 & 1). I'm too new to C to make sense of what's happening. Any ideas? Thanks!
@VietDuc7
@VietDuc7 9 ай бұрын
You may have a mistake somewhere. Please copy exactly this code: //Debug Exception and Monitor Control Register base address #define DEMCR *((volatile uint32_t*) 0xE000EDFCU ) /* ITM register addresses */ #define ITM_STIMULUS_PORT0 *((volatile uint32_t*) 0xE0000000 ) #define ITM_TRACE_EN *((volatile uint32_t*) 0xE0000E00 ) void ITM_SendChar(uint8_t ch) { //Enable TRCENA DEMCR |= ( 1
@BINARYUPDATES
@BINARYUPDATES 9 ай бұрын
Please confirm if you have properly added the piece of code in syscall.c file. Also, make sure in debugger setting under Serial Wire Viewer section turn on Enable check box. Once you have done this then configure SVW console settings. I hope this may help. Best wishes!
@hligfl
@hligfl Жыл бұрын
The man za genius!
@nitingaikwad5963
@nitingaikwad5963 Жыл бұрын
not working.
@BINARYUPDATES
@BINARYUPDATES Жыл бұрын
Hi Nitin, let us know more details on problem you're facing. More details you share better we can help. Best wishes!
Arduino TINKERCAD Simulation Tutorial- Complete Guide
21:49
BINARYUPDATES
Рет қаралды 5 М.
Ice Cream or Surprise Trip Around the World?
00:31
Hungry FAM
Рет қаралды 22 МЛН
Why no RONALDO?! 🤔⚽️
00:28
Celine Dept
Рет қаралды 89 МЛН
Serial UART with STM32 Microcontroller-Transmit and Receive Data
18:44
This makes your life so easy: printf using SWV STM32CubeIde
5:13
Steppe School
Рет қаралды 18 М.
GSM : Part 1(Setup)
9:03
Electronics Eternity
Рет қаралды 46 М.
STM32 Guide #2: Registers + HAL (Blink example)
30:02
Mitch Davis
Рет қаралды 210 М.
STM32. Контроллер прерываний
22:01
ФРТК МФТИ
Рет қаралды 9 М.
STM32 Guide #1: Your first STM32 dev board
12:12
Mitch Davis
Рет қаралды 225 М.
Ice Cream or Surprise Trip Around the World?
00:31
Hungry FAM
Рет қаралды 22 МЛН