how to add softsim to an existing project like nrf_cloud_multi_service

Hi,

We recently managed to get the onomondo softsim working on a dev kit, we used the sample code provided by onomodo to do this. Now we want to add the softsim to the nrf_cloud_multi_service sample. What are the changes that we need to make on this sample inorder for it to work with a softsim. 

Parents
  • I'm getting this kconfig error error: Aborting due to Kconfig warnings


    CMake Error at C:/ncs/v2.6.2/zephyr/cmake/modules/kconfig.cmake:358 (message):
      command failed with return code: 1
    Call Stack (most recent call first):
      C:/ncs/v2.6.2/nrf/cmake/modules/kconfig.cmake:29 (include)
      C:/ncs/v2.6.2/zephyr/cmake/modules/zephyr_default.cmake:129 (include)
      C:/ncs/v2.6.2/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:66 (include)
      C:/ncs/v2.6.2/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:92 (include_boilerplate)
      CMakeLists.txt:9 (find_package) 

    while trying to build using west build -b nrf9151dk_nrf9151_ns -- "-DOVERLAY_CONFIG=C:\ncs\v2.6.2\modules\lib\onomondo-softsim/overlay-softsim.conf" 
  • The sample build successfully when I made this changes in the prj.conf 

    #
    # Copyright (c) 2022 Nordic Semiconductor ASA
    #
    # SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
    #
    
    # Log level
    # For more verbose and detailed log output, set the log level to
    # CONFIG_MULTI_SERVICE_LOG_LEVEL_DBG=y instead.
    CONFIG_MULTI_SERVICE_LOG_LEVEL_INF=y
    
    # General config
    CONFIG_EVENTS=y
    CONFIG_PICOLIBC_IO_FLOAT=y
    CONFIG_RESET_ON_FATAL_ERROR=y
    CONFIG_NCS_SAMPLES_DEFAULTS=y
    
    # LED indication
    # Uncomment these to minimize LED state indication when power savings are necessary
    # CONFIG_LED_VERBOSE_INDICATION=n
    # CONFIG_LED_CONTINUOUS_INDICATION=n
    
    # Or, uncomment this to completely disable LED state indication
    # CONFIG_LED_INDICATION_DISABLED=y
    
    # Improved Logging
    # CONFIG_LOG_MODE_DEFERRED allows logging from multiple threads simultaneously without creating
    # splintered log entries, at the cost of needing a buffer for storing logs.
    CONFIG_LOG_MODE_DEFERRED=y
    
    # CONFIG_LOG_BUFFER_SIZE is the aforementioned buffer. A size of 4096 bytes is useful for debugging
    # and prototyping, but is probably more than necessary for production-ready firmware.
    CONFIG_LOG_BUFFER_SIZE=4096
    
    # Heap and stacks
    # Extended AT host/monitor stack/heap sizes since some nrf_cloud credentials are longer than 1024 bytes.
    CONFIG_AT_MONITOR_HEAP_SIZE=2048
    CONFIG_AT_HOST_STACK_SIZE=2048
    # Extended memory heap size needed both for PGPS and for encoding JSON-based nRF Cloud Device Messages.
    CONFIG_HEAP_MEM_POOL_SIZE=54576
    CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=4096
    
    # Enable Networking and Connection Manager.
    CONFIG_NETWORKING=y
    CONFIG_NET_SOCKETS=y
    CONFIG_NET_SOCKETS_OFFLOAD=y
    CONFIG_NET_MGMT_EVENT_STACK_SIZE=2048
    CONFIG_NET_CONNECTION_MANAGER_MONITOR_STACK_SIZE=1024
    CONFIG_MAIN_STACK_SIZE=2048
    
    # Enable LTE Connectivity using Connection Manager
    CONFIG_NET_IPV4=y
    CONFIG_NET_IPV6=y
    CONFIG_NET_IPV6_NBR_CACHE=n
    CONFIG_NET_IPV6_MLD=n
    CONFIG_NET_CONNECTION_MANAGER=y
    CONFIG_NRF_MODEM_LIB_ON_FAULT_APPLICATION_SPECIFIC=y
    CONFIG_NRF_MODEM_LIB_NET_IF=y
    CONFIG_NRF_MODEM_LIB_NET_IF_AUTO_DOWN=y
    CONFIG_NRF_MODEM_LIB_NET_IF_DOWN_DEFAULT_LTE_DISCONNECT=y
    
    # Enable power savings mode
    CONFIG_LTE_PSM_REQ=y
    # Set the PSM Requested Active Time to 20 seconds
    CONFIG_LTE_PSM_REQ_RAT="00001010"
    
    # Modem library
    CONFIG_NRF_MODEM_LIB=y
    
    # AT commands interface
    CONFIG_UART_INTERRUPT_DRIVEN=y
    CONFIG_AT_HOST_LIBRARY=y
    
    # nRF Cloud
    CONFIG_NRF_CLOUD_MQTT=y # This also enables FOTA by implicitly setting CONFIG_NRF_CLOUD_FOTA=y
    
    # MQTT
    CONFIG_MQTT_KEEPALIVE=120
    
    # MCUBOOT - Needed by FOTA
    CONFIG_BOOTLOADER_MCUBOOT=y
    CONFIG_IMG_MANAGER=y
    CONFIG_MCUBOOT_IMG_MANAGER=y
    CONFIG_STREAM_FLASH_ERASE=y
    
    # Location Services configuration
    CONFIG_LOCATION=y
    CONFIG_LOCATION_METHOD_GNSS=y
    CONFIG_LOCATION_METHOD_CELLULAR=y
    CONFIG_NRF_CLOUD_AGNSS=y
    CONFIG_NRF_CLOUD_LOCATION=y
    CONFIG_MODEM_INFO=y
    CONFIG_MODEM_INFO_ADD_NETWORK=y
    CONFIG_NRF_CLOUD_PGPS=y
    CONFIG_NRF_CLOUD_PGPS_REPLACEMENT_THRESHOLD=4
    CONFIG_NRF_CLOUD_PGPS_REQUEST_UPON_INIT=y
    
    # Date Time lib - Used by PGPS and main application
    CONFIG_DATE_TIME=y
    
    # LTE link control - used by PGPS and main application
    CONFIG_LTE_LINK_CONTROL=y
    
    # Settings - used by nRF Cloud library and PGPS
    CONFIG_SETTINGS=y
    CONFIG_SETTINGS_FCB=y
    CONFIG_FCB=y
    
    # Download Client - used by FOTA and PGPS
    CONFIG_DOWNLOAD_CLIENT=y
    CONFIG_DOWNLOAD_CLIENT_HTTP_FRAG_SIZE_1024=y
    CONFIG_DOWNLOAD_CLIENT_STACK_SIZE=4096
    CONFIG_DOWNLOAD_CLIENT_BUF_SIZE=2300
    CONFIG_DOWNLOAD_CLIENT_MAX_HOSTNAME_SIZE=128
    
    # Flash - Used by FOTA and PGPS
    CONFIG_FLASH=y
    CONFIG_FLASH_PAGE_LAYOUT=y
    CONFIG_FLASH_MAP=y
    CONFIG_STREAM_FLASH=y
    CONFIG_MPU_ALLOW_FLASH_WRITE=y
    CONFIG_PM_EXTERNAL_FLASH_MCUBOOT_SECONDARY=n
    CONFIG_NRF_CLOUD_ALERT=y
    CONFIG_NRF_CLOUD_LOG_DIRECT=y
    CONFIG_NRF_CLOUD_LOG_OUTPUT_LEVEL=3
    
    # On initial connection to the cloud, add info sections to the shadow
    CONFIG_NRF_CLOUD_SEND_DEVICE_STATUS=y
    CONFIG_NRF_CLOUD_SEND_DEVICE_STATUS_NETWORK=y
    CONFIG_NRF_CLOUD_SEND_DEVICE_STATUS_SIM=y
    CONFIG_NRF_CLOUD_SEND_SERVICE_INFO_FOTA=y
    CONFIG_NRF_CLOUD_SEND_SERVICE_INFO_UI=y
    
    CONFIG_NRF_CLOUD_CLIENT_ID_SRC_IMEI=y
    CONFIG_NRF_CLOUD_CLIENT_ID_PREFIX="nrf-"
    # CONFIG_NRF_CLOUD_IPV6=y # disable this for US
    CONFIG_LTE_NETWORK_MODE_LTE_M_GPS=y # use LTE-M for US
    
    CONFIG_FP_SOFTABI=y
    
    CONFIG_SOFTSIM=y
    CONFIG_SOFTSIM_AUTO_INIT=y
    
    # NVS Configurations
    CONFIG_NVS=y
    CONFIG_NVS_LOG_LEVEL_ERR=y
    CONFIG_PM_PARTITION_SIZE_NVS_STORAGE=0x8000
    
    CONFIG_SOFTSIM_BUNDLE_TEMPLATE_HEX=y
    
    # Reduce the size of TF-M by disabling the PS
    CONFIG_TFM_PARTITION_PROTECTED_STORAGE=n
    CONFIG_PSA_CRYPTO_DRIVER_CC3XX=n
    
    # Reduce the size of the TF-M partition
    # when combined with static partitioning
    CONFIG_PM_PARTITION_SIZE_TFM=0x10000
    
    # The bootloader adds a small mcuboot_pad partition,
    # whose size must be subtracted from the TF-M partition
    #CONFIG_BOOTLOADER_MCUBOOT=y
    # CONFIG_PM_PARTITION_SIZE_TFM=0xfe00
    
    # Flash Configurations
    # CONFIG_FLASH=y
    # CONFIG_FLASH_MAP=y
    # CONFIG_FLASH_PAGE_LAYOUT=y
    # CONFIG_MPU_ALLOW_FLASH_WRITE=y
    
    # TF-M Configurations
    # CONFIG_BUILD_WITH_TFM=y
    # CONFIG_TFM_PROFILE_TYPE_NOT_SET=y
    # CONFIG_TFM_LOG_LEVEL_SILENCE=y
    
    # # PSA Crypto Configurations
    # CONFIG_PSA_WANT_ALG_CBC_NO_PADDING=y
    # CONFIG_PSA_WANT_ALG_ECB_NO_PADDING=y
    # CONFIG_PSA_WANT_ALG_CMAC=y
    # CONFIG_PSA_WANT_KEY_TYPE_AES=y
    
    # # Libraries
    # CONFIG_NEWLIB_LIBC=y

    And then I flashed this firmware onto a device in which a soft sim was already provisioned and this is what I see in the terminal. 

    The program doesn't go beyond this point as the device can't register with the network.

    When I ran the AT command to check the network registration status, I'm getting +CEREG: 5,2 as response.

    PS: The sdk version I'm using 2.6.2

  • Hi Dejan,

    Can you specify only the changes which you made to the prj.conf?

    CONFIG_FP_SOFTABI=y
    
    CONFIG_SOFTSIM=y
    CONFIG_SOFTSIM_AUTO_INIT=y
    
    # NVS Configurations
    CONFIG_NVS=y
    CONFIG_NVS_LOG_LEVEL_ERR=y
    CONFIG_PM_PARTITION_SIZE_NVS_STORAGE=0x8000
    
    CONFIG_SOFTSIM_BUNDLE_TEMPLATE_HEX=y
    
    # Reduce the size of TF-M by disabling the PS
    CONFIG_TFM_PARTITION_PROTECTED_STORAGE=n
    CONFIG_PSA_CRYPTO_DRIVER_CC3XX=n
    
    # Reduce the size of the TF-M partition
    # when combined with static partitioning
    CONFIG_PM_PARTITION_SIZE_TFM=0x10000
    
    # The bootloader adds a small mcuboot_pad partition,
    # whose size must be subtracted from the TF-M partition
    #CONFIG_BOOTLOADER_MCUBOOT=y
    # CONFIG_PM_PARTITION_SIZE_TFM=0xfe00
    
    # Flash Configurations
    # CONFIG_FLASH=y
    # CONFIG_FLASH_MAP=y
    # CONFIG_FLASH_PAGE_LAYOUT=y
    # CONFIG_MPU_ALLOW_FLASH_WRITE=y
    
    # TF-M Configurations
    # CONFIG_BUILD_WITH_TFM=y
    # CONFIG_TFM_PROFILE_TYPE_NOT_SET=y
    # CONFIG_TFM_LOG_LEVEL_SILENCE=y
    
    # # PSA Crypto Configurations
    # CONFIG_PSA_WANT_ALG_CBC_NO_PADDING=y
    # CONFIG_PSA_WANT_ALG_ECB_NO_PADDING=y
    # CONFIG_PSA_WANT_ALG_CMAC=y
    # CONFIG_PSA_WANT_KEY_TYPE_AES=y
    
    # # Libraries
    # CONFIG_NEWLIB_LIBC=y
    .

    here you go.

    Updating only Kconfig options in prj.conf might not be enough to integrate Onomondo SoftSim with the multi service sample. Additional steps might be needed. I will check this internally and get back to you during next week.

    Ok, I'll wait.

    best regards,

  • Hi Dejan,

    Any update on this?

    best regards,

  • Hi,

    Akshay said:
    Any update on this?

    No, there is no update yet. We will look into this from Wednesday onwards. I expect to get back to you by the end of the week.

    Thank you for your patience.

    Best regards,
    Dejan

  • Hi Dejan,

    I understand, thanks for letting me know.

    best regards,

  • Hi,

    You could have a look at this pull request. Please note that the commit is for v2.6-branch of the sdk-nrf. 

    Best regards,
    Dejan

Reply Children
  • Hi Dejan,

    It worked!!.

    [00:00:20.402,679] <inf> cloud_connection: Transfer SoftSIM profile using serial COM port, terminate by newline character (return key)
    [00:00:00.264,007] <inf> spi_nor: gd25wb256e3ir@1: 32 MiBy flash
    *** Booting nRF Connect SDK v3.5.99-ncs1-2 ***
    [00:00:00.275,634] <inf> softsim: SoftSIM initialized
    [00:00:00.276,000] <inf> main: nRF Cloud multi-service sample has started, version: 1.0.0, protocol: MQTT
    [00:00:00.276,428] <inf> cloud_connection: Waiting for SoftSIM profile...
    [00:00:00.276,458] <inf> cloud_connection: Transfer SoftSIM profile using serial COM port, terminate by newline character (return key)
    [00:00:20.276,550] <inf> cloud_connection: Transfer SoftSIM profile using serial COM port, terminate by newline character (return key)
    > 01120829430512304655900214985437000000625405090320D8EF8D08B27BCB48B3C2AA86CA3E286004204F78CCDAEA891A8783162AFF704CD9AA0808363038330b1037303236343836370a2033383232353236363731333634373932
    [00:00:33.034,942] <inf> cloud_connection: Profile received: 186 characters in total
    [00:00:33.316,253] <inf> softsim: SoftSIM keys written to KMU
    [00:00:33.316,284] <inf> softsim: Provisioning SoftSIM 1/4
    [00:00:33.405,670] <inf> softsim: Provisioning SoftSIM 2/4
    [00:00:33.407,165] <inf> softsim: Provisioning SoftSIM 3/4
    [00:00:33.408,905] <inf> softsim: Provisioning SoftSIM 4/4
    [00:00:33.411,560] <inf> softsim: SoftSIM provisioned
    [00:00:00.263,336] <inf> spi_nor: gd25wb256e3ir@1: 32 MiBy flash
    *** Booting nRF Connect SDK v3.5.99-ncs1-2 ***
    [00:00:00.276,062] <inf> softsim: SoftSIM initialized
    [00:00:00.276,458] <inf> main: nRF Cloud multi-service sample has started, version: 1.0.0, protocol: MQTT
    [00:00:00.277,191] <inf> cloud_connection: SoftSIM is provisioned.
    [00:00:00.277,221] <inf> cloud_connection: Enabling connectivity...
    [00:00:00.578,643] <inf> cloud_connection: Setting up nRF Cloud library...
    [00:00:00.587,280] <inf> cloud_connection: Waiting for network ready...
    +CGEV: EXCE STATUS 0
    +CEREG: 2,"0609","00C77C11",7
    +CSCON: 1
    +CEREG: 2,"0609","00C77C11",7,0,11
    +CSCON: 0
    +CEREG: 2,"50F9","0550C116",7
    +CSCON: 1
    +CGEV: ME PDN ACT 0,0
    +CNEC_ESM: 50,0
    +CEREG: 5,"50F9","0550C116",7,,,"00001010","00000011"
    [00:00:23.954,254] <inf> cloud_connection: Network connectivity gained!
    %XTIME: "0A","5220012124610A","00"
    [00:00:24.954,376] <inf> cloud_connection: Network is ready
    [00:00:24.954,406] <inf> cloud_connection: Connecting to nRF Cloud
    [00:00:24.954,467] <inf> cloud_connection: Device ID: nrf-359404230033467
    [00:00:27.600,769] <inf> cloud_connection: Connected to nRF Cloud
    [00:00:29.488,525] <inf> application: Waiting for modem to determine current date and time
    [00:00:29.488,555] <inf> application: Current date and time determined
    [00:00:29.499,359] <inf> application: Temperature is 23 degrees C
    [00:00:29.500,762] <inf> nrf_cloud_pgps: Storage base:0xDB000, size:86016
    [00:00:29.501,983] <inf> nrf_cloud_pgps: Checking P-GPS header: Schema version:0, type:0, num:0, count:0

    Thank you so much for your help.

    best regards,

Related