Trouble viewing hard faults

I'm trying to view core dumps on Memfault's web app, and having trouble doing so. I can't even see hard faults being logged even though I know they're occurring (forcing stack overflow, dereferincing NULL pointer). I was wondering if there's something I've enabled in my prj.conf that's preventing this? My set up is NCS v1.7.0 on a custom board with a nRF9160. Here's my prj.conf

##################
# General config #
##################

CONFIG_APP_VERSION="1.0.10test"
CONFIG_REBOOT=y
# Reboot on Error (Change this to 'n' when debugging lockups etc.)
CONFIG_RESET_ON_FATAL_ERROR=y
CONFIG_ASSERT=n
CONFIG_BT_ASSERT=n
# CJSON
CONFIG_CJSON_LIB=y
# Base 64 library (use to compress thingname)
CONFIG_BASE64=y
# NEWLIB C
CONFIG_NEWLIB_LIBC=y
CONFIG_NEWLIB_LIBC_FLOAT_PRINTF=y
# Date Time library
CONFIG_DATE_TIME=y
CONFIG_DATE_TIME_NTP=y
CONFIG_DATE_TIME_UPDATE_INTERVAL_SECONDS=0
# Thread Debugging
CONFIG_THREAD_NAME=y
CONFIG_THREAD_ANALYZER=n
# Heap and stacks
CONFIG_HEAP_MEM_POOL_SIZE=8192
CONFIG_MAIN_STACK_SIZE=4096
CONFIG_MAIN_THREAD_PRIORITY=0
CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=4096
# MCUBOOT
CONFIG_BOOTLOADER_MCUBOOT=y
CONFIG_MCUBOOT_IMG_MANAGER=y
# Image manager
CONFIG_IMG_MANAGER=y
CONFIG_FLASH=y
CONFIG_IMG_ERASE_PROGRESSIVELY=y
CONFIG_DEVICE_POWER_MANAGEMENT=y
CONFIG_DEBUG=n

# if debugging
# CONFIG_DEBUG_OPTIMIZATIONS=y
# CONFIG_DEBUG_THREAD_INFO=y

###############
# Peripherals #
###############

# Watchdog
CONFIG_WATCHDOG=y
# 15 seconds
CONFIG_WDT_MAX_TIMEOUT_MS=30000
# I2C Config
CONFIG_I2C=y
# PWM
CONFIG_PWM=y
# GPIO
CONFIG_GPIO=y
CONFIG_GPIO_NRFX=y
CONFIG_GPIO_NRF_P0=y

# UART
CONFIG_UART_INTERRUPT_DRIVEN=y

#######################
# Networking over LTE #
#######################

# Network
CONFIG_NETWORKING=y
CONFIG_NET_NATIVE=n
CONFIG_NET_SOCKETS=y
CONFIG_NET_SOCKETS_OFFLOAD=y

# LTE link control
CONFIG_LTE_LINK_CONTROL=y
CONFIG_LTE_LOCK_BANDS=y
CONFIG_LTE_LOCK_BAND_MASK="1000000001000"
CONFIG_LTE_AUTO_INIT_AND_CONNECT=n
CONFIG_LTE_NETWORK_TIMEOUT=600
CONFIG_LTE_NETWORK_MODE_LTE_M=y
CONFIG_LTE_EDRX_REQ=y
CONFIG_LTE_EDRX_REQ_VALUE_LTE_M="0111"
CONFIG_LTE_PTW_VALUE_LTE_M="0100"
CONFIG_LTE_PSM_REQ_RAT="111"
CONFIG_LTE_PSM_REQ_RPTAU="111"

# NRF Modem Library
CONFIG_NRF_MODEM_LIB=y
CONFIG_NRF_MODEM_LIB_SYS_INIT=n
# Certificate Loading
CONFIG_MODEM_KEY_MGMT=y
CONFIG_PROVISION_CERTIFICATES=n
# Modem information
CONFIG_MODEM_INFO=y
CONFIG_NRF_MODEM_LIB_HEAP_SIZE=2048
CONFIG_POSIX_MAX_FDS=8
# needed to run trace collector
CONFIG_NRF_MODEM_LIB_TRACE_ENABLED=n
# AGPS uses SUPL
CONFIG_SUPL_CLIENT_LIB=y

