Skip to content

STM32F429 custom board: RTT console only works with J-Link script or under west debug #100095

@lizhaoming634

Description

@lizhaoming634

Describe the bug

On a custom STM32F429BI board (Armfly STM32-V6, F429BIT6) using SEGGER RTT as console/log backend, I only get RTT output when:

  • running under west debug (GDB + J-Link), or
  • using a small J-Link script that overrides the default reset/halt sequence.

If I just flash the image, reset the board and attach J-Link RTT Viewer, no RTT output appears.

On another STM32F411-based board, the same prj.conf and main.c work fine without any J-Link script, so this looks STM32F429-specific (or related to how Zephyr + J-Link handle reset/attach on this SoC).


Target platform

  • SoC: STM32F429BI
  • Board: custom board based on Armfly STM32-V6 (F429BIT6), DTS initially copied from stm32f429i_disc1
  • Zephyr: main branch (recent clone)
  • Probe: J-Link, SWD, 4 MHz
  • Host OS: Windows 10
  • J-Link RTT Viewer: V8.66

What I see

  • When I flash the image with west flash --runner jlink, press the hardware reset button and then connect RTT Viewer (Device = STM32F429BI, SWD, 4000 kHz), Terminal 0 shows no Hello RTT! output.

  • Inspecting the _SEGGER_RTT symbol address from the map file (around 0x200000C0) with J-Mem shows that the whole control block stays 0x00.

  • If I instead run west debug --runner jlink, let GDB do monitor reset halt, break main, continue, continue, then RTT Viewer immediately starts to show the Hello RTT! messages.

  • If I configure the following J-Link script in RTT Viewer:

    int InitTarget(void) {
      // Returning 1 means "I already initialized the target",
      // so J-Link does NOT perform its default reset+halt.
      return 1;
    }

and then:

press the hardware reset button on the board, and

connect RTT Viewer (with the script above),

RTT logging also works reliably in this case and _SEGGER_RTT is properly initialized.

Without the script (and without west debug), RTT never prints anything on this STM32F429 board.

Regression

  • This is a regression.

Steps to reproduce

No response

Relevant log output

Impact

Annoyance – Minor irritation; no significant impact on usability or functionality.

Environment

  • OS: Windows 10 64-bit
  • Toolchain: Zephyr SDK 0.17.4
  • Commit SHA or Version used: Zephyr v4.2

Additional Context

code
#include <zephyr/kernel.h>
#include <zephyr/sys/printk.h>

int main(void)
{
int cnt = 0;
while (1) {
printk("Hello RTT! Count = %d\n", cnt++);
k_msleep(1000);
}
}

prj.conf
CONFIG_GPIO=y
CONFIG_MAIN_STACK_SIZE=2048

CONFIG_USE_SEGGER_RTT=y

CONFIG_RTT_CONSOLE=y
CONFIG_UART_CONSOLE=n

CONFIG_LOG=y
CONFIG_LOG_DEFAULT_LEVEL=3
CONFIG_LOG_BACKEND_RTT=y
CONFIG_LOG_BACKEND_UART=n

CONFIG_SEGGER_RTT_SECTION_NONE=y

Metadata

Metadata

Assignees

Labels

area: Segger RTTSEGGER RTT (Real Time Transfer)bugThe issue is a bug, or the PR is fixing a bugplatform: STM32ST Micro STM32priority: lowLow impact/importance bug

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions