Giter Site home page Giter Site logo

nrf-softsim's People

Contributors

benjaminbruun avatar gabrielnotman avatar github-actions[bot] avatar mirkocovizzi avatar peterbornerup avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

nrf-softsim's Issues

Cannot enable CONFIG_SETTINGS with softsim integrated

Tried with the SLM app in NCS, when below is configured, project cannot run.

CONFIG_SOFTSIM_AUTO_INIT=n

CONFIG_SETTINGS=y
CONFIG_SETTINGS_FCB=y
CONFIG_FCB=y

API nrf_softsim_init() is called after settings_subsys_init().
Any special attention is required to use Settings?

Serial LTE Modem application (nRF Connect SDK) crashes during SoftSIM DEINIT

Hi,

we are currently encountering a problem where when issuing a CFUN=0 after a CFUN=1 the application core will reboot due to a crash in the DEINIT switch case, in particular while executing the deinit_fs function.

To reproduce the bug, checkout the branch https://github.com/MirkoCovizzi/nrf-softsim/tree/deinit-crash, point the manifest to west.yml and do a west update.
This will pull the NCS branch https://github.com/MirkoCovizzi/sdk-nrf/tree/deinit-crash that contains the application (currently WIP) https://github.com/MirkoCovizzi/sdk-nrf/tree/deinit-crash/applications/serial_lte_modem_softsim.

To build the application:

  • Go to the application directory: applications/serial_lte_modem_softsim
  • Execute: west build -b nrf9160dk_nrf9160_ns -- -DOVERLAY_CONFIG=overlay-onomondo.conf

To test the application:

  • Open a serial terminal to UART0
  • Check that upon boot the application will output the string Ready
  • Issue the following command into the serial terminal: AT+CFUN=1
  • Issue the following command into the serial terminal: AT+CFUN=0
  • Observe that the application will reboot, showing the string Ready

To show that the deinit_fs function is the culprit, checkout https://github.com/MirkoCovizzi/nrf-softsim/tree/deinit-no-crash and repeat the steps above.
Observe that after executing the same steps, the application will not reboot due to a crash (will not output the string Ready) after the specific sequence of AT commands.

Deprecated Kconfig options

The configuration option CONFIG_NRF_MODEM_LIB_SYS_INIT is officially deprecated as of nRF Connect SDK v2.4.0
https://developer.nordicsemi.com/nRF_Connect_SDK/doc/2.4.0/nrf/releases/release-notes-2.4.0.html#modem-libraries

The newest SDK version (2.5.2) is stating a new modem initialisation flow:
https://developer.nordicsemi.com/nRF_Connect_SDK/doc/2.5.2/nrf/libraries/modem/nrf_modem_lib/nrf_modem_lib_wrapper.html#library-wrapper

The configuration used for the SoftSIM samples are still part of the official nRF Connect SDK source code and therefore still allowing the modem to correctly initialise.
https://github.com/nrfconnect/sdk-nrf/blob/v2.5.0/lib/nrf_modem_lib/nrf_modem_lib.c#L214-L217

But we need to re-visit these functions and make sure that the samples are future proof before the support for the required Kconfig options are indeed deprecated.

f_cache: possibly redundant?

The custom NVS caching implementation in f_cache.c is potentially redundant, as the Zephyr NVS filesystem has built-in caching functionality, CONFIG_NVS_LOOKUP_CACHE.

The caching mechanism makes lookup times linear, instead of needing to walk the linked list.
NVS additionally already performs duplicate data checking to reduce writes:
https://github.com/zephyrproject-rtos/zephyr/blob/f9051d626d7607f1e0e18f5bafd2acb3a199ac12/subsys/fs/nvs/nvs.c#L1078-L1083

A major advantage of using the built-in caching is that there is no need to buffer entries in RAM, as the cache contains a pointer directly to the allocated address in the NVS filesystem.

This is just a suggestion, as I can't know if there is additional de-duplication occurring inside libstorage.a based on the _b_dirty field.

Namespace problems

There are several examples of functions that are not properly namespaced to this repo, which are almost certain to cause issues for someone in the future with an ecosystem as large as Zephyrs'. By this, I mean the name is so generic that other libraries and application could easily write code with the same name.

In the same vein, there are a few internal variables without a static qualifier which could cause compilation issues for users.

Namespace issues:

  • aes_128_encrypt_block
  • read_nvs_to_cache
  • fs_is_initialized
  • init_fs
  • deinit_fs
  • port_*
  • hex_to_uint8
  • hex_string_to_bytes
  • decode_profile

Static issues:

  • shared_buffer
  • softsim_work_q
  • ctx
  • storage_path

`SOFTSIM_STACK_SIZE` is excessive

As the comment says, 10000 is an excessive value for SOFTSIM_STACK_SIZE, over 5% of the total RAM available to an application (ignoring the heap used for message passing).
Regardless of whether this value can be optimised at this point, the value should be swapped to a Kconfig symbol so that the value can be updated as needed by users.

Soft SIM LittleFS Backend

Hello,
i'm reaching out like this because all inquires though onomondo email are met with deaf ear.

We are ready to integrate the Onomondo Softsim and we are willing to make the thing work on our own also to contribute into this repository. All i need is your initial code for LittleFS backend you told you have and also the script that created the provisioning template that so we can retrofit older devices that do not have the provision hex included.

@peterbornerup

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.