RTT Viewer connecting to nrf5340 cpunet core will trigger a mass erase and afterwards one needs to recover the core

Hi all!

I need to see the printks and log messages from the b0n and cpunet app in RTT Viewer.

The problem is, whenever I connect with the SEGGER RTT Viewer to the netcore, I do get the following error message:

CTRL-AP indicates that the device is secured.
For debugger connection the device needs to be unsecured.
Note: Unsecuring will trigger a mass erase of the internal flash, SRAM and UICR of both the application and the network core.

In another ticket, Vidar answered me the following:

Hi Thilo,

It would better if you created a new ticket for this, but I will try to help here.
To troubleshoot this, please disable APPROTECT by using the nrfutil commands below (note: the order matters, netcore needs to be recovered first),
then try to connect the RTT viewer again to see if you get the same error (there will not be any logs).

nrfutil device recover --core network
nrfutil device recover --core application

Cheers

Vidar


Sadly that doesn't change anything. I execute the first command (recover netcore) and then connect via RTT Viewer and the same error message appears and the chip has no fw on it anymore.

Any other idea?

Cheers,
Thilo

Parents
  • Hi,

    Thanks for posting this in a separate thread. I realise now that the FW image loaded by the nrfutil device recover command does not seem to enable the network core, which would explain why AP remains enabled. Just to verify the setup, please try with the attached hex files which I have verified to work here.

    2046.merged.hex

    3187.merged_CPUNET.hex

    Best regards,

    Vidar

  • hi vidar

    what did you do?!

    00> *** Booting nRF Connect SDK v3.3.0-ba167d9f3db4 ***
    00> *** Using Zephyr OS v4.3.99-fd9204a02d52 ***
    00> Hello world from nrf5340dk/nrf5340/cpunet

    That worked for me and please tell me it's just a missing config or such thingSlight smile

    Thanks

    Cheers,
    Thilo

  • Hi Vidar

    Sorry for the delay. I had short priorities switch.

    I just tried it to add CONFIG_RESET_ON_FATAL_ERROR to both b0n and the netcore app, sadly it does not change anything.
    HW was our own board and a nrf5340dk.

    Cheers,
    Thilo

  • Hi Thilo,

    No problem. But would you be able to provide me a minimal version of your project that would allow me to reproduce this on my side? The only explanations I can think of now is that either you have some different APPROTECT settings (you can check the build/<netcore fw>/zephyr/.config to compare) that locks the debugger port, or that the app core is not powering on the network core for some reason.

    Cheers 

    Vidar


  • Hi Vidar

    I minized the source files to two main.c at left the prj.confs for mcuboot, appcore app, b0n and netcore app.
    It still occurs as before so it is most probably something with the configs.


    min-example.zip


    Here are the commands I use to compile it:

    # open a toolchain shell:
    <path_to_nrf_toolchain>/nrfutil/bin/nrfutil sdk-manager toolchain launch --shell --toolchain-path <path_to_nrf_toolchain>
    
    # inside the shell
    . <path_to_nrfsdk>/zephyr/zephyr-env.sh
    
    west build --board nrf5340dk/nrf5340/cpuapp --pristine --sysbuild
    
    west flash --no-rebuild --recover


    I hope you can tell me whats going on.

    Thank you!

    Cheers,
    Thilo

    [EDIT]I just searched the zip, I did upload. It was above the "Hi Vidar" which is not recognizable place. So I moved the link more visible in the midth of the message.[/EDIT]

  • Hi Thilo,

    Thanks for providing the sample. I was able to reproduce the same, and the reason for this was that the application core was not turning on the network core (not calling nrf53_cpunet_enable(true); or enabling CONFIG_SOC_NRF53_CPUNET_ENABLE). But I see now that a fault is triggered in the b0n image which requires further debugging. Will try to update tomorrow when I had a chance to investigate it.

    Cheers,

    Vidar

  • Hi Vidar

    Thank you for the help!

    I thought, that enabling the cpunet in the sysbuild would be sufficient ..... I was wrong. Disappointed

    [EDIT]I enabled the net core in the app core's prj.conf as you suggested and of course it works now. Thank you a lot![/EDIT]

    Cheers,
    Thilo

Reply Children
Related