# AWS IoT library
# Access to AWS library
CONFIG_SLATE_AWS_IOT=y
# Name of broker
CONFIG_AWS_IOT_BROKER_HOST_NAME="iot.dev.slatesafety.com"
# Sec tag for IOT Core certificates
CONFIG_AWS_IOT_SEC_TAG=12345678
# subscribe to update delta topic
CONFIG_AWS_IOT_TOPIC_GET_ACCEPTED_SUBSCRIBE=y
CONFIG_AWS_IOT_TOPIC_UPDATE_DELTA_SUBSCRIBE=y
CONFIG_AWS_IOT_AUTO_DEVICE_SHADOW_REQUEST=n
# connect using connection poll
CONFIG_AWS_IOT_CONNECTION_POLL_THREAD=y
# define client id (thingname) at runtime
CONFIG_AWS_IOT_CLIENT_ID_APP=y
CONFIG_AWS_IOT_MQTT_RX_TX_BUFFER_LEN=3000
CONFIG_AWS_IOT_MQTT_PAYLOAD_BUFFER_LEN=3000
CONFIG_AWS_IOT_SEND_TIMEOUT=y
CONFIG_AWS_IOT_SEND_TIMEOUT_SEC=10
CONFIG_AWS_IOT_APP_SUBSCRIPTION_LIST_COUNT=1
# access to AWS Jobs library
CONFIG_AWS_JOBS=n

# not using a persistent connection
CONFIG_MQTT_CLEAN_SESSION=y
# session will be kept alive for 400 seconds
CONFIG_MQTT_KEEPALIVE=400
# application topics device will be posting to
CONFIG_BIOMETRICS_TOPIC_PREFIX="/b"
CONFIG_ALERTS_TOPIC_PREFIX="/a"
CONFIG_GPS_TOPIC_PREFIX="/g"
CONFIG_STATUS_TOPIC_PREFIX="/s"
CONFIG_R2W_TOPIC_PREFIX="/r"

# FOTAs
# access to library
CONFIG_DOWNLOAD_CLIENT=y
CONFIG_DOWNLOAD_CLIENT_STACK_SIZE=4096
# access to DFU library, used once file has been downloaded
CONFIG_DFU_TARGET=y
CONFIG_DFU_TARGET_MCUBOOT=y
CONFIG_DFU_TARGET_MODEM_DELTA=y
# library to easily perform FOTA for nRF9160 and modem
# CONFIG_FOTA_DOWNLOAD=y
# CONFIG_FOTA_DOWNLOAD_PROGRESS_EVT=y
CONFIG_DOWNLOAD_CLIENT_RANGE_REQUESTS=n
CONFIG_DOWNLOAD_CLIENT_MAX_FILENAME_SIZE=1024
CONFIG_DOWNLOAD_CLIENT_MAX_HOSTNAME_SIZE=256
CONFIG_DOWNLOAD_CLIENT_BUF_SIZE=2500

### LWM2M REQUIREMENTS ###
CONFIG_LWM2M_CARRIER=y
CONFIG_LWM2M_CARRIER_CERTIFICATION_MODE=n
# LwM2M carrier is only compiled for hard-float
CONFIG_FPU=y
CONFIG_FP_HARDABI=y
# Disable NB-IoT fallback
CONFIG_LTE_NETWORK_USE_FALLBACK=n
# PDN library
CONFIG_PDN=y
CONFIG_PDN_CONTEXTS_MAX=3
# SMS library
CONFIG_SMS=y

CONFIG_AT_CMD_THREAD_STACK_SIZE=2048
CONFIG_AT_MONITOR=y

#### END NETWORKING ####

#############
# Bluetooth #
#############

