Skip to main content
Explorer
December 18, 2024
Solved

Debugging using UART on STM32H753

  • December 18, 2024
  • 3 replies
  • 974 views

Hi,

Can we use any UART /USART port for debugging? or any dedicated port only i have to allocate for debugging purpose?

what are the main application where USART can be used and UART cannot be used?

    This topic has been closed for replies.
    Best answer by mƎALLEm

    Again not clear what do you need to do exactly?

    UART could not replace JTAG for debugging. Debugging means for example going step by step in the program showing in live variables, setting breakpoints etc .. UART/USART could not do that.

    So please describe what do you want to do exactly with UART/USART?

    PS: please accept as solution if your question has been answered in this thread.

    3 replies

    Technical Moderator
    December 18, 2024

    Hello @DJ_IND and welcome to the community,

    What do you mean by "use any UART /USART port for debugging?" to use "printf" to display some messages or what? please provide more details about your use case.

     

    DJ_INDAuthor
    Explorer
    December 18, 2024

    in case i want to avoid JTAG connector for debugging and want to use UART interface using USB to serial converter which which UART4/5/7 or USART1/2/3/6 is preferable?

    mƎALLEmAnswer
    Technical Moderator
    December 18, 2024

    Again not clear what do you need to do exactly?

    UART could not replace JTAG for debugging. Debugging means for example going step by step in the program showing in live variables, setting breakpoints etc .. UART/USART could not do that.

    So please describe what do you want to do exactly with UART/USART?

    PS: please accept as solution if your question has been answered in this thread.

    Technical Moderator
    December 18, 2024

    @DJ_IND ,

    You've accepted as solution my comment above, are you sure?

    When I said "PS: please accept as solution if your question has been answered in this thread." I'm talking about this thread: https://community.st.com/t5/stm32-mcus-products/stm32h753-boot-from-external-emmc-memory/td-p/754899

     

     

    Super User
    December 18, 2024

     


    @DJ_IND wrote:

    Can we use any UART /USART port for debugging? ?


    As @mƎALLEm suggested, that depends what you mean by, "debugging" ...

    You can certainly use a UART/USART - or any other interface you choose - to send diagnostic messages to a terminal or other "debug" application.

    You could add some sort of command-line interface, so that you could send commands/queries to your target, and receive its replies.

    You could even write an embedded debug monitor; eg,

    https://interrupt.memfault.com/blog/cortex-m-debug-monitor

    But all of that requires that you write & load code to execute on your target.

     


    @DJ_IND wrote:

    what are the main application where USART can be used and UART cannot be used?


    UART = Universal Asynchronous Receiver/Transmitter

    USART = Universal Synchronous/Asynchronous Receiver/Transmitter

    So the clue is in the name: USART includes support for Synchronous comms - UART doesn't.

    So you can't use a UART if you require Synchronous comms.