This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Possible to pre-load data to NVS when the nrf9160 is programmed?

Hello,

We are using the nrf9160 in a custom hardware solution, with SDK v1.2.0 and modem firmware v1.1.1. There are some data items that we would like to load into NVS at the time the nrf9160 is programmed, for example if it were being flashed at the factory. Some are not security-critical, such as target server IP(s) and port(s), our in-house device IDs, and so forth. However we do have security-critical items to store -- 2 PSKs for TLS connections.

I am aware that TLS credentials can be written to/read from the modem flash using the AT command %CMNG, but only written when the modem is offline. There are certain scenarios when the application will need to refresh the PSK while maintaining an LTE connection, so I am not sure that the modem credential storage is the right solution for us. We are also rolling the wolfSSL TLS stack rather than the native TLS so we can use existing code from another cross-platform solution we've written. This means we cannot simply specify a sec_tag in the modem to use for TLS when creating a socket.

My question has 2 parts, due to the different considerations for secure and non-secure data.

1. Is there an example/guide as to how one might pre-write a set of data into NVS at the time the application processor is programmed? Is it even possible to read/write to NVS outside of runtime?

2. Are there any alternatives to modem flash for secure storage in the same vein as No. 1, that can be pre-written at the time of apps proc programming?

I appreciate any help/advice you can offer. Thank you!

Parents
  • Hi!

     

    1. Is there an example/guide as to how one might pre-write a set of data into NVS at the time the application processor is programmed? Is it even possible to read/write to NVS outside of runtime?
    It is possible to read and write to the exact flash memory area which belongs to NVS via nrfjprog for instance. We don't have any tool for performing data write or read in NVS format, but that ought to be possible to do using native_posix target.

     

    2. Are there any alternatives to modem flash for secure storage in the same vein as No. 1, that can be pre-written at the time of apps proc programming?
    So, this question and the context you provide in your ticket are for two different scenarios, in my opinion.
    1. The keys are changing during run-time and hence you need to be able to change them during the application.
    2. You want the keys securely flashed before the application starts.
    For number two, you can use %CMNG. But since you mention that's not an option, I imagine you need both requirements in your application. You may consider running TLS in the application domain.
    Please let me know if you need more information!

    Best regards,

    Heidi

  • Hi Heidi,

    that ought to be possible to do using native_posix target

    I'm reading over this page and just want to clarify you're implying I could accomplish this with CONFIG_FUSE_FS_ACCESS? That sounds really promising, I hadn't seen this feature before.

    I do have one other non-critical question regarding %CMNG -- what is the range of security tags available? I doubt that we're at risk of hitting that limit, I'm just curious what the limit is and haven't found any information about it in documentation nor when grepping the source code.

    Thank you for your help!

Reply
  • Hi Heidi,

    that ought to be possible to do using native_posix target

    I'm reading over this page and just want to clarify you're implying I could accomplish this with CONFIG_FUSE_FS_ACCESS? That sounds really promising, I hadn't seen this feature before.

    I do have one other non-critical question regarding %CMNG -- what is the range of security tags available? I doubt that we're at risk of hitting that limit, I'm just curious what the limit is and haven't found any information about it in documentation nor when grepping the source code.

    Thank you for your help!

Children
Related