# Enable Bluetooth
CONFIG_BT=y
# Used for HCI over UART
CONFIG_BT_H4=y
# Used for initiating connections
# and scanning for advertisements (Beacons)
CONFIG_BT_CENTRAL=y
CONFIG_BT_SCAN=y
CONFIG_BT_SCAN_FILTER_ENABLE=y
CONFIG_BT_SCAN_UUID_CNT=1
# Used for advertising data to gateways
CONFIG_BT_PERIPHERAL=y
CONFIG_BT_EXT_ADV=y
CONFIG_BT_EXT_ADV_MAX_ADV_SET=3
# Used if connecting (might)
CONFIG_BT_GATT_CLIENT=y
CONFIG_BT_GATT_DM=y
# Security
CONFIG_BT_SMP=y
CONFIG_BT_PRIVACY=y
CONFIG_BT_TINYCRYPT_ECC=y
CONFIG_BT_DEBUG_LOG=n
# Increases Data Throughput
CONFIG_BT_BUF_ACL_RX_SIZE=100
CONFIG_BT_BUF_ACL_TX_SIZE=100
CONFIG_BT_L2CAP_TX_MTU=96
CONFIG_BT_USER_DATA_LEN_UPDATE=y
CONFIG_BT_ATT_PREPARE_COUNT=2
CONFIG_BT_USER_PHY_UPDATE=y
# Enable bonding
CONFIG_BT_SETTINGS=y
CONFIG_FLASH=y
CONFIG_FLASH_PAGE_LAYOUT=y
CONFIG_FLASH_MAP=y
CONFIG_NVS=y
CONFIG_SETTINGS=y

############################################
# Cryptography (Used to transmit over BLE) #
############################################
# Enable nordic security backend and PSA APIs
CONFIG_MBEDTLS_LIBRARY_NRF_SECURITY=y
CONFIG_NORDIC_SECURITY_BACKEND=y
CONFIG_MBEDTLS_PSA_CRYPTO_C=y

CONFIG_MBEDTLS_ENABLE_HEAP=y
CONFIG_MBEDTLS_SSL_MAX_CONTENT_LEN=4096
CONFIG_MBEDTLS_HEAP_SIZE=8192

# Enable persistent storage APIs
CONFIG_MBEDTLS_PSA_CRYPTO_STORAGE_C=y
CONFIG_PSA_NATIVE_ITS=y

CONFIG_MBEDTLS_CCM_C=n
CONFIG_MBEDTLS_CHACHA20_C=n
CONFIG_MBEDTLS_POLY1305_C=n
CONFIG_MBEDTLS_SHA1_C=n
CONFIG_MBEDTLS_SHA512_C=n
CONFIG_MBEDTLS_TLS_LIBRARY=n
CONFIG_MBEDTLS_X509_LIBRARY=n
CONFIG_MBEDTLS_DHM_C=n
CONFIG_MBEDTLS_ECP_C=n
CONFIG_MBEDTLS_HMAC_DRBG_C=n
CONFIG_MBEDTLS_ECDSA_DETERMINISTIC=n
CONFIG_MBEDTLS_ECP_DP_SECP256R1_ENABLED=n
CONFIG_MBEDTLS_SSL_CLI_C=n
CONFIG_MBEDTLS_SSL_SRV_C=n
CONFIG_MBEDTLS_RSA_C=n

###########
# Logging #
###########

# Enable Logging
# Segger RTT
# CONFIG_PRINTK=n
CONFIG_LOG_PRINTK=n
# CONFIG_UART_CONSOLE=y
# CONFIG_LOG_BACKEND_UART=y
CONFIG_USE_SEGGER_RTT=y
CONFIG_RTT_CONSOLE=y
CONFIG_UART_CONSOLE=n
CONFIG_LOG_BACKEND_RTT=y
CONFIG_LOG_SPEED=y
CONFIG_LOG_BACKEND_SHOW_COLOR=n

# CONFIG_MAIN_THREAD_PRIORITY=-1


