printf() on STM32 Nucleo board using Serial Trace (SWV)

Поділитися
Вставка
  • Опубліковано 16 вер 2024
  • Follow the steps in the video to enable using printf() statements while debugging on TrueSTUDIO.
    Github repo of the project used in the video: goo.gl/Tzr86y

КОМЕНТАРІ • 31

  • @iforce2d
    @iforce2d 4 роки тому +2

    Thanks very much !
    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.

    • @nfernandes9784
      @nfernandes9784 Рік тому

      An important detail that is easily missed. I was stuck at this for some time. Thanks a lot.

  • @salaryunis2254
    @salaryunis2254 4 роки тому +1

    very nice explanation, thank you Sir! you should keep making more videos...

  • @chrislamb4723
    @chrislamb4723 3 роки тому

    Very nice job - this video was a great help.... Thank you!

  • @bennguyen1313
    @bennguyen1313 4 роки тому

    I'm using a Nucleo-144, but in the Pinout&Configuration tab, under System Core / Sys, it doesn't show any Debug options, only Timebase Source. In the pinout view, I do see STLINK_TX/RX on PD9/PD8 (USART3). Any idea why there's no option to select Serial Wire vs Trace Async Sw? The ITM_SendChar for example, appears to go thru stlink/swd port, not USART3.

  • @Тех.Ворон
    @Тех.Ворон 5 років тому

    Спасибо. Для меня Ваш урок очень полезен

  • @pusatberk4193
    @pusatberk4193 5 років тому

    Please continue your tutors

  • @danhellgren5671
    @danhellgren5671 3 роки тому

    I have been using a UART for sending debug text. But that takes time. If I send e.g 10 characters with your solution, do you know how much time that takes?

  • @annelove2766
    @annelove2766 2 роки тому

    r can the nucleo-l432kc do the same thing? I mean print and plot the curve.

  • @arashhashemi7091
    @arashhashemi7091 4 роки тому

    Good job 👏

    • @atg1203
      @atg1203  4 роки тому

      Thank you! Cheers!

  • @_Junkers
    @_Junkers 5 років тому

    Is sys_clk in the clock configuration manager the same as core_clk?

    • @atg1203
      @atg1203  5 років тому

      Yes, that is correct.

  • @roflcopter645
    @roflcopter645 4 роки тому

    It's not working on my STM32F103C8Tx. Do you have to connect anything to the pin PB3?

    • @atg1203
      @atg1203  4 роки тому

      Not if you're using the Nucleo board.

    • @roflcopter645
      @roflcopter645 4 роки тому

      @@atg1203 ok, then it looks like SWV doesn't work on the 'bluepill' stm32f103

    • @gotofinancial
      @gotofinancial 3 роки тому

      @@roflcopter645 so what is the solution?

  • @salaryunis2254
    @salaryunis2254 4 роки тому

    I did all the steps but i'm getting rubbish characters in the SWV console, what could be the problem?

    • @atg1203
      @atg1203  4 роки тому +1

      Double check the clock settings.

    • @salaryunis2254
      @salaryunis2254 4 роки тому +1

      @@atg1203 yes right, it is the HCLK frequency, i changed it and it is fixed now. Thanks!

  • @think7677
    @think7677 3 роки тому

    I have try this but no get ouput on the port. I have use stm32cubeide software . Please solve the error.

    • @atg1203
      @atg1203  3 роки тому

      What is the error?

    • @think7677
      @think7677 3 роки тому

      @@atg1203
      I have use swv port not give output.

    • @vikaskumarsinha5777
      @vikaskumarsinha5777 9 місяців тому

      @@think7677, same here

  • @klaus9503
    @klaus9503 3 роки тому

    It just prints some strange question marks and sometimes other strange chars.

    • @atg1203
      @atg1203  3 роки тому +1

      Double check the baud rate.

    • @klaus9503
      @klaus9503 3 роки тому

      @@atg1203 The problem was with the "Core Clock" setting under SWV. I went under "Clock Configuration" and on the very right down corner there was a block with "To TRACE (MHz)". It shows 320 MHz. It was confusing because my microcontroller (H7) is actually running at 480 MHz.

    • @klaus9503
      @klaus9503 3 роки тому

      @@atg1203 Now when I change my main.c to main.cpp it does not show anything :(

    • @klaus9503
      @klaus9503 3 роки тому

      The problem was that _write() function was not called. Therefore I programmed my own print function with ITM_SendChar() and it worked.