Skip to main content
Associate
May 22, 2024
Question

How to transmit a printf to RTT Viewer.

  • May 22, 2024
  • 4 replies
  • 6799 views

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

This topic has been closed for replies.

4 replies

Andrew Neil
Super User
May 22, 2024

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 ?

 

A complex system that works is invariably found to have evolved from a simple system that worked.A complex system designed from scratch never works and cannot be patched up to make it work.
Associate
May 22, 2024

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

Andrew Neil
Super User
May 22, 2024

@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 ?

A complex system that works is invariably found to have evolved from a simple system that worked.A complex system designed from scratch never works and cannot be patched up to make it work.
Tesla DeLorean
Guru
May 22, 2024

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 (See Profile) Up vote any posts that you find helpful, it shows what's working..
Pavel A.
May 24, 2024

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
Super User
May 24, 2024
A complex system that works is invariably found to have evolved from a simple system that worked.A complex system designed from scratch never works and cannot be patched up to make it work.
Associate
May 28, 2024

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

Andrew Neil
Super User
May 28, 2024

 


@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.

A complex system that works is invariably found to have evolved from a simple system that worked.A complex system designed from scratch never works and cannot be patched up to make it work.