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)
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);
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?
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!
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!
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!
2:52 you forgot to add it in the description
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
kiss you
love you
🫶 I like to be kissed
hardfault...
ty
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)
Did the same way but output is not came
In serial monitor no output
Hi!
I didnt get any output. Did exactly like showed. STM stucks in while(!(ITM_STIMULUS_PORT0 & 1));
Ideas?
Same Board, Nucleo F446RE
same. Have you found the answer?
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);
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?
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!
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!
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
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!
I found this very helpful, quickly got me using and understanding stm32 swv. Thank you very much.
Hi Oieieio, Glad it helped! thank you!
not working.
Hi Nitin, let us know more details on problem you're facing. More details you share better we can help. Best wishes!
The man za genius!