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

nRF9160 LTE Modem IPC

Hello,

I am looking into the nRF9160 hardware. And at the moment we are only interested in the lowest level possible.

The peripherals are well documented, as espected. But the LTE modem is communicating via IPC, and I cannot find any documentation about this.

I would like to be able to have a serial interface to the modem where I can provide the AT commands to the modem processor.

After some searching, I found out that the following libraries are available in the nrfxlib (https://github.com/NordicPlayground/nrfxlib/tree/master/bsdlib) :

- libbsd_nrf9160_xxaa.a

- liboberon_2.0.5.a

I am pretty confident that this is the only thing I need for the most simplistic modem interface. But it does not tell me whether I need both, or just one, or how to use it.

I included the libraries in my bare metal project, but now I get some linking errors with my gcc / makefile compiler:

make: *** [debug/nRF91.elf] Error 1
../../Resources/Targets/Nordic/nRF91/bare/Common/nrfxlib-0.3.0/bsdlib/lib/cortex-m33/soft-float\libbsd_nrf9160_xxaa.a(bsd_platform.c.o): In function `unimplemented_method':
bsd_platform.c:(.text.unimplemented_method+0x6): undefined reference to `bsd_os_errno_set'
../../Resources/Targets/Nordic/nRF91/bare/Common/nrfxlib-0.3.0/bsdlib/lib/cortex-m33/soft-float\libbsd_nrf9160_xxaa.a(bsd_platform.c.o): In function `bsd_platform_init':
bsd_platform.c:(.text.bsd_platform_init+0x1c): undefined reference to `bsd_os_init'
../../Resources/Targets/Nordic/nRF91/bare/Common/nrfxlib-0.3.0/bsdlib/lib/cortex-m33/soft-float\libbsd_nrf9160_xxaa.a(bsd_platform.c.o): In function `bsd_platform_af_method_table_get':
bsd_platform.c:(.text.bsd_platform_af_method_table_get+0x10): undefined reference to `bsd_os_errno_set'
../../Resources/Targets/Nordic/nRF91/bare/Common/nrfxlib-0.3.0/bsdlib/lib/cortex-m33/soft-float\libbsd_nrf9160_xxaa.a(bsd_platform.c.o): In function `bsd_platform_fd_method_table_get':
bsd_platform.c:(.text.bsd_platform_fd_method_table_get+0x1c): undefined reference to `bsd_os_errno_set'
bsd_platform.c:(.text.bsd_platform_fd_method_table_get+0x56): undefined reference to `bsd_os_errno_set'
../../Resources/Targets/Nordic/nRF91/bare/Common/nrfxlib-0.3.0/bsdlib/lib/cortex-m33/soft-float\libbsd_nrf9160_xxaa.a(bsd_platform_util.c.o): In function `bsd_platform_poll':
bsd_platform_util.c:(.text.bsd_platform_poll+0x56): undefined reference to `bsd_os_timedwait'
../../Resources/Targets/Nordic/nRF91/bare/Common/nrfxlib-0.3.0/bsdlib/lib/cortex-m33/soft-float\libbsd_nrf9160_xxaa.a(ip_interface.c.o): In function `ip_interface_open':
ip_interface.c:(.text.ip_interface_open+0xb0): undefined reference to `bsd_os_errno_set'
ip_interface.c:(.text.ip_interface_open+0xca): undefined reference to `bsd_os_errno_set'
ip_interface.c:(.text.ip_interface_open+0x140): undefined reference to `bsd_os_errno_set'
../../Resources/Targets/Nordic/nRF91/bare/Common/nrfxlib-0.3.0/bsdlib/lib/cortex-m33/soft-float\libbsd_nrf9160_xxaa.a(ip_interface.c.o): In function `ip_interface_close':
ip_interface.c:(.text.ip_interface_close+0xcc): undefined reference to `bsd_os_errno_set'
../../Resources/Targets/Nordic/nRF91/bare/Common/nrfxlib-0.3.0/bsdlib/lib/cortex-m33/soft-float\libbsd_nrf9160_xxaa.a(ip_interface.c.o): In function `ip_interface_sendto':
ip_interface.c:(.text.ip_interface_sendto+0x7c): undefined reference to `bsd_os_errno_set'
../../Resources/Targets/Nordic/nRF91/bare/Common/nrfxlib-0.3.0/bsdlib/lib/cortex-m33/soft-float\libbsd_nrf9160_xxaa.a(ip_interface.c.o):ip_interface.c:(.text.ip_interface_recvfrom+0x106): more undefined references to `bsd_os_errno_set' follow
../../Resources/Targets/Nordic/nRF91/bare/Common/nrfxlib-0.3.0/bsdlib/lib/cortex-m33/soft-float\libbsd_nrf9160_xxaa.a(ip_interface.c.o): In function `ip_interface_getaddrinfo':
ip_interface.c:(.text.ip_interface_getaddrinfo+0xc8): undefined reference to `bsd_os_timedwait'
ip_interface.c:(.text.ip_interface_getaddrinfo+0x100): undefined reference to `bsd_os_errno_set'
../../Resources/Targets/Nordic/nRF91/bare/Common/nrfxlib-0.3.0/bsdlib/lib/cortex-m33/soft-float\libbsd_nrf9160_xxaa.a(interface.c.o): In function `interface_socket_allocate':
interface.c:(.text.interface_socket_allocate+0x3c): undefined reference to `bsd_os_errno_set'
../../Resources/Targets/Nordic/nRF91/bare/Common/nrfxlib-0.3.0/bsdlib/lib/cortex-m33/soft-float\libbsd_nrf9160_xxaa.a(interface.c.o): In function `interface_socket_wait':
interface.c:(.text.interface_socket_wait+0x28): undefined reference to `bsd_os_timedwait'
../../Resources/Targets/Nordic/nRF91/bare/Common/nrfxlib-0.3.0/bsdlib/lib/cortex-m33/soft-float\libbsd_nrf9160_xxaa.a(rpc_framework.c.o): In function `bsd_os_application_irq_handler':
rpc_framework.c:(.text.bsd_os_application_irq_handler+0x6): undefined reference to `bsd_os_application_irq_clear'
../../Resources/Targets/Nordic/nRF91/bare/Common/nrfxlib-0.3.0/bsdlib/lib/cortex-m33/soft-float\libbsd_nrf9160_xxaa.a(rpc_framework.c.o): In function `rpc_transport_input':
rpc_framework.c:(.text.rpc_transport_input+0x19e): undefined reference to `bsd_os_application_irq_set'
../../Resources/Targets/Nordic/nRF91/bare/Common/nrfxlib-0.3.0/bsdlib/lib/cortex-m33/soft-float\libbsd_nrf9160_xxaa.a(pk.c.o): In function `mbedtls_pk_verify':
pk.c:(.text.mbedtls_pk_verify+0x2e): undefined reference to `mbedtls_md_info_from_type'
pk.c:(.text.mbedtls_pk_verify+0x34): undefined reference to `mbedtls_md_get_size'
../../Resources/Targets/Nordic/nRF91/bare/Common/nrfxlib-0.3.0/bsdlib/lib/cortex-m33/soft-float\libbsd_nrf9160_xxaa.a(pk.c.o): In function `mbedtls_pk_verify_ext':
pk.c:(.text.mbedtls_pk_verify_ext+0x56): undefined reference to `mbedtls_md_info_from_type'
pk.c:(.text.mbedtls_pk_verify_ext+0x5c): undefined reference to `mbedtls_md_get_size'
../../Resources/Targets/Nordic/nRF91/bare/Common/nrfxlib-0.3.0/bsdlib/lib/cortex-m33/soft-float\libbsd_nrf9160_xxaa.a(pk.c.o): In function `mbedtls_pk_sign':
pk.c:(.text.mbedtls_pk_sign+0x3a): undefined reference to `mbedtls_md_info_from_type'
pk.c:(.text.mbedtls_pk_sign+0x40): undefined reference to `mbedtls_md_get_size'
../../Resources/Targets/Nordic/nRF91/bare/Common/nrfxlib-0.3.0/bsdlib/lib/cortex-m33/soft-float\libbsd_nrf9160_xxaa.a(at_interface.c.o): In function `at_interface_write':
at_interface.c:(.text.at_interface_write+0x88): undefined reference to `bsd_os_errno_set'
../../Resources/Targets/Nordic/nRF91/bare/Common/nrfxlib-0.3.0/bsdlib/lib/cortex-m33/soft-float\libbsd_nrf9160_xxaa.a(at_interface.c.o): In function `at_interface_open':
at_interface.c:(.text.at_interface_open+0x78): undefined reference to `bsd_os_errno_set'
../../Resources/Targets/Nordic/nRF91/bare/Common/nrfxlib-0.3.0/bsdlib/lib/cortex-m33/soft-float\libbsd_nrf9160_xxaa.a(at_interface.c.o): In function `at_interface_close':
at_interface.c:(.text.at_interface_close+0x7e): undefined reference to `bsd_os_errno_set'
../../Resources/Targets/Nordic/nRF91/bare/Common/nrfxlib-0.3.0/bsdlib/lib/cortex-m33/soft-float\libbsd_nrf9160_xxaa.a(at_interface.c.o): In function `at_interface_read':
at_interface.c:(.text.at_interface_read+0x80): undefined reference to `bsd_os_errno_set'
at_interface.c:(.text.at_interface_read+0x94): undefined reference to `bsd_os_errno_set'
../../Resources/Targets/Nordic/nRF91/bare/Common/nrfxlib-0.3.0/bsdlib/lib/cortex-m33/soft-float\libbsd_nrf9160_xxaa.a(at_interface.c.o):at_interface.c:(.text.at_interface_read+0xa2): more undefined references to `bsd_os_errno_set' follow
../../Resources/Targets/Nordic/nRF91/bare/Common/nrfxlib-0.3.0/bsdlib/lib/cortex-m33/soft-float\libbsd_nrf9160_xxaa.a(ipc_trace.c.o): In function `bsd_os_trace_irq_handler':
ipc_trace.c:(.text.bsd_os_trace_irq_handler+0x50): undefined reference to `bsd_os_trace_put'
ipc_trace.c:(.text.bsd_os_trace_irq_handler+0x5a): undefined reference to `bsd_os_trace_put'
ipc_trace.c:(.text.bsd_os_trace_irq_handler+0xb8): undefined reference to `bsd_os_trace_put'
ipc_trace.c:(.text.bsd_os_trace_irq_handler+0xc2): undefined reference to `bsd_os_trace_put'
ipc_trace.c:(.text.bsd_os_trace_irq_handler+0x11e): undefined reference to `bsd_os_trace_put'
../../Resources/Targets/Nordic/nRF91/bare/Common/nrfxlib-0.3.0/bsdlib/lib/cortex-m33/soft-float\libbsd_nrf9160_xxaa.a(ipc_trace.c.o):ipc_trace.c:(.text.bsd_os_trace_irq_handler+0x128): more undefined references to `bsd_os_trace_put' follow
../../Resources/Targets/Nordic/nRF91/bare/Common/nrfxlib-0.3.0/bsdlib/lib/cortex-m33/soft-float\libbsd_nrf9160_xxaa.a(ipc_trace.c.o): In function `bsd_os_trace_irq_handler':
ipc_trace.c:(.text.bsd_os_trace_irq_handler+0x168): undefined reference to `bsd_os_trace_irq_clear'
ipc_trace.c:(.text.bsd_os_trace_irq_handler+0x176): undefined reference to `bsd_os_trace_put'
ipc_trace.c:(.text.bsd_os_trace_irq_handler+0x180): undefined reference to `bsd_os_trace_put'
ipc_trace.c:(.text.bsd_os_trace_irq_handler+0x198): undefined reference to `bsd_os_trace_put'
ipc_trace.c:(.text.bsd_os_trace_irq_handler+0x1a2): undefined reference to `bsd_os_trace_put'
../../Resources/Targets/Nordic/nRF91/bare/Common/nrfxlib-0.3.0/bsdlib/lib/cortex-m33/soft-float\libbsd_nrf9160_xxaa.a(ipc_trace.c.o): In function `ipc_trace_handle':
ipc_trace.c:(.text.ipc_trace_handle+0xce): undefined reference to `bsd_os_trace_put'
../../Resources/Targets/Nordic/nRF91/bare/Common/nrfxlib-0.3.0/bsdlib/lib/cortex-m33/soft-float\libbsd_nrf9160_xxaa.a(ipc_trace.c.o):ipc_trace.c:(.text.ipc_trace_handle+0xd8): more undefined references to `bsd_os_trace_put' follow
../../Resources/Targets/Nordic/nRF91/bare/Common/nrfxlib-0.3.0/bsdlib/lib/cortex-m33/soft-float\libbsd_nrf9160_xxaa.a(ipc_trace.c.o): In function `ipc_trace_handle':
ipc_trace.c:(.text.ipc_trace_handle+0x242): undefined reference to `bsd_os_trace_irq_set'
ipc_trace.c:(.text.ipc_trace_handle+0x27e): undefined reference to `bsd_os_trace_put'
ipc_trace.c:(.text.ipc_trace_handle+0x288): undefined reference to `bsd_os_trace_put'
ipc_trace.c:(.text.ipc_trace_handle+0x2a0): undefined reference to `bsd_os_trace_put'
ipc_trace.c:(.text.ipc_trace_handle+0x2aa): undefined reference to `bsd_os_trace_put'
ipc_trace.c:(.text.ipc_trace_handle+0x2ba): undefined reference to `bsd_os_trace_irq_clear'
../../Resources/Targets/Nordic/nRF91/bare/Common/nrfxlib-0.3.0/bsdlib/lib/cortex-m33/soft-float\libbsd_nrf9160_xxaa.a(asn1write.c.o): In function `mbedtls_asn1_store_named_data':
asn1write.c:(.text.mbedtls_asn1_store_named_data+0x10): undefined reference to `mbedtls_asn1_find_named_data'
collect2.exe: error: ld returned 1 exit status

Can someone tell me what I did wrong? It looks to me like the library is missing a dependancy to itself.

Or maybe someone can show me a bare metal example project?

Parents
  • Alright, got some progress. I think...

    I did correctly include the library, but apparently the library needs the functions to be implemented by myself. I found the nrfxlib documentation: http://www.nordicsemiconductors.no/nRF_Connect_SDK/doc/0.3.0/nrfxlib/bsdlib/doc/api.html#os-specific-definitions But even after implementing these functions, I get some 'undefined references' for the libbsd_nrf9160_xxaa.a library:

    make: *** [debug/nRF91.elf] Error 1
    ../../Resources/Targets/Nordic/nRF91/bare/Common/nrfxlib-0.3.0/bsdlib/lib/cortex-m33/soft-float\libbsd_nrf9160_xxaa.a(es256.c.o): In function `es256_key_generate':
    es256.c:(.text.es256_key_generate+0x6e): undefined reference to `occ_ecdsa_p256_public_key'
    ../../Resources/Targets/Nordic/nRF91/bare/Common/nrfxlib-0.3.0/bsdlib/lib/cortex-m33/soft-float\libbsd_nrf9160_xxaa.a(es256.c.o): In function `es256_message_sign':
    es256.c:(.text.es256_message_sign+0x88): undefined reference to `occ_ecdsa_p256_sign'
    ../../Resources/Targets/Nordic/nRF91/bare/Common/nrfxlib-0.3.0/bsdlib/lib/cortex-m33/soft-float\libbsd_nrf9160_xxaa.a(pk.c.o): In function `mbedtls_pk_verify':
    pk.c:(.text.mbedtls_pk_verify+0x2e): undefined reference to `mbedtls_md_info_from_type'
    pk.c:(.text.mbedtls_pk_verify+0x34): undefined reference to `mbedtls_md_get_size'
    ../../Resources/Targets/Nordic/nRF91/bare/Common/nrfxlib-0.3.0/bsdlib/lib/cortex-m33/soft-float\libbsd_nrf9160_xxaa.a(pk.c.o): In function `mbedtls_pk_verify_ext':
    pk.c:(.text.mbedtls_pk_verify_ext+0x56): undefined reference to `mbedtls_md_info_from_type'
    pk.c:(.text.mbedtls_pk_verify_ext+0x5c): undefined reference to `mbedtls_md_get_size'
    ../../Resources/Targets/Nordic/nRF91/bare/Common/nrfxlib-0.3.0/bsdlib/lib/cortex-m33/soft-float\libbsd_nrf9160_xxaa.a(pk.c.o): In function `mbedtls_pk_sign':
    pk.c:(.text.mbedtls_pk_sign+0x3a): undefined reference to `mbedtls_md_info_from_type'
    pk.c:(.text.mbedtls_pk_sign+0x40): undefined reference to `mbedtls_md_get_size'
    ../../Resources/Targets/Nordic/nRF91/bare/Common/nrfxlib-0.3.0/bsdlib/lib/cortex-m33/soft-float\libbsd_nrf9160_xxaa.a(asn1write.c.o): In function `mbedtls_asn1_store_named_data':
    asn1write.c:(.text.mbedtls_asn1_store_named_data+0x10): undefined reference to `mbedtls_asn1_find_named_data'
    collect2.exe: error: ld returned 1 exit status
     Then I thought, maybe it is the other library. I added it, and it worked for some, but now it asks me for mbedtls functions. After some more reading I found out that liboberon_2.0.5.a is a crypto library, and I really doubt I need that.

    It were just a few functions, so I made stubs for them. Now the application compiles without warnings and errors.

    But why does the library require me to add a crypto lib that requires me to use mbedtls? I just want to control the LTE modem in the NRF9160.

    Thank you!

  • Hi Martijn, 

    the bsdlib library creates a socket interface that is used to communicate with the modem. This socket uses mbedTLS to encrypt the data that is passed to the socket. If you are looking for a AT client example for the nRF91, then we have an example here

    Best regards

    Bjørn

  • Thank you for your answer.

    Do I need to encrypt the AT commands???

    I already saw the example, that is what I used to get where I am now. I do not need and want encryption right now. I just want to able to control the LTE modem. Is there any updated documentation about the bsdlib? because the documentation that is available right now, is not helping me enough.

  • Hi Martijn, 

    No, the encryption isnt for the AT commands, but the data that is passed with the AT commands to be sent to the cellular network. I that the documentation we have is the one that is in the nrfxlib repo. I'll ask a colleague that has been working with the nRF Connect SDK if there is anything we can share .

    Best regards

    Bjørn

Reply Children
  • Great! Really appreciate that!

    The main problem is that I have a hard time understanding how the examples are working. It is completely different from what I am used to with the nRF5 SDK and it does nog really fit in our current way of working.

    The library looks like a good solution to interact with the modem, but I cannot really figure out how the examples work. Especially in combination with the Zephyr OS.

  • Hi Martijin, 

    Yes, the nRF Connect SDK is something completely different compared to the nRF5 SDK, incorporating an RTOS adds complexity, but it also gives a lot of advantages. 

    The nRF Connect SDK is still in development so things are being documented as we work towards a production release. Things are being updated on a daily basis, so things should get better with time. 

    I would recommend that you take a look at Nordic's Zephyr fork and its documentation if you want to look more on how Zephyr works.

    As for more examples for the nRF9160, one of my colleagues have made several examples, among them a simple at client, available here on his fork. 

    Best regards

    Bjørn

Related