No RTT output when enabling mcuboot

I am working on a custom board featuring a nrf9160, when i run the zephyr hello_world application with:

CONFIG_LOG=y
CONFIG_USE_SEGGER_RTT=y 
CONFIG_SEGGER_RTT_BUFFER_SIZE_UP=4096
CONFIG_LOG_MODE_IMMEDIATE=y

Everything works and i can see the output in JLinkRTTViewer. But when i enable:


CONFIG_BOOTLOADER_MCUBOOT=y
CONFIG_MCUBOOT_BOOTUTIL_LIB=y

i get no output at all. The application seems to be running since i can see the current consumption changing.


I found this: Cannot see both bootloader and application RTT output #53544 Closed which seems to be an issue with only being able to see either mcuboot logs or applications logs which is not really the case for me. I cant see anything.

But i tried to add the patches suggested by giansta but it still does not work. This is part of what i got from objdump on the .elf file:

objdump -t zephyr.elf | grep RTT
2000c568 l    d  _RTT_SECTION_NAME      00000000 _RTT_SECTION_NAME
00000000 l    df *ABS*  00000000 SEGGER_RTT.c
2000c578 l     O _RTT_SECTION_NAME      00001000 _acUpBuffer
2000c568 l     O _RTT_SECTION_NAME      00000010 _acDownBuffer
2000c568 l       _RTT_SECTION_NAME      00000000 $d
00000000 l    df *ABS*  00000000 SEGGER_RTT_zephyr.c
00000001 g     O *ABS*  00000000 CONFIG_SEGGER_RTT_SECTION_CUSTOM
0002843d g     F text   00000058 SEGGER_RTT_WriteNoLock
000284d9 g     F text   00000030 SEGGER_RTT_Init
00000000 g     O *ABS*  00000000 CONFIG_SEGGER_RTT_MODE
2000c568 g       _RTT_SECTION_NAME      00000000 __rtt_buff_data_start
00000001 g     O *ABS*  00000000 CONFIG_SEGGER_RTT_SECTION_CUSTOM_NAME
2000c580 g       _RTT_SECTION_NAME      00000000 _image_ram_start
2000d578 g     O _RTT_SECTION_NAME      000000a8 _SEGGER_RTT
2000d620 g       _RTT_SECTION_NAME      00000000 __rtt_buff_data_end


I have also tried to disable logs from mcuboot by adding a child_image/mcuboot.conf with:

CONFIG_USE_SEGGER_RTT=n
CONFIG_LOG_BACKEND_RTT=n
CONFIG_MCUBOOT_UTIL_LOG_LEVEL_OFF=y
CONFIG_LOG=n

but this also did not work.

I am on Ubuntu 22.04.5 LTS
using nrf connect sdk 2.6.1 and J Link V7.94i.

Parents
  • I tried to use your config but still got no output on my custom nrf9160 board. I got when i built and ran it for nrf9160 devkit like before. I also tried to run the build for the custom board on the devkit and then i got:

    [Sec Thread] Secure image initializing!
    TF-M isolation level is: 0x00000001
    Booting TF-M v2.0.0
    FATAL ERROR: SecureFault
    Here is some context for the exception:
        EXC_RETURN (LR): 0xFFFFFFBD
        Exception came from non-secure FW in thread mode.
        xPSR:    0x60000007
        MSP:     0x20000BF8
        PSP:     0x200018B8
        MSP_NS:  0x2000E770
        PSP_NS:  0x2000E590
        Exception frame at: 0x2000E590
            R0:   0x40000105
            R1:   0x020103F5
            R2:   0x2000E660
            R3:   0x2000E688
            R12:  0x00019850
            LR:   0x0001B78F
            PC:   0x00007C20
            xPSR: 0x61000000
        Callee saved register state:        R4:   0x00007C21
            R5:   0x40000105
            R6:   0x020103F5
            R7:   0x2000E660
            R8:   0x00000000
            R9:   0x00019850
            R10:  0x00019850
            R11:  0x00019850
        CFSR:  0x00000000
        BFSR:  0x00000000
        BFAR:  Not Valid
        MMFSR: 0x00000000
        MMFAR: Not Valid
        UFSR:  0x00000000
        HFSR:  0x00000000
        SFSR:  0x00000001
        SFAR: Not Valid

    addr2line -e zephyr.elf 0x0001B78F
    /home/ncs/v2.6.1/zephyr/modules/trusted-firmware-m/interface/interface.c:60

    shows that it is coming from

    tfm_ns_interface_dispatch()
    and the line:
    result = fn(arg0, arg1, arg2, arg3);


    here is the build folder:
    0361.build.tar.gz
  • I managed to fix the secure fault by adding some missing configurations in my boards defconfig files. But the main issue still remains, i cant see any logs on my custom board when mcuboot is enabled.

    this is my build folder now:
    2630.build.tar.gz

  • I see. There should not be a fundamental difference between a DK and a custom board when it comes to RTT, as it is just a RAM buffer that is accessed by the degbugger, so I suspect a configuration issue of some sort. Can you share your board files for your custom board?

  • The defconfigs are exactly the same as thingy 91 except that i have removed:

    CONFIG_CONSOLE=y
    CONFIG_UART_CONSOLE=y
    

    from both secure and non secure.

Reply Children
Related