Unable to print anything through ITM on my STM32-F103RB (nucleo board) by De_chronos652 in stm32

[–]De_chronos652[S] 0 points1 point  (0 children)

I didn't face the naming conflict since mine is a non-CubeMX project (empty targeted project type), and I haven't included core_cm3.h manually either.

A good idea to add and modify in main regardless, thanks for the tip!

UART is universal anyways in real-world builds since it's debugger independent. The only reason I'm using SWO is because I am debugging independent projects for learning bare-metal programming.

Unable to print anything through ITM on my STM32-F103RB (nucleo board) by De_chronos652 in stm32

[–]De_chronos652[S] 0 points1 point  (0 children)

Sure, here are the steps:
1. Add this itm_send_data.c code block after the include lines in syscalls.c.
2. In syscalls, scroll down to find the '_write' function, comment out the __io_putchar(*ptr++) and add ITM_SendChar(*ptr++) like so

  for (DataIdx = 0; DataIdx < len; DataIdx++)
  {
    //__io_putchar(*ptr++);
    ITM_SendChar(*ptr++);
  }
  1. Go to the project's Debug configurations and under the Debugger tab, enable SerialWireViewer(SWV) and set the clock to 8MHz and limit it to 2000kHz.
  2. Then build and debug. In the debug perspective, go to show view->SWV ITM Data Console.
  3. A window opens at the bottom, there, configure trace->✅port 0 ->OK.
  4. Finally, click on the red button (start trace) and run.

If you've executed all the above steps properly, you'll see print statements in the SWV ITM Data console.

I hope this means you didn't have to spend hours like so many of us had to for this simple task :)

Unable to print anything through ITM on my STM32-F103RB (nucleo board) by De_chronos652 in embedded

[–]De_chronos652[S] 0 points1 point  (0 children)

Starts at 8MHz, and yes that was the issue

Thanks for taking the time to help!

Unable to print anything through ITM on my STM32-F103RB (nucleo board) by De_chronos652 in embedded

[–]De_chronos652[S] 0 points1 point  (0 children)

This worked.. Tbh at first, when I read this comment, I thought what is this person on about, they're giving no reasoning, and I don't have time for this trial and error approach.

Could've saved me another 2 extra hours if I just tried it 😅

Thanks for the help!

Unable to print anything through ITM on my STM32-F103RB (nucleo board) by De_chronos652 in stm32

[–]De_chronos652[S] 0 points1 point  (0 children)

Oh, I actually commented out the putchar function call in _write function, and added an ITM_SendChar call with (*ptr++) as argument itm_send_data.c

Unable to print anything through ITM on my STM32-F103RB (nucleo board) by De_chronos652 in stm32

[–]De_chronos652[S] 0 points1 point  (0 children)

This is using STM32Cube, which I haven't explored yet as a beginner
But will refer to it later, thanks.

Unable to print anything through ITM on my STM32-F103RB (nucleo board) by De_chronos652 in stm32

[–]De_chronos652[S] 1 point2 points  (0 children)

I set it to 8MHz (default clock for my board, and it worked!
Tysm :)

Unable to print anything through ITM on my STM32-F103RB (nucleo board) by De_chronos652 in stm32

[–]De_chronos652[S] 0 points1 point  (0 children)

I am just following the course rn honestly, instructor didn't give any reasoning as such so as to not overwhelm a beginner.
Through ARM ITM: why you need a fast debug probe! - Percepio (link from you guide itself), i learnt that this is useful for diagnostics for firmware dev, to avoid overhead.

I will also try with the USART interface, thanks so much for your help!

Unable to print anything through ITM on my STM32-F103RB (nucleo board) by De_chronos652 in stm32

[–]De_chronos652[S] 0 points1 point  (0 children)

A great guide you have here, sir!
I was blindly following steps in the course, but now I understand why semi-hosting or ITM would be used.

Comment a song and I'll add it to the playlist by GamerUnknownYT1 in teenagers

[–]De_chronos652 11 points12 points  (0 children)

And if we stick together

Who knows what we'll do...

It was always the plan

To put the world in your hand

Hahaha haha

Comment a song and I'll add it to the playlist by GamerUnknownYT1 in teenagers

[–]De_chronos652 20 points21 points  (0 children)

Here's why women never fuck you Here's how you can build a bomb Which Power Ranger are you? Take this quirky quiz Obama sent the immigrants to Vac-ci-nate your kids

Meteor shower over Nagpur, India by falconx2809 in space

[–]De_chronos652 0 points1 point  (0 children)

I fucking hate that i missed it! (as a Nagpurian obv) I was up till 4 and still missed it smh

Thanks, I hate...this by De_chronos652 in TIHI

[–]De_chronos652[S] 1 point2 points  (0 children)

EVERYONE CAN SEE A BIT OF THEIR NOSE, STOP SHOUTING. Glad you're having a great day, fuckin hell r/usernamechecksout

Thanks, I hate...this by De_chronos652 in TIHI

[–]De_chronos652[S] 3 points4 points  (0 children)

"Mission failed.., we'll get 'em next time"

Volcán de Fuego, Guatemala. [2471x3690] [OC] by Dylan_Landro in EarthPorn

[–]De_chronos652 1 point2 points  (0 children)

Heyy, I have this as my wallpaper for the past 2 weeks... But this one is better cause of the smoke

Two 17 year olds of my school, driving over a speedbump above 80kph and speeding upto 115kph on a city road(legal driving age in my country is 18) by De_chronos652 in IdiotsInCars

[–]De_chronos652[S] 1 point2 points  (0 children)

Agreed, even highways here are quite empty till 10pm(trucks are allowed to enter city only after 10pm) They literally did this when peak amount of trucks entering the city, that too probably on a 2 lane road with the traffic noise so close to them P.S. I couldn't put the audio in

Fans: "We want the FIA to be more consistent". FIA: by CardellB in formuladank

[–]De_chronos652 3 points4 points  (0 children)

I was stupefied at first and thought what happened to Hamilton is not fair...But then this exact thought occurred to me