CONFIG_LOG=y
CONFIG_LOG_MODE_IMMEDIATE=y
# BLE
CONFIG_BANDV2_BLE_LOG_LEVEL_DBG=y
# Data
CONFIG_NOTIFICATIONS_LOG_LEVEL_DBG=y
CONFIG_BIOMETRICS_LOG_LEVEL_DBG=y
CONFIG_GNSS_LOG_LEVEL_DBG=y
# LTE
CONFIG_IOT_LOG_LEVEL_DBG=y
# Jobs
CONFIG_JOBS_LOG_LEVEL_DBG=y
# Peripherals
CONFIG_ACCELEROMETER_LOG_LEVEL_DBG=y
CONFIG_BODY_SENSOR_LOG_LEVEL_DBG=y
CONFIG_CLOCK_LOG_LEVEL_DBG=y
CONFIG_EXT_FLASH_STORAGE_LOG_LEVEL_DBG=y
CONFIG_FUEL_GAUGE_LOG_LEVEL_DBG=y
CONFIG_LEDS_LOG_LEVEL_DBG=y
CONFIG_MOTOR_LOG_LEVEL_DBG=y
CONFIG_UART_COMMS_LOG_LEVEL_DBG=y
CONFIG_VALENCELL_LOG_LEVEL_DBG=y
CONFIG_APP_WATCHDOG_LOG_LEVEL_DBG=y
CONFIG_FOTA_LOG_LEVEL_DBG=y
# NCS Modules
CONFIG_DOWNLOAD_CLIENT_LOG_LEVEL_ERR=y
CONFIG_DATE_TIME_LOG_LEVEL_ERR=y
CONFIG_AT_CMD_LOG_LEVEL_ERR=y
CONFIG_SLATE_AWS_IOT_LOG_LEVEL_ERR=y
CONFIG_BT_GATT_DM_LOG_LEVEL_OFF=y
CONFIG_BT_SCAN_LOG_LEVEL_OFF=y
CONFIG_DFU_TARGET_LOG_LEVEL_ERR=y
CONFIG_MPSL_CX_LOG_LEVEL_OFF=y
CONFIG_MPSL_FEM_LOG_LEVEL_OFF=y
CONFIG_MGMT_FMFU_LOG_LEVEL_OFF=y
CONFIG_AGPS_LOG_LEVEL_OFF=y
CONFIG_LWM2M_CARRIER_LOG_LEVEL_OFF=y
CONFIG_NRF_MODEM_LIB_LOG_LEVEL_ERR=y
CONFIG_AT_MONITOR_LOG_LEVEL_OFF=y
CONFIG_LTE_LINK_CONTROL_LOG_LEVEL_INF=y
CONFIG_AT_NOTIF_LOG_LEVEL_OFF=y
CONFIG_PDN_LOG_LEVEL_OFF=y
CONFIG_FATAL_ERROR_LOG_LEVEL_ERR=y
CONFIG_SMS_LOG_LEVEL_OFF=y
CONFIG_MODEM_KEY_MGMT_LOG_LEVEL_INF=y
CONFIG_PSA_EITS_BACKEND_ZEPHYR_LOG_LEVEL_OFF=y
CONFIG_MCUBOOT_UTIL_LOG_LEVEL_OFF=y
CONFIG_SOC_LOG_LEVEL_OFF=y
CONFIG_ARCH_LOG_LEVEL_ERR=y
CONFIG_MPU_LOG_LEVEL_ERR=y
CONFIG_KERNEL_LOG_LEVEL_ERR=y
CONFIG_GPIO_LOG_LEVEL_OFF=y
CONFIG_I2C_LOG_LEVEL_ERR=y
CONFIG_PWM_LOG_LEVEL_ERR=y
CONFIG_WDT_LOG_LEVEL_ERR=y
CONFIG_CLOCK_CONTROL_LOG_LEVEL_OFF=y
CONFIG_BT_LOG_LEVEL_OFF=y
# CONFIG_NVS_LOG_LEVEL_ERR=n
CONFIG_NVS_LOG_LEVEL_OFF=y
CONFIG_NET_BUF_LOG_LEVEL_OFF=y
CONFIG_PM_LOG_LEVEL_ERR=y
CONFIG_IMG_MANAGER_LOG_LEVEL_OFF=y
CONFIG_STREAM_FLASH_LOG_LEVEL_OFF=y
CONFIG_SETTINGS_LOG_LEVEL_OFF=y
# CONFIG_NET_LOG=y
# CONFIG_MQTT_LOG_LEVEL_DBG=y

