Onomondo static profile with nrf9161 custom board not working

Hi,

I'm working with a custom board build with an nrf9161, I've created my board from nrf9161dk board (change some pin and defintion), I'm able to flash and build? I can use my custom led, my i2c bus, so I thought my custom board is well defined.

Right now I'm trying to use onomondo softsim profile, but ùy softsim never connect. To debug I've tried to do this here but same result not working. Just to know I have tried my source code with nordic nrf9160dk and it's working I'm able to have lte event and I can see my sim connected on onomondo, so the bug is not on my code...

Here is AT command I have tried :

[00:00*** Booting nRF Connect SDK v3.5.99-ncs1-1 ***
[00:00:00.326,324] <inf> nrf_modem: Initializing libmodem 2.6.1-lte-11b6ed4846a8
[00:00:00.570,983] <inf> nrf_modem: RPC ready
[00:00:00.619,964] <inf> gcg: Waiting for LTE connect event.

> AT
OK
> AT+CEREG?
+CEREG: 5,4
OK
+CEREG: 2,"E29D","09891B07",7
[00:03:30.427,307] <inf> gcg: LTE cell changed: Cell ID: 159980295, Tracking area: 58013 //always got only this event only, and look strange this event take always some time to come..

> AT+CEREG?
+CEREG: 5,2,"E29D","09891B07",7  // should have +CEREG: 1,5 from onomondo tutorial
OK

> AT+CESQ
+CESQ: 99,99,255,255,16,58
OK

> AT+CEREG=1
OK
> AT+COPS?
+COPS: 0
OK
> AT+CGDCONT=1,"IP","onomondo"
OK
> AT+CGACT=1,1
ERROR

> AT+CGMR
mfw_nrf91x1_2.0.1
OK

I can upload my board definition, tell me. Don't understand why it's working on 9160dk and not on my board, maybe bad board definition, I hope it's not an hardware issue with my custom board

Thanks for help

  • So you have one nRF9160 DK and one nRF9161 SiP on your custom board with different mfw versions

    Yes one nrf9160 DK board and one custom board with nrf9161 sip (inspired by circuit dojo feather nrf9160 design)

    service, but how did you connect the trace output pins to the terminal? You can send AT commands directly to the modem FW, but the trace traffic raises an error?

    I don’t know if I’m right but to activate the traces I only have to add the CONFIG_NRF_MODEM_LIB_TRACE, And output will come on uart? Should I do something else ? I’m using vscode and nrf plugin. My custom board look like very similar to circuit dojo feather nrf9160 (same uart pin, I2c,…) So for my uart I have the same wiring, using cp21 and USB port with pin P0.05/06 for UART on SIP.

    Yes I can send AT commands to my custom board over serial monitor. So if I sent AT via UART my board return OK.

    Are you building the onomondo application for the right device?

    yes I’m building for my custom board ans another build for DK board. All build are made on ns board version. 

    The Onomondo softsim_static_profil works with the nRFG9160DK, it is the same application you are trying to run?

    Yes exactly

  • Are you enabling the trace in the build configuration in NCS? See the "Snippets" section of the screen shot.

    With this and the UART connected to a terminal, you don't see any output on a serial terminal on either the DK nor your custom boards?

    Best regards

    Asbjørn

  • Thanks  

    Are you enabling the trace in the build configuration in NCS?

    I haven't add the snippet sorry. But now I got an error when I'm trying to compile for my custom board :

    devicetree error: 'pinctrl-0' is marked as required in 'properties:' in /opt/nordic/ncs/v2.5.0/zephyr/dts/bindings/serial/nordic,nrf-uarte.yaml, but does not appear in <Node /soc/peripheral@40000000/uart@9000 in '/opt/nordic/ncs/v2.5.0/zephyr/misc/empty_file.c'>

    However I've defined pinctrl-0 in my common dtsi file and declared uart0 in pinctrl file

    &pinctrl {
    	uart0_default: uart0_default {
    		group1 {
    			psels = <NRF_PSEL(UART_TX, 0, 6)>,
    				<NRF_PSEL(UART_RX, 0, 5)>;
    		};
    	};
    
    	uart0_sleep: uart0_sleep {
    		group1 {
    			psels = <NRF_PSEL(UART_TX, 0, 6)>,
    				<NRF_PSEL(UART_RX, 0, 5)>;
    			low-power-enable;
    		};
    	};
    
    	i2c1_default: i2c1_default {
    		group1 {
    			psels = <NRF_PSEL(TWIM_SDA, 0, 26)>,
    				<NRF_PSEL(TWIM_SCL, 0, 27)>;
    		};
    	};
    
    	i2c1_sleep: i2c1_sleep {
    		group1 {
    			psels = <NRF_PSEL(TWIM_SDA, 0, 26)>,
    				<NRF_PSEL(TWIM_SCL, 0, 27)>;
    			low-power-enable;
    		};
    	};
    
    	spi3_default: spi3_default {
    		group1 {
    			psels = <NRF_PSEL(SPIM_SCK, 0, 11)>,
    				<NRF_PSEL(SPIM_MOSI, 0, 9)>,
    				<NRF_PSEL(SPIM_MISO, 0, 28)>;
    		};
    	};
    
    	spi3_sleep: spi3_sleep {
    		group1 {
    			psels = <NRF_PSEL(SPIM_SCK, 0, 11)>,
    				<NRF_PSEL(SPIM_MOSI, 0, 9)>,
    				<NRF_PSEL(SPIM_MISO, 0, 28)>;
    			low-power-enable;
    		};
    	};
    }

    &uart0 {
    	status = "okay";
    	current-speed = <115200>;
    	pinctrl-0 = <&uart0_default>;
    	pinctrl-1 = <&uart0_sleep>;
    	pinctrl-names = "default", "sleep";
    };

    I'm not an expert with devicetree and zephyr custom board zephyr, should I've missed a configuration somewhere ? Can I use uart0 for trace because if I look in nrf91-modem-trace-uart/modem-trace-uart.overlay I see

    /* Enable uart1 for tracing. */
    &uart1 {
    	status = "okay";
    	current-speed = < 1000000 >;
    };
    
    / {
    	chosen {
    		nordic,modem-trace-uart = &uart1;
    	};
    };
    

    EDIT ; ok I've added an overlay to use uart0 and the snippet for trace modem. Now I got this error

    [00:00:01.209,625] <inf> nrf_modem: Initializing libmodem 2.6.1-lte-11b6ed4846a8
    [00:00:01.468,566] <inf> nrf_modem: RPC ready
    [00:00:01.468,933] <err> modem_trace_backend: Cannot set callback: -88
    [00:00:01.468,933] <err> nrf_modem_lib_trace: trace_backend: init failed with err: -14
    [00:00:01.468,963] <err> nrf_modem_lib_trace: Failed to initialize trace backend, err: -14
    [00:00:01.582,458] <inf> GCG_DNV: Waiting for LTE connect event.

  • Hi Simon,
    there seems to be something not initialized correctly with the trace. The screen shots you have attached seems to indicate you configure the pins for uart0, i2c and spi3. Hower you use uart1 for the trace, would you be able to add the config for uart1 as well before you enable the trace. There's a difference between app trace and modem trace in the output.
    In the same go, would you be able to share a file containing the print from project configurationm build log and build log from VS code?
    Are you able to get some other project working on the both kit and custom board? Like for example the asset tracking example? You would have to build to versions of it. One for the 9160 and one for the 9161. Just to try a different FW and see if it starts up on both?
    Best regards
    Asbjørn
  • Hi  

    The screen shots you have attached seems to indicate you configure the pins for uart0, i2c and spi3.

    Yes that's right. But I've change the modem-trace-uart.overlay file to change uart1 to uart0, I have to use uart0 I don't have uart1 on my custom board.

    Print log of building for my custom board

    Building hello_world
    west build --build-dir /Users/Sim/hello_world/build_1 /Users/Sim/hello_world --pristine --board geo_Sim_nrf9161_ns -- -DNCS_TOOLCHAIN_VERSION=NONE -DSNIPPET=nrf91-modem-trace-uart -DBOARD_ROOT=/Users/Sim/Documents/workspace_dev/GCG_DNV/my_board_nrf
    
    -- west build: generating a build system
    Loading Zephyr default modules (Zephyr base).
    -- Application: /Users/Sim/hello_world
    -- CMake version: 3.20.5
    -- Found Python3: /opt/nordic/ncs/toolchains/20d68df7e5/opt/[email protected]/bin/python3.9 (found suitable version "3.9.6", minimum required is "3.8") found components: Interpreter 
    -- Cache files will be written to: /Users/Sim/Library/Caches/zephyr
    -- Zephyr version: 3.5.99 (/opt/nordic/ncs/v2.5.0/zephyr)
    -- Found west (found suitable version "1.1.0", minimum required is "0.14.0")
    -- Board: geo_Sim_nrf9161_ns, Revision: 0.9.0
    -- Snippet(s): nrf91-modem-trace-uart
    -- Found host-tools: zephyr 0.16.1 (/opt/nordic/ncs/toolchains/20d68df7e5/opt/zephyr-sdk)
    -- Found toolchain: zephyr 0.16.1 (/opt/nordic/ncs/toolchains/20d68df7e5/opt/zephyr-sdk)
    -- Found Dtc: /opt/nordic/ncs/toolchains/20d68df7e5/bin/dtc (found suitable version "1.6.1", minimum required is "1.4.6") 
    -- Found BOARD.dts: /Users/Sim/Documents/workspace_dev/GCG_DNV/my_board_nrf/boards/arm/geo_Sim_nrf9161/geo_Sim_nrf9161_ns.dts
    -- Found devicetree overlay: /Users/Sim/hello_world/geo_Sim_nrf9161_ns.overlay
    -- Found devicetree overlay: /opt/nordic/ncs/v2.5.0/nrf/snippets/nrf91-modem-trace-uart/modem-trace-uart.overlay
    -- Generated zephyr.dts: /Users/Sim/hello_world/build_1/zephyr/zephyr.dts
    -- Generated devicetree_generated.h: /Users/Sim/hello_world/build_1/zephyr/include/generated/devicetree_generated.h
    -- Including generated dts.cmake file: /Users/Sim/hello_world/build_1/zephyr/dts.cmake
    
    warning: UART_1_ASYNC (defined at drivers/serial/Kconfig.nrfx_uart_instance:14) was assigned the
    value 'y' but got the value 'n'. Check these unsatisfied dependencies: HAS_HW_NRF_UARTE1 (=n). See
    http://docs.zephyrproject.org/latest/kconfig.html#CONFIG_UART_1_ASYNC and/or look up UART_1_ASYNC in
    the menuconfig/guiconfig interface. The Application Development Primer, Setting Configuration
    Values, and Kconfig - Tips and Best Practices sections of the manual might be helpful too.
    
    
    warning: Experimental symbol TFM_EXPERIMENTAL is enabled.
    
    Parsing /opt/nordic/ncs/v2.5.0/zephyr/Kconfig
    Loaded configuration '/Users/Sim/Documents/workspace_dev/GCG_DNV/my_board_nrf/boards/arm/geo_Sim_nrf9161/geo_Sim_nrf9161_ns_defconfig'
    Merged configuration '/Users/Sim/hello_world/prj.conf'
    Merged configuration '/Users/Sim/hello_world/softsim_overlay.conf'
    Merged configuration '/Users/Sim/hello_world/w25q01_overlay.conf'
    Merged configuration '/opt/nordic/ncs/v2.5.0/nrf/snippets/nrf91-modem-trace-uart/overlay-modem-trace-uart.conf'
    Configuration saved to '/Users/Sim/hello_world/build_1/zephyr/.config'
    Kconfig header saved to '/Users/Sim/hello_world/build_1/zephyr/include/generated/autoconf.h'
    -- Found GnuLd: /opt/nordic/ncs/toolchains/20d68df7e5/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd (found version "2.38") 
    -- The C compiler identification is GNU 12.2.0
    -- The CXX compiler identification is GNU 12.2.0
    -- The ASM compiler identification is GNU
    -- Found assembler: /opt/nordic/ncs/toolchains/20d68df7e5/opt/zephyr-sdk/arm-zephyr-eabi/bin/arm-zephyr-eabi-gcc
    -- Using ccache: /opt/nordic/ncs/toolchains/20d68df7e5/bin/ccache
    CMake Warning at /opt/nordic/ncs/v2.5.0/zephyr/CMakeLists.txt:1957 (message):
      __ASSERT() statements are globally ENABLED
    
    
    Dropping partition 'tfm_ps' since its size is 0.
    -- Configuring done
    -- Generating done
    -- Build files have been written to: /Users/Sim/hello_world/build_1
    -- west build: building application
    [1/331] Preparing syscall dependency handling
    
    [6/331] Generating include/generated/version.h
    -- Zephyr version: 3.5.99 (/opt/nordic/ncs/v2.5.0/zephyr), build: v3.5.99-ncs1-1
    [11/331] Generating ../../tfm/CMakeCache.txt
    CMake Warning at cmake/version.cmake:22 (message):
      Actual TF-M version is not available from Git repository.  Settled to
      v2.0.0
    Call Stack (most recent call first):
      CMakeLists.txt:22 (include)
    
    
    -- Found Git: /opt/nordic/ncs/toolchains/20d68df7e5/bin/git (found version "2.37.3") 
    -- The C compiler identification is GNU 12.2.0
    -- The CXX compiler identification is GNU 12.2.0
    -- The ASM compiler identification is GNU
    -- Found assembler: /opt/nordic/ncs/toolchains/20d68df7e5/opt/zephyr-sdk/arm-zephyr-eabi/bin/arm-zephyr-eabi-gcc
    -- Found Python3: /opt/nordic/ncs/toolchains/20d68df7e5/opt/[email protected]/bin/python3.9 (found version "3.9.6") found components: Interpreter 
    CMake Deprecation Warning at /opt/nordic/ncs/v2.5.0/zephyr/cmake/modules/FindDeprecated.cmake:121 (message):
      'PYTHON_PREFER' variable is deprecated.  Please use Python3_EXECUTABLE
      instead.
    Call Stack (most recent call first):
      /opt/nordic/ncs/v2.5.0/zephyr/cmake/modules/python.cmake:16 (find_package)
      /opt/nordic/ncs/v2.5.0/zephyr/cmake/modules/user_cache.cmake:30 (include)
      /opt/nordic/ncs/v2.5.0/zephyr/cmake/modules/extensions.cmake:5 (include)
      /opt/nordic/ncs/v2.5.0/nrf/subsys/nrf_security/tfm/CMakeLists.txt:38 (include)
    
    
    -- Found Python3: /opt/nordic/ncs/toolchains/20d68df7e5/opt/[email protected]/bin/python3.9 (found suitable version "3.9.6", minimum required is "3.8") found components: Interpreter 
    -- Cache files will be written to: /Users/Sim/Library/Caches/zephyr
    -- Configuring done
    -- Generating done
    CMake Warning:
      Manually-specified variables were not used by the project:
    
        CRYPTO_CIPHER_MODULE_ENABLED
        CRYPTO_HASH_MODULE_ENABLED
        CRYPTO_KEY_DERIVATION_MODULE_ENABLED
        CRYPTO_KEY_MODULE_ENABLED
        CRYPTO_MAC_MODULE_ENABLED
        CRYPTO_RNG_MODULE_ENABLED
        MBEDTLS_PSA_CRYPTO_USER_CONFIG_FILE
        PYTHON_PREFER
    
    
    -- Build files have been written to: /Users/Sim/hello_world/build_1/tfm
    [191/195] Linking C executable bin/tfm_s.axf
    Memory region         Used Size  Region Size  %age Used
               FLASH:       97664 B       320 KB     29.80%
                 RAM:       51788 B        88 KB     57.47%
    [18/331] Performing install step for 'tfm'
    -- Install configuration: "Debug"
    ----- Installing platform NS -----
    [207/331] Building C object CMakeFiles/app.dir/src/main.c.obj
    ../src/main.c: In function 'main':
    ../src/main.c:343:19: warning: 'ret' may be used uninitialized [-Wmaybe-uninitialized]
      343 |                 if(ret < 0)
          |                   ^
    ../src/main.c:247:13: note: 'ret' was declared here
      247 |         int ret;
          |             ^~~
    [260/331] Building C object modules/softsim/lib/CMakeFiles/..__modules__lib__onomondo-softsim__lib.dir/nrf_softsim.c.obj
    In file included from /opt/nordic/ncs/v2.5.0/modules/lib/onomondo-softsim/lib/include/onomondo/softsim/utils.h:6,
                     from /opt/nordic/ncs/v2.5.0/modules/lib/onomondo-softsim/lib/nrf_softsim.c:14:
    /opt/nordic/ncs/v2.5.0/modules/lib/onomondo-softsim/lib/include/onomondo/softsim/mem.h:9:9: note: '#pragma message: Using custom heap'
        9 | #pragma message "Using custom heap"
          |         ^~~~~~~
    /opt/nordic/ncs/v2.5.0/modules/lib/onomondo-softsim/lib/nrf_softsim.c: In function 'onomondo_init':
    /opt/nordic/ncs/v2.5.0/modules/lib/onomondo-softsim/lib/nrf_softsim.c:69:9: note: '#pragma message: Using static profile. Only for development!'
       69 | #pragma message "Using static profile. Only for development!"
          |         ^~~~~~~
    [261/331] Building C object modules/softsim/lib/CMakeFiles/..__modules__lib__onomondo-softsim__lib.dir/ss_fs.c.obj
    In file included from /opt/nordic/ncs/v2.5.0/modules/lib/onomondo-softsim/lib/include/onomondo/softsim/utils.h:6,
                     from /opt/nordic/ncs/v2.5.0/modules/lib/onomondo-softsim/lib/ss_fs.c:13:
    /opt/nordic/ncs/v2.5.0/modules/lib/onomondo-softsim/lib/include/onomondo/softsim/mem.h:9:9: note: '#pragma message: Using custom heap'
        9 | #pragma message "Using custom heap"
          |         ^~~~~~~
    [264/331] Building C object modules/softsim/lib/CMakeFiles/..__modules__lib__onomondo-softsim__lib.dir/ss_provision.c.obj
    In file included from /opt/nordic/ncs/v2.5.0/modules/lib/onomondo-softsim/lib/ss_provision.c:8:
    /opt/nordic/ncs/v2.5.0/modules/lib/onomondo-softsim/lib/include/onomondo/softsim/mem.h:9:9: note: '#pragma message: Using custom heap'
        9 | #pragma message "Using custom heap"
          |         ^~~~~~~
    [268/331] Building C object modules/softsim/lib/CMakeFiles/..__modules__lib__onomondo-softsim__lib.dir/ss_heap.c.obj
    In file included from /opt/nordic/ncs/v2.5.0/modules/lib/onomondo-softsim/lib/ss_heap.c:2:
    /opt/nordic/ncs/v2.5.0/modules/lib/onomondo-softsim/lib/include/onomondo/softsim/mem.h:9:9: note: '#pragma message: Using custom heap'
        9 | #pragma message "Using custom heap"
          |         ^~~~~~~
    [269/331] Building C object modules/softsim/lib/CMakeFiles/..__modules__lib__onomondo-softsim__lib.dir/ss_crypto.c.obj
    In file included from /opt/nordic/ncs/v2.5.0/modules/lib/onomondo-softsim/lib/ss_crypto.c:12:
    /opt/nordic/ncs/v2.5.0/modules/lib/onomondo-softsim/lib/include/onomondo/softsim/mem.h:9:9: note: '#pragma message: Using custom heap'
        9 | #pragma message "Using custom heap"
          |         ^~~~~~~
    [329/331] Linking C executable zephyr/zephyr.elf
    Memory region         Used Size  Region Size  %age Used
               FLASH:      214544 B       576 KB     36.37%
                 RAM:       71072 B     137880 B     51.55%
            IDT_LIST:          0 GB        32 KB      0.00%
    [331/331] Generating zephyr/merged.hex
     *  Le terminal sera réutilisé par les tâches, appuyez sur une touche pour le fermer. 

    Don't know if it's usefull but here my prj.conf

    ### Onomondo SoftSIM ###
    CONFIG_SOFTSIM_DEBUG=y
    CONFIG_SOFTSIM_LOG_LEVEL_ERR=y
    CONFIG_SOFTSIM_BUNDLE_TEMPLATE_HEX=y
    CONFIG_SOFTSIM_STATIC_PROFILE_ENABLE=y
    # GSMA TS.48 USIM profile (standard test profile) replace with actual Onomondo profile
    CONFIG_SOFTSIM_STATIC_PROFILE="my°profile_here"
    ### Onomondo SoftSIM ###
    
    # config gps
    CONFIG_UBXLIB=n
    CONFIG_GPIO=y
    CONFIG_I2C=n
    CONFIG_SPI=n
    
    # config Log
    CONFIG_LOG=y
    CONFIG_DEBUG=y
    CONFIG_ASSERT=y
    
    CONFIG_MINIMAL_LIBC=y
    CONFIG_MINIMAL_LIBC_MALLOC=n
    
    # Modem Configurations
    CONFIG_NRF_MODEM_LIB=y
    CONFIG_NRF_MODEM_LOG=n
    
    # NET Configurations
    CONFIG_NETWORKING=y
    CONFIG_NET_SOCKETS=y
    CONFIG_NET_NATIVE=n
    CONFIG_NET_SOCKETS_OFFLOAD=y
    CONFIG_NET_SOCKETS_POSIX_NAMES=y
    
    # # LTE Configurations
    CONFIG_LTE_LINK_CONTROL=y
    
    # # AT host library
    CONFIG_SERIAL=y
    CONFIG_NRF_MODEM_LIB_TRACE=y
    CONFIG_AT_HOST_LIBRARY=y
    CONFIG_UART_INTERRUPT_DRIVEN=y
    
    # # Reduce the size of TF-M by disabling the PS
    CONFIG_TFM_PARTITION_PROTECTED_STORAGE=n
    CONFIG_PSA_CRYPTO_DRIVER_CC3XX=n

Related