Hi,
I'm having issues accessing multiple terminal in J-Link RTT Viewer v6.94b both in Linux and Windows.
My setup is:
Code is very basic:
Display All
Expected result:
Display All
Actual result
More information:
Question:
As a side note, I have a segfault when trying to display channel infos(F8). On Windows, it sometimes works, other times the application quits while kinda fast flashing the channel information window. Here are two partial crash from gdb:
Display All
I'm having issues accessing multiple terminal in J-Link RTT Viewer v6.94b both in Linux and Windows.
My setup is:
- STM32H753VI custom board
- J-Trace PRO and J-Link base
- SWD port is used
Code is very basic:
- From STM32CodeMX enable Trace Asynchronous SW from Debug
- Generate code
- Add SEGGER sources
- Add this to main
C Source Code
- char bufferUp[1024];
- char bufferDown[1024];
- SEGGER_RTT_ConfigUpBuffer(0, NULL, NULL, 0, SEGGER_RTT_MODE_BLOCK_IF_FIFO_FULL);
- SEGGER_RTT_ConfigUpBuffer(1, "Term1Up", bufferUp, 1024, SEGGER_RTT_MODE_BLOCK_IF_FIFO_FULL);
- SEGGER_RTT_ConfigDownBuffer(1, "Term1Down", bufferDown, 1024, SEGGER_RTT_MODE_BLOCK_IF_FIFO_FULL);
- SEGGER_RTT_WriteString(0, "SEGGER Real-Time-Terminal Sample\r\n\r\n");
- SEGGER_RTT_WriteString(0, "###### Testing terminals ######\r\n");
- /* USER CODE END 2 */
- /* Infinite loop */
- /* USER CODE BEGIN WHILE */
- while (1)
- {
- /* USER CODE END WHILE */
- /* USER CODE BEGIN 3 */
- SEGGER_RTT_WriteString(0, "Print terminal 0\r\n");
- HAL_Delay(1000);
- SEGGER_RTT_WriteString(1, "Print terminal 1\r\n");
- HAL_Delay(1000);
- }
Expected result:
- In Terminal 0
- In Terminal 1
- In All Terminals
Source Code
Actual result
- All Terminals: only have Terminal 0 output
- Terminal 0: has expected output
- Terminal 1: has nothing
More information:
- While debugging, it appears that both buffer as read by RTTViewer, _SEGGER_RTT.aUp[0].WrOff is equal to _SEGGER_RTT.aUp[0].RrOff as well as _SEGGER_RTT.aUp[1].WrOff is equal to _SEGGER_RTT.aUp[1].RrOff. My understanding is that both buffer are fully read by the J-Link/J-Trace.
- Using two terminal window, I'm able to log both terminal to file: this is my actual workaround, doesn't support colour though
- JLinkRTTLogger -Device stm32h753vi -Speed 4000khz -If swd -RTTAddress auto-detection -RTTChannel 1 channel1
- JLinkRTTLogger -Device stm32h753vi -Speed 4000khz -If swd -RTTAddress auto-detection -RTTChannel 0 channel0
- JLinkRTTLogger -Device stm32h753vi -Speed 4000khz -If swd -RTTAddress auto-detection -RTTChannel 1 channel1
Question:
- How do I get JLinkRTTViewer to display two or more terminal? Ideally on both Windows and Linux.
As a side note, I have a segfault when trying to display channel infos(F8). On Windows, it sometimes works, other times the application quits while kinda fast flashing the channel information window. Here are two partial crash from gdb:
Source Code
- QPixmap: It is not safe to use pixmaps outside the GUI thread
- QPixmap: It is not safe to use pixmaps outside the GUI thread
- QPixmap: It is not safe to use pixmaps outside the GUI thread
- QPixmap: It is not safe to use pixmaps outside the GUI thread
- QPixmap: It is not safe to use pixmaps outside the GUI thread
- QPixmap: It is not safe to use pixmaps outside the GUI thread
- QObject::startTimer: QTimer can only be used with threads started with QThread
- QObject::startTimer: QTimer can only be used with threads started with QThread
- Thread 2 "JLinkRTTViewerE" received signal SIGSEGV, Segmentation fault.
- [Switching to Thread 0x7ffff5bfd640 (LWP 55202)]
- 0x00007ffff76e1399 in ?? () from /opt/SEGGER/JLink/libQtGui.so.4
Source Code
- QObject::startTimer: QTimer can only be used with threads started with QThread
- QObject::startTimer: QTimer can only be used with threads started with QThread
- [xcb] Unknown sequence number while processing queue
- [xcb] Most likely this is a multi-threaded client and XInitThreads has not been called
- [xcb] Aborting, sorry about that.
- JLinkRTTViewerExe: xcb_io.c:269: poll_for_event: Assertion `!xcb_xlib_threads_sequence_lost' failed.
- Thread 1 "JLinkRTTViewerE" received signal SIGABRT, Aborted.
- 0x00007ffff6a65615 in raise () from /usr/lib/libc.so.6