# Remote Debugging
CONFIG_MEMFAULT=y
CONFIG_MEMFAULT_NCS_PROJECT_KEY="<placeholder>"
CONFIG_MEMFAULT_SHELL=y
CONFIG_MEMFAULT_NRF_SHELL=y
CONFIG_MEMFAULT_NCS_LTE_METRICS=y
CONFIG_MEMFAULT_NCS_DEVICE_ID_IMEI=n
CONFIG_MEMFAULT_NCS_DEVICE_ID_RUNTIME=y
CONFIG_MEMFAULT_NCS_FW_TYPE="cell-fw"
CONFIG_MEMFAULT_NCS_FW_VERSION_STATIC=y
CONFIG_MEMFAULT_NCS_FW_VERSION="1.0.10"
CONFIG_MEMFAULT_NCS_HW_VERSION="Echo"
CONFIG_MEMFAULT_NCS_STACK_METRICS=y
CONFIG_MEMFAULT_NCS_LOG_LEVEL_OFF=y
# CONFIG_MEMFAULT_SOFTWARE_WATCHDOG_TIMEOUT_SECS=30
CONFIG_MEMFAULT_NCS_INTERNAL_FLASH_BACKED_COREDUMP=y
CONFIG_MEMFAULT_COREDUMP_COLLECT_BSS_REGIONS=y
CONFIG_PM_PARTITION_SIZE_MEMFAULT_STORAGE=0x32000
CONFIG_MEMFAULT_HTTP_ENABLE=n
CONFIG_MEMFAULT_NCS_PROVISION_CERTIFICATES=n
CONFIG_SHELL=y

