cancel
Showing results for 
Search instead for 
Did you mean: 

How to transmit a printf to RTT Viewer.

drothammel
Associate II

Hi together,

i am searching for a equivalent of the J-Link RTT-Viewer, on which i can display something for demonstration purposes. It is to simply demonstrate that i connection can work just like a in-built Segger J-Link. 
FYI: I am using a NUCLEO-C031C6 without any external tools

Regards, 
David

9 REPLIES 9
Andrew Neil
Evangelist III

Not quite sure what you mean by this?

Are you using a J-Link, and looking to redirect printf output to the RTT ?

Or are you using something else, and looking for a substitute for RTT ?

 

Thank you for your message! Sorry for the confusion.

I am simply using the NUCLEO-C031C6 which does not offer any in-built Segger J-Link tool. I also do not have a external J-Link tool... 

My wish is to find the functionality of the Board which allows to communicate between board and laptop and display communication in a RTT-Viewer (as shown in picture attached). The purpose is to demonstrate.

Sincerely,
David


@drothammel wrote:

I am simply using the NUCLEO-C031C6 which does not offer any in-built Segger J-Link tool. I also do not have a external J-Link tool... id


Segger have a facility to convert an ST-Link into a J-Link:

https://www.segger.com/products/debug-probes/j-link/models/other-j-links/st-link-on-board/

although your Nucleo isn't on the list on that page - so check with Segger first if you want to try that.

 


@drothammel wrote:

My wish is to find the functionality of the Board which allows to communicate between board and laptop and display communication in a RTT-Viewer (as shown in picture attached). The purpose is to demonstrate.


RTT is proprietary to Segger - so you won't be able to do that without a J-Link of some sort.

 

Why not just use a UART and terminal ?

On Keil Cortex-M0(+) used a different method instead on SWV via SWO

 

https://developer.arm.com/documentation/kan321/latest/

https://www.keil.com/appnotes/files/apnt_321.pdf

ST has a free license for Keil on CM0(+) STM32 platforms

 

Also with the NUCLEO's you can typically push serial debug diagnostics and telemetry out the USART/VCP implementation.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Pavel A.
Evangelist III

On this Nucleo UART2 is connected to the VCP of the on-board ST-LINK. So you just transmit something to this UART, run some terminal program on the host (PC) and enjoy your demo. You can even redirect stdout and stdin to this UART (read FAQs and examples) , and use printf and so on.

 

 

Andrew Neil
Evangelist III

Knowledgebase article on redirecting printf to a UART:

https://community.st.com/t5/stm32-mcus/how-to-redirect-the-printf-function-to-a-uart-for-debug-messages/ta-p/49865

 

And a 3rd-party article on the same:

https://shawnhymel.com/1873/ 

Thank you for your help all!
I tried the first link of yours but however, when i tried to build the project i get following error:

project/Debug/../Drivers/BSP/STM32C0xx_Nucleo/stm32c0xx_nucleo.c:580: multiple definition of `__io_putchar'; ./Core/Src/main.o:project/Debug/../Core/Src/main.c:247: first defined here

collect2.exe: error: ld returned 1 exit status

make: *** [makefile:65: final.elf] Error 1

"make -j8 all" terminated with exit code 2. Build might be incomplete.


Any idea of how to fix it?

Thanks,
David

 


@drothammel wrote:

Any idea of how to fix it?


The error is that you have multiple definitions of __io_putchar

The fix is to remove one - leaving you with just one definition of __io_putchar

The message tells you where the definitions are:

  1. in project/Debug/../Drivers/BSP/STM32C0xx_Nucleo/stm32c0xx_nucleo.c:580
  2. in ./Core/Src/main.o:project/Debug/../Core/Src/main.c:247

So choose which one to keep, and which one to get rid of.

>>Any idea of how to fix it?

Remove one of them? Say by commenting out, or with #if / #endif

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..