Control nRF9160 with a MCU using zephyr

Hi

If we're using an external MCU to control a nRF9160, is there any software support in zephyr available? The nRF9160 is well supported by zephyr if I program the cortex-M33 application processor. Are there some device tree options to integrate an external nRF9160 in zephyr? I don't want to write AT-commands from hand, but the nRF9160 has too less SRAM for my application.

Best regards
Samuel

Parents Reply Children
  • samuel4 said:
    Yes I did. But do you have zephyr support for the other device then?

    Zephyr is supported on nrf5340.

    samuel4 said:
    Is it possible use zephyr sockets on the nRF5340 with some device tree settings?

    Do you mean the Zephyr native network stack?

  • Let me recapitulate. Let's say we have a hardware consisting of a nRF9160 and nRF5340. They are connected via an UART. Now I want to use the zephyr socket API on the nRF5340 to send data over the cellular network. That means, zephyr (on the nRF5340) needs to know that there is an nRF9160 on some UART interface and how socket commands are translated into AT commands. In the zephyr documentation I found two device tree binding for external cellular modems. I have posted a link above to the socket wrapper of one of them. But I haven't found a device binding for an external nRF9160.

    So the question is: If I have such an hardware architecture, can I use the zephyr socket API on the nRF5340 to send data over a cellular network? Which means that there must be some specified software running on the nrf9160 receiving AT commands and more important: There must be a way to tell zephyr on the nrf5340 that there is a nRF9160 connected to it. Otherwise we probably need to implement our own device tree binding.

    Why I am asking that? The nRF9160 as cellular modem is great, but it is not scalable. It is limited to 1 MB flash and usable 192 KB SRAM. So if we develop an application that needs more ROM/RAM, we could just take the same zephyr application on a second MCU and connect the cellular modem over a device tree binding. At least for socket commands it should be portable that way.

  • samuel4 said:
    The nRF9160 as cellular modem is great, but it is not scalable. It is limited to 1 MB flash and usable 192 KB SRAM.

    Why do you need so much RAM in your application? Is it not possible to run the IP stack on the nrf9160 with the modem_lib?

    I believe it should be possible to run the IP stack on the nrf5340 and use CONFIG_NET_SOCKETS_OFFLOAD.

  • I am not sure, if the RAM will be sufficient in the end. From 256 KB, 64 KB go to bsdlib, another 32 to 64 KB to the secure partition. It might be possible that about 128 KB are enough, but if we run out of RAM, an easy migrating path to a different main CPU would be helpful.

    CONFIG_NET_SOCKETS_OFFLOAD is indeed a good point. Although the implementation is avaibable for the nRF9160 SoC only:

    These external modems select it:

    CONFIG_SOC_NRF9160_SICA selects the following symbol, which selects SOCKETS_OFFLOAD

    I guess a CONIFG_MODEM_NRF9160 option would be the one I am looking for.

  • samuel4 said:
    easy migrating path to a different main CPU would be helpful.

    I don't think there is an easy migrating path for this. Maybe you can submit a feature request.

Related