# CONFIG_MEMFAULT_LOGGING_ENABLE=y
# CONFIG_MEMFAULT_LOGGING_RAM_SIZE=2048

  • Hi,

    Is your AWS integrated with Memfault?

    As CONFIG_MEMFAULT_HTTP_ENABLE is disabled, the device will not upload the data directly to Memfault itself, instead you have to forward the data via something else (e.g. as explained here).

    Best regards,

    Didrik

  • Hey Didrik, I should've clarified: I'm having trouble viewing the faults locally. I already have a proxy service forwarding the Memfault chunks that I'm sending over an MQTT connection to the Memfault cloud. I can view trace events and metrics just fine if I upload my symbol file. After I created this ticket yesterday, I did some further digging. I believe that the Memfault fault handler (which wraps around one of the Zephyr ones) was just not getting called because I did not have CONFIG_ASSERT=y as per https://docs.memfault.com/docs/mcu/zephyr-guide#zephyr-__assert Now, the handler is getting called; however, may have some lower level issue. I notice that everything is working fine until here: 

    void __wrap_z_fatal_error(unsigned int reason, const z_arch_esf_t *esf) {
      const struct __extra_esf_info *extra_info = &esf->extra_info;
      const _callee_saved_t *callee_regs = extra_info->callee;
    
      const uint32_t exc_return = extra_info->exc_return;
      const bool msp_was_active = (exc_return & (1 << 3)) == 0;
    
      sMfltRegState reg = {
        .exception_frame = (void *)(msp_was_active ? extra_info->msp : callee_regs->psp),
        .r4 = callee_regs->v1,
        .r5 = callee_regs->v2,
        .r6 = callee_regs->v3,
        .r7 = callee_regs->v4,
        .r8 = callee_regs->v5,
        .r9 = callee_regs->v6,
        .r10 = callee_regs->v7,
        .r11 = callee_regs->v8,
        .exc_return = exc_return ,
      };
      memfault_fault_handler(&reg, kMfltRebootReason_HardFault);
    }

    Specifically, the definition of the struct sMfltRegState reg. Upon further inspection, callee_regs is NULL so dereferencing them triggers another fatal error funnily enough. And since the Memfault handler has taken over, the 9160 is never reset. What I'm curious about is how is callee_regs NULL?

  • I ended up figuring it out. After some help from Memfault support, I got pointed in the right direction

    "Ah, as far as the weird behavior around coredump capture, you've unfortunately run into a bug that's been since fixed in the Memfault SDK. You'll have to update the Memfault SDK module, here's some instructions:
    https://docs.memfault.com/docs/mcu/nrf-connect-sdk-guide/#updating-the-memfault-sdk

    The fix was made in v0.30.1 of the Memfault SDK:
    https://github.com/memfault/memfault-firmware-sdk/blob/36a634536d2cd3c455545f0b97c926275772153c/CHANGES.md#changes-between-memfault-sdk-0301-and-sdk-0300---april-6-2022"

    So if you're having the same issue, follow the steps there.

    Also, another extremely nuanced error that I experienced once I fixed that. The coredump was getting generated and saved successfully to the 9160's internal flash; however, upon reboot, the LWM2M library was exhibiting undefined behavior when connecting to the network (i.e. LWM2M_EVENT_BOOTSTRAPPED then LWM2M_EVENT_DISCONNECTED over and over). I remembered a limitation of the library listed here Requirements and application limitations — nRF Connect SDK 1.7.0 documentation (nordicsemi.com). Specifically,

    "The LwM2M carrier library uses the following NVS record key range: 0xCA00 - 0xCAFF. This range must not be used by the application."

    After looking at partitions.yml and lwm2m_os.c, I could see that the partition generated for the coredump was in the same range as the storage partition listed in my board file, and lwm2m_os.c was using the storage partition for its file system. I'm a little confused as to why LWM2M is using this old partition from the board file, since I was under the impression that those definitions were deprecated in favor of the partition manager. Anyway, sure it's just a remnant of transitioning. Hope this helps someone else.

    Edit: It'd also be nice if you could help me configure this partition file since it is a challenge. I actually discovered that the Settings storage is configured to go over the LWM2M partition as well which could lead to some weird behavior. Here's my dynamic partition file. I already have a static configuration file for my external flash but need a little help altering the primary flash partitions.

    alerts:
      address: 0x2fc000
      device: MX25L3
      end_address: 0x31c000
      placement:
        after:
        - biometrics
      region: external_flash
      size: 0x20000
    app:
      address: 0x1c200
      end_address: 0xee000
      region: flash_primary
      size: 0xd1e00
    biometrics:
      address: 0xfc000
      device: MX25L3
      end_address: 0x2fc000
      placement:
        after:
        - indices
      region: external_flash
      size: 0x200000
    external_flash:
      address: 0x400000
      end_address: 0x400000
      region: external_flash
      size: 0x0
    gps:
      address: 0x31c000
      device: MX25L3
      end_address: 0x350000
      placement:
        after:
        - alerts
      region: external_flash
      size: 0x34000
    indices:
      address: 0xf2000
      device: MX25L3
      end_address: 0xfc000
      placement:
        after:
        - mcuboot_secondary
      region: external_flash
      size: 0xa000
    logging:
      address: 0x3a1000
      device: MX25L3
      end_address: 0x3b0000
      placement:
        after:
        - r2ws
      region: external_flash
      size: 0xf000
    mcuboot:
      address: 0x0
      end_address: 0xc000
      placement:
        before:
        - mcuboot_primary
      region: flash_primary
      size: 0xc000
    mcuboot_pad:
      address: 0xc000
      end_address: 0xc200
      placement:
        before:
        - mcuboot_primary_app
      region: flash_primary
      size: 0x200
    mcuboot_primary:
      address: 0xc000
      end_address: 0xee000
      orig_span: &id001
      - spm
      - app
      - mcuboot_pad
      region: flash_primary
      size: 0xe2000
      span: *id001
    mcuboot_primary_app:
      address: 0xc200
      end_address: 0xee000
      orig_span: &id002
      - app
      - spm
      region: flash_primary
      size: 0xe1e00
      span: *id002
    mcuboot_secondary:
      address: 0x0
      device: MX25L3
      end_address: 0xf2000
      placement:
        align:
          start: 0x0
      region: external_flash
      size: 0xf2000
    memfault_storage:
      address: 0xee000
      align:
        start: 0x1000
      end_address: 0xfe000
      placement:
        before:
        - settings_storage
      region: flash_primary
      size: 0x10000
    nrf_modem_lib_ctrl:
      address: 0x20010000
      end_address: 0x200104e8
      inside:
      - sram_nonsecure
      placement:
        after:
        - spm_sram
        - start
      region: sram_primary
      size: 0x4e8
    nrf_modem_lib_rx:
      address: 0x200124e8
      end_address: 0x200144e8
      inside:
      - sram_nonsecure
      placement:
        after:
        - nrf_modem_lib_tx
      region: sram_primary
      size: 0x2000
    nrf_modem_lib_sram:
      address: 0x20010000
      end_address: 0x200144e8
      orig_span: &id003
      - nrf_modem_lib_ctrl
      - nrf_modem_lib_tx
      - nrf_modem_lib_rx
      region: sram_primary
      size: 0x44e8
      span: *id003
    nrf_modem_lib_tx:
      address: 0x200104e8
      end_address: 0x200124e8
      inside:
      - sram_nonsecure
      placement:
        after:
        - nrf_modem_lib_ctrl
      region: sram_primary
      size: 0x2000
    otp:
      address: 0xff8108
      end_address: 0xff83fc
      region: otp
      size: 0x2f4
    r2ws:
      address: 0x360000
      device: MX25L3
      end_address: 0x3a1000
      placement:
        after:
        - statuses
      region: external_flash
      size: 0x41000
    settings_storage:
      address: 0xfe000
      end_address: 0x100000
      placement:
        before:
        - end
      region: flash_primary
      size: 0x2000
    spm:
      address: 0xc200
      end_address: 0x1c200
      inside:
      - mcuboot_primary_app
      placement:
        before:
        - app
      region: flash_primary
      size: 0x10000
    spm_sram:
      address: 0x20000000
      end_address: 0x20010000
      inside:
      - sram_secure
      placement:
        after:
        - start
      region: sram_primary
      size: 0x10000
    sram_nonsecure:
      address: 0x20010000
      end_address: 0x20040000
      orig_span: &id004
      - sram_primary
      - nrf_modem_lib_ctrl
      - nrf_modem_lib_tx
      - nrf_modem_lib_rx
      region: sram_primary
      size: 0x30000
      span: *id004
    sram_primary:
      address: 0x200144e8
      end_address: 0x20040000
      region: sram_primary
      size: 0x2bb18
    sram_secure:
      address: 0x20000000
      end_address: 0x20010000
      orig_span: &id005
      - spm_sram
      region: sram_primary
      size: 0x10000
      span: *id005
    statuses:
      address: 0x350000
      device: MX25L3
      end_address: 0x360000
      placement:
        after:
        - gps
      region: external_flash
      size: 0x10000
    unused:
      address: 0x3b0000
      device: MX25L3
      end_address: 0x400000
      placement:
        after:
        - logging
      region: external_flash
      size: 0x50000
    

  • Hi, and sorry for the late reply.

    First, it is good to hear that you managed to solve your original problem.

    Your new problem is as you say caused by the carrier_lib not using the Partition Manager. This has been changed in version 0.30.0.

    https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/libraries/bin/lwm2m_carrier/CHANGELOG.html#liblwm2m-carrier-0-30-0

    In the changelog, it is also explained how you can make the Partition Manager partition match the device tree partition:

    To use the legacy NVS partition, you can add a pm_static.yml file to your project with the following content:

    lwm2m_carrier:
      address: 0xfa000
      size: 0x3000
    free:
      address: 0xfd000
      size: 0x3000

    Best regards,

    Didrik

  • I've been having trouble updating devices via FOTAs due to the partitions already in place on those devices. I can probably figure out how to swing this. Is there a way to update the carrier lib without updating the version of NCS that I'm using? Also, I know there's a compatibility matrix for what MFW is approved by various carriers, but is there a compatibility matrix for what version of NCS works with which version of the MFW? It'd be great to upgrade from 1.7.0 to 2.x.x. We got our devices certified by Verizon on MFW v1.3.0

Related