SOFTDEVICE: INVALID MEMORY ACCESS when attempting to use Thread SDK.

Hello everyone!

I've been struggling to get over this error when attempting to use an augmented Thread project based on the thread_mqtt_sn_client_publisher example. Would someone be able to look at my Linker file and flash_placement.xml file and see if they can spot what is wrong here? I have tried setting the macros in the linker page on the project to correct values based on online documentation but I either receive the softdevice error, or I get error 4 nrf_error_no_mem.

Note: I see it happens when the function otSysInit  is called via thread_init in thread_utils.c.

Below is my project as a .zip,

The segger project file is in examples\thread\mqttsn_client_publisher\pca10056\blank\ses.

Using Segger v5.60a.

4606.Thread Example.zip

Parents Reply Children
  • I can update by saying ive tried disabling CLOCK and NVMC in configuration and removing where CLOCK was initialised in the code, however this did not affect the issue.

  • Hi,

    It's the OT libraries that try to access the NVMC peripheral after BLE_init() because you have not linked in the Softdevice compatible variants of the libary. 

    Libraries to include:

        <folder Name="OpenThread">
          <file file_name="../../../../../../../external/openthread/lib/nrf52840/gcc/libopenthread-cli-ftd.a" />
          <file file_name="../../../../../../../external/openthread/lib/nrf52840/gcc/libopenthread-ftd.a" />
          <file file_name="../../../../../../../external/openthread/lib/nrf52840/gcc/libopenthread-nrf52840-transport.a" />
          <file file_name="../../../../../../../external/openthread/lib/nrf52840/gcc/libopenthread-platform-utils.a" />
          <file file_name="../../../../../../../external/nrf_security/lib/libmbedcrypto_glue.a" />
          <file file_name="../../../../../../../external/nrf_security/lib/libmbedcrypto_glue_cc310.a" />
          <file file_name="../../../../../../../external/nrf_security/lib/libmbedcrypto_glue_vanilla.a" />
          <file file_name="../../../../../../../external/nrf_security/lib/libmbedcrypto_vanilla_backend.a" />
          <file file_name="../../../../../../../external/nrf_security/lib/libmbedtls_tls_vanilla.a" />
          <file file_name="../../../../../../../external/nrf_security/lib/libmbedtls_x509_vanilla.a" />
          <file file_name="../../../../../../../external/nrf_security/lib/libnrf_cc310_platform_0.9.2.a" />
          <file file_name="../../../../../../../external/openthread/lib/nrf52840/gcc/libopenthread-nrf52840-softdevice-sdk.a" />
          <file file_name="../../../../../../../external/nrf_security/lib/libmbedcrypto_cc310_backend.a" />
          <file file_name="../../../../../../../external/nrf_security/lib/libmbedtls_base_vanilla.a" />
          <file file_name="../../../../../../../external/openthread/lib/nrf52840/gcc/libnordicsemi-nrf52840-radio-driver-softdevice.a" />
          <file file_name="../../../../../../../external/nrf_security/nrf_cc310_plat/src/nrf_cc310_platform_abort_freertos.c" />
          <file file_name="../../../../../../../external/nrf_security/nrf_cc310_plat/src/nrf_cc310_platform_mutex_freertos.c" />
        </folder>

    You should also remove the inclusion of the nRF51 bitfields header in your project sources. It's leading to a lot of warnings.

Related