Enable UART logs in nRF5340 B0N network core bootloader

Hello, we have a project with nRF5340 and SDK v2.6.0, and we can not obtain the logs from the network core b0n bootloader, but we do receive properly all the other logs. Our project is structured as follows:

  • only 1 project, with main application core firmware
    • logs printed OK through UART
  • network core firmware being built as a child image of the application core
    • logs printed OK through UART
  • mcuboot enabled in application core through prj.conf
    • logs printed OK through UART
  • mcuboot included in network core as described here
    • logs are not being printed at all

Mcuboot configuration is included in our main project (application core) as follows: project_folder/child_image/mcuboot.conf, and without any specification on the log method in such file, the application core shows mcuboot logs as expected :

But the network core does not show any log related to bootloader, but only the following:

Both prj.conf files (application core and network core) include the following lines for enabling UART logs, and they are both logging OK the printk() from their respective firmwares:

CONFIG_NRF53_SYNC_RTC=n
CONFIG_SERIAL=y
CONFIG_LOG=y
CONFIG_CONSOLE=y
CONFIG_UART_CONSOLE=y
CONFIG_LOG_MODE_MINIMAL=n
CONFIG_LOG_BACKEND_UART=y

Including the exact same configuration in mcuboot.conf, does not show any change in network core logging, and with or without such configuration, mcuboot logging in the application core are working OK.

When the project is built, we can see that b0n seems to build OK in the network core child image build folder:

As an interesting detail, during the build, after === child image mcuboot -  begin ===, we receive the following warning:

but despite that warning, we do see the mcuboot logs correctly in the appplication core.

We would like to know if there is anything we can do to configure b0n uart logging correctly, or at this point we may also need to ensure that b0n is effectively running in the network core, given we are trying to implement multi image firmware update and need to debug some current issues.

Thank you very much for your support.

Leopoldo

  • Just to add some info, in applicationCore/build/networkCore/zephyr/.config, b0n (b0 locally) seems to be corretly enabled:

    At the same time, we tried enabling RTT logging in network core instead of UART, and we see exactly the same loggins that we see in UART interface: firmware logs correctly but not bootloader - BTW, I read in other messages that this is the expected behaviour in RTT, so is just to add any extra info that can help to debug the issue more easily.

  • Hello,

    The minimal logger and console output over UART should be enabled by default in the Network core bootloader (B0n). However, it will only print the boot banner (i.e. "*** Booting nRF Connect SDK v... ***") unless a runtime error occurs during boot.

    You can add this log message shown below in the bootloader main.c to test the console output:

    Best regards,

    Vidar

  • Hello Vidar, I added many printk() in C:\ncs\v2.6.0\nrf\samples\nrf5340\netboot\src\main.c 

    then deleted the build configuration in my project and did a complete build, and looking at the corresponding libapp.a they were included in the build

    But even after a succesfull flashing 

    I can't see any difference in netCore logs

    Do you think it is possible that B0N is not currently running in the network core for some missing configuration in our main application core project? Or if that was the case, the current banner would be printed at all?

    Thanks

  • Hello,

    The boot banner should be printed twice from the netcore during bootup, first when the netcore bootloader starts, and then when the 'hci_ipc' app starts.

    Here I added a printk with "HCI IPC starting.." in the hci_ipc image to illustrate:

    Are you building for the DK or a custom board, and which board is the code running on?

    Do you think it is possible that B0N is not currently running in the network core for some missing configuration in our main application core project?

    No, because your build folder content shows that b0n is included in the build.

  • Hello, 

    Are you building for the DK or a custom board, and which board is the code running on?

    I am building for a custom board that has the nRF5340. I'm finally able to see the B0N exactly as you say, with the banner being printed twice, and the message in the middle

    For getting this, I had to add the following lines to C:\ncs\v2.6.0\nrf\samples\nrf5340\netboot\prj.conf 

    CONFIG_NRF53_SYNC_RTC=n
    CONFIG_SERIAL=y
    CONFIG_LOG=y
    CONFIG_CONSOLE=y
    CONFIG_UART_CONSOLE=y
    CONFIG_LOG_MODE_MINIMAL=n
    CONFIG_LOG_BACKEND_UART=y
    CONFIG_BOOT_BANNER=y

    This was probably needed because some of the required settings might have been disabled in our custom board definition. I think the issue is solved, but I have just 2 remaining questions that would be really helpful:

    1. How/where should I add an overlay or equivalent file in our project, to be able to add this configurations in B0N without modifying ncs folder at all? 

    Our project structure is basically as follows (described also in first message):

    with separate folders for boards files, and also a separate folder for networkCore source and configuration files.

    2. Is this Arrow up possible, or we need to create our own B0N project and add it separately as a child image? If this is the case, could you recommend some documentation or guideline to do it?

    Thanks

Related