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.

  • I see. Then this should really work on the custom board as well. At least from an RTT perspective, as that does not depend on anything on the board (just the SoC itself and the debugger). Can you debug a bit further to verify that the application runs properly and that the code that should log to RTT runs successfully? Perhaps stepping down and verifying if things actually gets written to the RTT Buffer, or if not, why?

  • I have noticed that when i remove CONFIG_BOOTLOADER_MCUBOOT=y from the custom boards _ns_defconfig but enable it in prj.conf i get this output in the RTTViewer, when i add CONFIG_BOOTLOADER_MCUBOOT=y back to the _ns_defconfig i get no output.

    ******  BBoooottiinngg  nnRRFF  CCoonnnneecctt  SSDDKK  vv33..55..9999--nnccss11--11  ******
    
    II::  SSttaarrttiinngg  bboooottllooaaddeerr
    
    II::  PPrriimmaarryy  iimmaaggee::  mmaaggiicc==uunnsseett,,  sswwaapp__ttyyppee==00xx11,,  ccooppyy__ddoonnee==00xx33,,  iimmaaggee__ookk==00xx33
    
    II::  SSeeccoonnddaarryy  iimmaaggee::  mmaaggiicc==uunnsseett,,  sswwaapp__ttyyppee==00xx11,,  ccooppyy__ddoonnee==00xx33,,  iimmaaggee__ookk==00xx33
    
    II::  BBoooott  ssoouurrccee::  nnoonnee
    
    II::  IImmaaggee  iinnddeexx::  00,,  SSwwaapp  ttyyppee::  nnoonnee
    
    II::  BBoooottllooaaddeerr  cchhaaiinnllooaadd  aaddddrreessss  ooffffsseett::  00xx1100000000
    
    II::  JJuummppiinngg  ttoo  tthhee  ffiirrsstt  iimmaaggee  sslloott

  • When using a custom nrf9160 board is it better to use the partition_conf from thingy91 or the DK?

  • When i use the partition conf from thingy91 i get that weird output and when i use the one from the DK i get nothing

  • It seems like the application is never loaded after mcuboot. I sent you the board files in a private message. I have tried to change them to follow the thingy91 and also tried to make them more like nrf9160dk, but i cant get it to work.

Related