nrf_modem_lib_init wont return / gets stuck on ncs 3.4.0 nrf9160

Hello,

when migrating to ncs 3.4.1 I discovered that calling nrf_modem_lib_init makes the firmware get stuck and never comes back from that call.

It is the same behaviour with ncs 3.4.0. When building and running it with ncs 2.8.0 the problem does not occur.

I am running it on an Actinius Icarus V2 with a nrf9160 chip on (build target: [email protected]/nrf9160/ns). I have read that some people have problems with connected reserved pins in their custom boards which causes similar issues, but with the Actinius boards we never had that problem. The behaviour is the same on multiple boards.

I took the hello world example added the following things:

sysbuild.conf:

SB_CONFIG_BOOTLOADER_MCUBOOT=y

proj.conf:

CONFIG_LOG=y
CONFIG_NRF_MODEM_LIB=y

CONFIG_NETWORKING=y
CONFIG_NET_SOCKETS=y
CONFIG_NET_SOCKETS_OFFLOAD=y
CONFIG_NET_NATIVE=n

CONFIG_HEAP_MEM_POOL_SIZE=4096
CONFIG_MAIN_STACK_SIZE=4096

main.c:

#include <stdio.h>
#include <zephyr/kernel.h>
#include <modem/nrf_modem_lib.h>

int main(void)
{
	printf("Hello World! %s\n", CONFIG_BOARD_TARGET);

	k_sleep(K_SECONDS(1));
	printf("Ready\n");

	nrf_modem_lib_init();

	printf("Finished\n");

	return 0;
}

I attached the project.

Thank you for your support!

Best regards

Moritz

hello_world_modem_init_fail.zip

Parents
  • Hi,

    Thanks for testing, and apologies you may please undo the partition include files from my previous reply. They caused the TF-M build errors you saw which means your board already has a valid partition layout.

    It looks like that the by default Actinius Icarus board gives the application the whole non-secure RAM region, including the modem's shared block (sram0_ns), which could result in application overwriting the modem part. Up to NCS 2.8 this did no harm, as the Partition Manager built the memory map itself and ignored what the board files said. In NCS 3.4 the Partition Manager is gone and the board files are used directly. So can you remove the includes I mentioned before and now create boards/actinius_icarus_nrf9160_ns.overlay in your application:

    / {
    	chosen {
    		zephyr,sram = &sram0_ns_app;
    	};
    };

    Then pristine build. I do not have the Actinius Icarus board with me to check so do let us know if it works or are you still getting the errors. Thanks

    Best Regard,
    Syed Maysum

Reply
  • Hi,

    Thanks for testing, and apologies you may please undo the partition include files from my previous reply. They caused the TF-M build errors you saw which means your board already has a valid partition layout.

    It looks like that the by default Actinius Icarus board gives the application the whole non-secure RAM region, including the modem's shared block (sram0_ns), which could result in application overwriting the modem part. Up to NCS 2.8 this did no harm, as the Partition Manager built the memory map itself and ignored what the board files said. In NCS 3.4 the Partition Manager is gone and the board files are used directly. So can you remove the includes I mentioned before and now create boards/actinius_icarus_nrf9160_ns.overlay in your application:

    / {
    	chosen {
    		zephyr,sram = &sram0_ns_app;
    	};
    };

    Then pristine build. I do not have the Actinius Icarus board with me to check so do let us know if it works or are you still getting the errors. Thanks

    Best Regard,
    Syed Maysum

Children
Related