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
  • Hello,

    Please check what the "info" value is when you get the NRF_FAULT_ID_APP_MEMACC assert.

    This will tell us if the application tried to access a reserved peripheral or not.

  • Thank you for a quick response Vidar, here's the call stack below:

  • The info value suggests that the application tried to directly access the ACL or NVMC peripheral. The Softdevice reserves access to both as you can see from the table here: Hardware peripherals

    But I don't see any direct register access being made to either ACL or the NVMC in the project you uploaded, so I'm not sure exactly where the "violation" happens. 

    Please look up the PC value in the disassembly view to figure out where it points to in your code. 

  • Thank you again Vidar, I find it bizarre myself considering I am calling the thread initialization that in the previous project didnt require the softdevice at all, and BLE is able to use it fine. Here is what you requested first:

    In the code this refers to:

  • 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.

Reply
  • 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.

Children
No Data
Related