Build error during Modem Trace collection - nrf9160

Hello DevZone community,

For this ticket - devzone.nordicsemi.com/.../error-code-4-returned-by-lte_lc_conn_eval_params_get-function-after-12-hours

I have been trying to add modem trace CONFIG_NRF_MODEM_LIB_TRACE_ENABLED=y in my prj.conf configuration.
I am following this URL for the same.
infocenter.nordicsemi.com/.../collect_modem_trace.html

However, I'm encountering an error dduring build.

My Environment

NCS - SDK 1.9.1
Device - nrf9160 customized one

prj.conf

CONFIG_TRUSTED_EXECUTION_NONSECURE=y

# General config
CONFIG_REBOOT=y
CONFIG_RING_BUFFER=y

# LOGGNG
CONFIG_LOG=n
CONFIG_CBPRINTF_FP_SUPPORT=y

# Console
CONFIG_PRINTK=y
CONFIG_UART_CONSOLE=n
CONFIG_SHELL=y
CONFIG_KERNEL_SHELL=y
CONFIG_DEVICE_SHELL=y
CONFIG_POSIX_CLOCK=y
CONFIG_DATE_SHELL=y
CONFIG_SHELL_STACK_SIZE=1536
CONFIG_SHELL_BACKEND_SERIAL=n

CONFIG_THREAD_MONITOR=y
CONFIG_INIT_STACKS=y
CONFIG_BOOT_BANNER=n
CONFIG_THREAD_NAME=y

#enable RTT shell
CONFIG_USE_SEGGER_RTT=y
CONFIG_SHELL_BACKEND_RTT=y
CONFIG_SEGGER_RTT_BUFFER_SIZE_DOWN=32

# UART
CONFIG_UART_ASYNC_API=y

# Modem library
CONFIG_NRF_MODEM_LIB=y
CONFIG_MODEM_INFO=y

CONFIG_MODEM_KEY_MGMT=y
CONFIG_DOWNLOAD_CLIENT=y

CONFIG_NEWLIB_LIBC=y
CONFIG_NEWLIB_LIBC_NANO=n

# LTE link control
CONFIG_LTE_LINK_CONTROL=y
CONFIG_LTE_NETWORK_MODE_LTE_M=y
CONFIG_LTE_AUTO_INIT_AND_CONNECT=n
CONFIG_LTE_LOCK_BANDS=y
CONFIG_LTE_LOCK_BAND_MASK="0000000001000000000000000001"

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

# PDN library
CONFIG_PDN=y
CONFIG_PDN_SYS_INIT=n
CONFIG_PDN_DEFAULTS_OVERRIDE=y
CONFIG_PDN_DEFAULT_APN="iijmobile.biz"
CONFIG_PDN_DEFAULT_FAM_IPV4=y
CONFIG_PDN_DEFAULT_AUTH_CHAP=y
CONFIG_PDN_DEFAULT_USERNAME="mobile@iij"
CONFIG_PDN_DEFAULT_PASSWORD="iij"


# Stacks and heaps
CONFIG_HEAP_MEM_POOL_SIZE=33792

# for debug
CONFIG_DEBUG_THREAD_INFO=y

CONFIG_OPENOCD_SUPPORT=y
CONFIG_MAIN_STACK_SIZE=8192
CONFIG_PRIVILEGED_STACK_SIZE=1024
CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=4096

# Flash
CONFIG_SPI=y
CONFIG_FLASH=y

# I2C
CONFIG_I2C_NRFX=y
CONFIG_I2C=y

#IMU
CONFIG_SENSOR=y
CONFIG_ICM42605=y
CONFIG_ICM42605_TRIGGER_NONE=y

# json
CONFIG_JSON_LIBRARY=y

# float
CONFIG_NEWLIB_LIBC_FLOAT_PRINTF=y

# for Zmod library
CONFIG_FPU=y
CONFIG_FPU_SHARING=y
CONFIG_FP_HARDABI=y

CONFIG_CPU_LOAD=y
CONFIG_DATE_TIME=y
CONFIG_CJSON_LIB=y

# appication fota update configuration
CONFIG_FOTA_DOWNLOAD=y
CONFIG_FOTA_SOCKET_RETRIES=5
CONFIG_FOTA_DOWNLOAD_PROGRESS_EVT=y

#DFU 
CONFIG_DFU_TARGET=y

# MCUBOOT
CONFIG_BOOTLOADER_MCUBOOT=y
CONFIG_MCUBOOT_IMG_MANAGER=y

# Image manager
CONFIG_IMG_MANAGER=y
CONFIG_IMG_ERASE_PROGRESSIVELY=y

# Download client
CONFIG_DOWNLOAD_CLIENT_STACK_SIZE=4096
CONFIG_DOWNLOAD_CLIENT_BUF_SIZE=2048
CONFIG_DOWNLOAD_CLIENT_HTTP_FRAG_SIZE_1024=y
CONFIG_DOWNLOAD_CLIENT_RANGE_REQUESTS=n
CONFIG_DOWNLOAD_CLIENT_LOG_LEVEL_DBG=n
CONFIG_DOWNLOAD_CLIENT_LOG_HEADERS=n
CONFIG_DOWNLOAD_CLIENT_TCP_SOCK_TIMEO_MS=600000 

# DFU Target
CONFIG_DFU_TARGET_STREAM=y
CONFIG_DFU_TARGET_FULL_MODEM=y

# Full modem firmware from external flash support
CONFIG_FMFU_FDEV=y
CONFIG_CDDL_GEN=y

#SPI NOR
CONFIG_SPI_NOR=y

#Stream flash
CONFIG_STREAM_FLASH=y
CONFIG_STREAM_FLASH_ERASE=y

#libmodem
CONFIG_NRF_MODEM_LIB_SYS_INIT=n

#Prevalidation is not yet supported by the modem firmware, so skip it for now.
CONFIG_FMFU_FDEV_SKIP_PREVALIDATION=n

CONFIG_NO_OPTIMIZATIONS=y
CONFIG_EXTRA_EXCEPTION_INFO=y
CONFIG_NCS_SAMPLES_DEFAULTS=n

# Crypto
CONFIG_OBERON_BACKEND=y
CONFIG_NORDIC_SECURITY_BACKEND=y
# Disable all non-used crypto
CONFIG_NRF_SECURITY_RNG=n
CONFIG_MBEDTLS_AES_C=n
CONFIG_MBEDTLS_CHACHA20_C=n
CONFIG_MBEDTLS_POLY1305_C=n
CONFIG_MBEDTLS_ECP_C=n
CONFIG_MBEDTLS_RSA_C=n
CONFIG_MBEDTLS_DHM_C=n
CONFIG_MBEDTLS_SHA1_C=n
CONFIG_MBEDTLS_SHA384_C=n
CONFIG_MBEDTLS_SHA512_C=n
CONFIG_MBEDTLS_GCM_C=n
# This is the one we need
CONFIG_MBEDTLS_SHA256_C=y

CONFIG_NRF_MODEM_LIB_TRACE_ENABLED=y

I am getting below build error.

-- Generating done
-- Build files have been written to: C:/Users/ift_praveen/Desktop/IM-830/WORK2.5/dev_lpwa/im830/build/mcuboot
=== child image mcuboot -  end ===

CMake Warning at C:/Users/ift_praveen/ncs/v1.9.1/nrf/modules/mcuboot/CMakeLists.txt:262 (message):
  

        ---------------------------------------------------------
        --- WARNING: Using default MCUBoot key, it should not ---
        --- be used for production.                           ---
        ---------------------------------------------------------
        



CMake Warning at C:/Users/ift_praveen/ncs/v1.9.1/zephyr/CMakeLists.txt:764 (message):
  No SOURCES given to Zephyr library:
  ..__..__..__Desktop__IM-830__WORK2.5__dev_lpwa__im830__boards__arm__im830_nrf9160


  Excluding target from build.


CMake Warning at C:/Users/ift_praveen/ncs/v1.9.1/zephyr/CMakeLists.txt:764 (message):
  No SOURCES given to Zephyr library: subsys__net__pkt_filter

  Excluding target from build.


-- Found partition manager static configuration: C:/Users/ift_praveen/Desktop/IM-830/WORK2.5/dev_lpwa/im830/pm_static.yml
Partition 'mcuboot' is not included in the dynamic resolving since it is statically defined.
Partition 'mcuboot_pad' is not included in the dynamic resolving since it is statically defined.
Partition 'mcuboot_primary' is not included in the dynamic resolving since it is statically defined.
Partition 'mcuboot_primary_app' is not included in the dynamic resolving since it is statically defined.
Partition 'mcuboot_secondary' is not included in the dynamic resolving since it is statically defined.
Partition 'nrf_modem_lib_ctrl' is not included in the dynamic resolving since it is statically defined.
Partition 'nrf_modem_lib_rx' is not included in the dynamic resolving since it is statically defined.
Partition 'nrf_modem_lib_sram' is not included in the dynamic resolving since it is statically defined.
Partition 'nrf_modem_lib_tx' is not included in the dynamic resolving since it is statically defined.
Partition 'spm' is not included in the dynamic resolving since it is statically defined.
Partition 'spm_sram' is not included in the dynamic resolving since it is statically defined.
Partition 'sram_nonsecure' is not included in the dynamic resolving since it is statically defined.
Partition 'sram_secure' is not included in the dynamic resolving since it is statically defined.
Partition manager failed: End of last partition is after last valid address
Failed to partition region sram_primary, size of region: 262144
Partition Configuration:
nrf_modem_lib_ctrl:
  placement:
    after:
    - spm_sram
    - start
  size: 1256
nrf_modem_lib_rx:
  placement:
    after:
    - nrf_modem_lib_tx
  size: 8192
nrf_modem_lib_sram:
  size: 17640
nrf_modem_lib_trace:
  placement: {}
  size: 16384
nrf_modem_lib_tx:
  placement:
    after:
    - nrf_modem_lib_ctrl
  size: 8192
spm_sram:
  placement:
    after:
    - start
  size: 32768
sram_nonsecure:
  size: 229376
sram_primary:
  size: 211736
sram_secure:
  size: 32768

CMake Error at C:/Users/ift_praveen/ncs/v1.9.1/nrf/cmake/partition_manager.cmake:274 (message):
  Partition Manager failed, aborting.  Command:
  C:/Users/ift_praveen/ncs/v1.9.1/toolchain/opt/bin/python.exe;C:/Users/ift_praveen/ncs/v1.9.1/nrf/scripts/partition_manager.py;--input-files;C:/Users/ift_praveen/Desktop/IM-830/WORK2.5/dev_lpwa/im830/build/spm/zephyr/include/generated/pm.yml;C:/Users/ift_praveen/Desktop/IM-830/WORK2.5/dev_lpwa/im830/build/spm/modules/nrf/subsys/partition_manager/pm.yml.trustzone;C:/Users/ift_praveen/Desktop/IM-830/WORK2.5/dev_lpwa/im830/build/mcuboot/zephyr/include/generated/pm.yml;C:/Users/ift_praveen/Desktop/IM-830/WORK2.5/dev_lpwa/im830/build/zephyr/include/generated/pm.yml;C:/Users/ift_praveen/Desktop/IM-830/WORK2.5/dev_lpwa/im830/build/modules/nrf/subsys/partition_manager/pm.yml.libmodem;C:/Users/ift_praveen/Desktop/IM-830/WORK2.5/dev_lpwa/im830/build/modules/nrf/subsys/partition_manager/pm.yml.trustzone;--regions;sram_primary;otp;flash_primary;--output-partitions;C:/Users/ift_praveen/Desktop/IM-830/WORK2.5/dev_lpwa/im830/build/partitions.yml;--output-regions;C:/Users/ift_praveen/Desktop/IM-830/WORK2.5/dev_lpwa/im830/build/regions.yml;--static-config;C:/Users/ift_praveen/Desktop/IM-830/WORK2.5/dev_lpwa/im830/pm_static.yml;--sram_primary-size;0x40000;--sram_primary-base-address;0x20000000;--sram_primary-placement-strategy;complex;--sram_primary-dynamic-partition;sram_primary;--otp-size;756;--otp-base-address;0xff8108;--otp-placement-strategy;start_to_end;--flash_primary-size;0x100000;--flash_primary-base-address;0x0;--flash_primary-placement-strategy;complex;--flash_primary-device;NRF_FLASH_DRV_NAME
Call Stack (most recent call first):
  C:/Users/ift_praveen/ncs/v1.9.1/zephyr/cmake/app/boilerplate.cmake:678 (include)
  C:/Users/ift_praveen/ncs/v1.9.1/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:24 (include)
  C:/Users/ift_praveen/ncs/v1.9.1/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:40 (include_boilerplate)
  CMakeLists.txt:5 (find_package)


-- Configuring incomplete, errors occurred!
See also "C:/Users/ift_praveen/Desktop/IM-830/WORK2.5/dev_lpwa/im830/build/CMakeFiles/CMakeOutput.log".
See also "C:/Users/ift_praveen/Desktop/IM-830/WORK2.5/dev_lpwa/im830/build/CMakeFiles/CMakeError.log".
ninja: error: rebuilding 'build.ninja': subcommand failed
FAILED: build.ninja 
                                                                                                           

I'm seeking assistance in understanding the possible causes of this error and any recommended solutions or workarounds to resolve it.
Any insights or experiences shared would be greatly appreciated.

Thank you in advance for your help!

Best Regards

Praveen Deshmane

  • Hi,

    Are you using a pm_static.yml file?

    If so, could you share it?

    Best regards,

    Didrik

  • Hello Didrik,

    Thank you for your reply and time.

    Here it is the pm_static.yml file

    EMPTY_0:
      address: 0xc000
      end_address: 0x10000
      placement:
        before:
        - mcuboot_pad
      region: flash_primary
      size: 0x4000
    app:
      address: 0x20200
      end_address: 0x88000
      region: flash_primary
      size: 0x67e00
    mcuboot:
      address: 0x0
      end_address: 0xc000
      placement:
        before:
        - mcuboot_primary
      region: flash_primary
      size: 0xc000
    mcuboot_pad:
      address: 0x10000
      end_address: 0x10200
      placement:
        align:
          start: 0x8000
        before:
        - mcuboot_primary_app
      region: flash_primary
      size: 0x200
    mcuboot_primary:
      address: 0x10000
      end_address: 0x88000
      orig_span: &id001
      - spm
      - app
      - mcuboot_pad
      region: flash_primary
      sharers: 0x1
      size: 0x78000
      span: *id001
    mcuboot_primary_app:
      address: 0x10200
      end_address: 0x88000
      orig_span: &id002
      - app
      - spm
      region: flash_primary
      size: 0x77e00
      span: *id002
    mcuboot_secondary:
      address: 0x88000
      end_address: 0x100000
      placement:
        after:
        - mcuboot_primary
        align:
          start: 0x8000
        align_next: 0x8000
      region: flash_primary
      share_size:
      - mcuboot_primary
      size: 0x78000
    nrf_modem_lib_ctrl:
      address: 0x20008000
      end_address: 0x200084e8
      inside:
      - sram_nonsecure
      placement:
        after:
        - spm_sram
        - start
      region: sram_primary
      size: 0x4e8
    nrf_modem_lib_rx:
      address: 0x2000a4e8
      end_address: 0x2000c4e8
      inside:
      - sram_nonsecure
      placement:
        after:
        - nrf_modem_lib_tx
      region: sram_primary
      size: 0x2000
    nrf_modem_lib_sram:
      address: 0x20008000
      end_address: 0x2000c4e8
      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: 0x200084e8
      end_address: 0x2000a4e8
      inside:
      - sram_nonsecure
      placement:
        after:
        - nrf_modem_lib_ctrl
      region: sram_primary
      size: 0x2000
    otp:
      address: 0xff8108
      end_address: 0xff83fc
      region: otp
      size: 0x2f4
    spm:
      address: 0x10200
      end_address: 0x20200
      inside:
      - mcuboot_primary_app
      placement:
        before:
        - app
      region: flash_primary
      size: 0x10000
    spm_sram:
      address: 0x20000000
      end_address: 0x20008000
      inside:
      - sram_secure
      placement:
        after:
        - start
      region: sram_primary
      size: 0x8000
    sram_nonsecure:
      address: 0x20008000
      end_address: 0x20040000
      orig_span: &id004
      - sram_primary
      - nrf_modem_lib_ctrl
      - nrf_modem_lib_tx
      - nrf_modem_lib_rx
      region: sram_primary
      size: 0x38000
      span: *id004
    sram_primary:
      address: 0x2000c4e8
      end_address: 0x20040000
      region: sram_primary
      size: 0x33b18
    sram_secure:
      address: 0x20000000
      end_address: 0x20008000
      orig_span: &id005
      - spm_sram
      region: sram_primary
      size: 0x8000
      span: *id005
    


    Please check it and help me out.

    Thank you.

    Best Regards

    Praveen Deshmane

  • Thanks.

    I was able to reproduce your build error using the hello_world sample with your prj.conf and pm_static.yml.

    I am able to build the project if I remove the RAM partitions from the pm_static.yml. As these partitions are not used during firmware upgrades, you do not need them in the pm_static.yml file.

    This is the pm_static.yml file I was left with:

    EMPTY_0:
      address: 0xc000
      end_address: 0x10000
      placement:
        before:
        - mcuboot_pad
      region: flash_primary
      size: 0x4000
    app:
      address: 0x20200
      end_address: 0x88000
      region: flash_primary
      size: 0x67e00
    mcuboot:
      address: 0x0
      end_address: 0xc000
      placement:
        before:
        - mcuboot_primary
      region: flash_primary
      size: 0xc000
    mcuboot_pad:
      address: 0x10000
      end_address: 0x10200
      placement:
        align:
          start: 0x8000
        before:
        - mcuboot_primary_app
      region: flash_primary
      size: 0x200
    mcuboot_primary:
      address: 0x10000
      end_address: 0x88000
      orig_span: &id001
      - spm
      - app
      - mcuboot_pad
      region: flash_primary
      sharers: 0x1
      size: 0x78000
      span: *id001
    mcuboot_primary_app:
      address: 0x10200
      end_address: 0x88000
      orig_span: &id002
      - app
      - spm
      region: flash_primary
      size: 0x77e00
      span: *id002
    mcuboot_secondary:
      address: 0x88000
      end_address: 0x100000
      placement:
        after:
        - mcuboot_primary
        align:
          start: 0x8000
        align_next: 0x8000
      region: flash_primary
      share_size:
      - mcuboot_primary
      size: 0x78000
    otp:
      address: 0xff8108
      end_address: 0xff83fc
      region: otp
      size: 0x2f4
    spm:
      address: 0x10200
      end_address: 0x20200
      inside:
      - mcuboot_primary_app
      placement:
        before:
        - app
      region: flash_primary
      size: 0x10000

  • Hello Didrik,

    Thank you for your reply.

    As you suggested, I removed the RAM partitions from the pm_static.yml and tried to build. 
    I encountered with another build error.

    [311/375] Building C object zephyr/drivers/flash/CMakeFiles/drivers__flash.dir/flash_page_layout.c.obj
    [312/375] Linking C static library zephyr\drivers\spi\libdrivers__spi.a
    [313/375] Building C object zephyr/drivers/flash/CMakeFiles/drivers__flash.dir/spi_nor.c.obj
    [314/375] Building C object zephyr/drivers/flash/CMakeFiles/drivers__flash.dir/jesd216.c.obj
    [315/375] Building C object zephyr/drivers/flash/CMakeFiles/drivers__flash.dir/soc_flash_nrf.c.obj
    [316/375] Building C object zephyr/drivers/entropy/CMakeFiles/drivers__entropy.dir/C_/Users/ift_praveen/ncs/v1.9.1/nrf/drivers/entropy/entropy_cc310.c.obj
    [317/375] Building C object modules/nrf/lib/nrf_modem_lib/CMakeFiles/..__nrf__lib__nrf_modem_lib.dir/errno_sanity.c.obj
    [318/375] Building C object modules/nrf/lib/nrf_modem_lib/CMakeFiles/..__nrf__lib__nrf_modem_lib.dir/nrf_modem_lib.c.obj
    [319/375] Building C object zephyr/drivers/timer/CMakeFiles/drivers__timer.dir/sys_clock_init.c.obj
    [320/375] Building C object zephyr/drivers/timer/CMakeFiles/drivers__timer.dir/nrf_rtc_timer.c.obj
    [321/375] Building C object zephyr/drivers/serial/CMakeFiles/drivers__serial.dir/uart_nrfx_uarte.c.obj
    [322/375] Building C object modules/nrf/lib/nrf_modem_lib/CMakeFiles/..__nrf__lib__nrf_modem_lib.dir/nrf_modem_lib_trace.c.obj
    FAILED: modules/nrf/lib/nrf_modem_lib/CMakeFiles/..__nrf__lib__nrf_modem_lib.dir/nrf_modem_lib_trace.c.obj 
    C:\Users\ift_praveen\ncs\v1.9.1\toolchain\opt\bin\arm-none-eabi-gcc.exe -DAPP_VERSION=v1.9.1 -DBUILD_VERSION=v2.7.99-ncs1-1 -DCDDL_CBOR_CANONICAL -DEXT_API_MAGIC=0x281ee6de,0xb845acea,23298 -DFIRMWARE_INFO_MAGIC=0x281ee6de,0x8fcebb4c,23298 -DKERNEL -DMBEDTLS_CONFIG_FILE=\"nrf-config.h\" -DMBEDTLS_USER_CONFIG_FILE=\"nrf-config-user.h\" -DNRF9160_XXAA -DNRF_SKIP_FICR_NS_COPY_TO_RAM -DNRF_TRUSTZONE_NONSECURE -DUSE_PARTITION_MANAGER=1 -D_FORTIFY_SOURCE=2 -D__LINUX_ERRNO_EXTENSIONS__ -D__PROGRAM_START -D__ZEPHYR__=1 -Dfmfu_fdev -IC:/Users/ift_praveen/ncs/v1.9.1/zephyr/include -Izephyr/include/generated -IC:/Users/ift_praveen/ncs/v1.9.1/zephyr/soc/arm/nordic_nrf/nrf91 -IC:/Users/ift_praveen/ncs/v1.9.1/zephyr/lib/libc/newlib/include -IC:/Users/ift_praveen/ncs/v1.9.1/zephyr/lib/util/fnmatch/. -IC:/Users/ift_praveen/ncs/v1.9.1/zephyr/soc/arm/nordic_nrf/common/. -IC:/Users/ift_praveen/ncs/v1.9.1/zephyr/subsys/net/lib/sockets/. -IC:/Users/ift_praveen/ncs/v1.9.1/nrf/include -IC:/Users/ift_praveen/ncs/v1.9.1/nrf/lib/at_cmd_parser/include -IC:/Users/ift_praveen/ncs/v1.9.1/nrf/subsys/dfu/fmfu_fdev/include -IC:/Users/ift_praveen/ncs/v1.9.1/modules/lib/cjson -IC:/Users/ift_praveen/ncs/v1.9.1/nrf/modules/cjson/include -IC:/Users/ift_praveen/ncs/v1.9.1/modules/lib/cddl-gen/include -IC:/Users/ift_praveen/ncs/v1.9.1/modules/hal/cmsis/CMSIS/Core/Include -IC:/Users/ift_praveen/ncs/v1.9.1/modules/hal/nordic/nrfx -IC:/Users/ift_praveen/ncs/v1.9.1/modules/hal/nordic/nrfx/drivers/include -IC:/Users/ift_praveen/ncs/v1.9.1/modules/hal/nordic/nrfx/mdk -IC:/Users/ift_praveen/ncs/v1.9.1/zephyr/modules/hal_nordic/nrfx/. -IC:/Users/ift_praveen/ncs/v1.9.1/modules/debug/segger/SEGGER -IC:/Users/ift_praveen/ncs/v1.9.1/modules/debug/segger/Config -IC:/Users/ift_praveen/ncs/v1.9.1/zephyr/modules/segger/. -IC:/Users/ift_praveen/ncs/v1.9.1/nrfxlib/nrf_modem/include -Imodules/nrfxlib/nrfxlib/nrf_security/src/include/generated -IC:/Users/ift_praveen/ncs/v1.9.1/nrfxlib/nrf_security/include -IC:/Users/ift_praveen/ncs/v1.9.1/nrfxlib/nrf_security/include/mbedtls -IC:/Users/ift_praveen/ncs/v1.9.1/nrfxlib/nrf_security/include/psa -Ic:/Users/ift_praveen/ncs/v1.9.1/mbedtls/include -Ic:/Users/ift_praveen/ncs/v1.9.1/mbedtls/include/mbedtls -Ic:/Users/ift_praveen/ncs/v1.9.1/mbedtls/include/psa -Ic:/Users/ift_praveen/ncs/v1.9.1/mbedtls/library -IC:/Users/ift_praveen/ncs/v1.9.1/nrfxlib/nrf_security/../crypto/nrf_oberon/include -IC:/Users/ift_praveen/ncs/v1.9.1/nrfxlib/nrf_security/../crypto/nrf_oberon/include/mbedtls -IC:/Users/ift_praveen/ncs/v1.9.1/nrfxlib/nrf_security/../crypto/nrf_oberon/include/psa -IC:/Users/ift_praveen/ncs/v1.9.1/nrfxlib/crypto/nrf_oberon/include/mbedtls -IC:/Users/ift_praveen/ncs/v1.9.1/nrfxlib/crypto/nrf_oberon/include -Og -imacros C:/Users/ift_praveen/Desktop/IM-830/WORK2.5/im830/build/zephyr/include/generated/autoconf.h -ffreestanding -fno-common -g -gdwarf-4 -fdiagnostics-color=always -mcpu=cortex-m33 -mthumb -mabi=aapcs -mfpu=fpv5-sp-d16 -mfloat-abi=hard -mfp16-format=ieee -imacros C:/Users/ift_praveen/ncs/v1.9.1/zephyr/include/toolchain/zephyr_stdint.h -Wall -Wformat -Wformat-security -Wno-format-zero-length -Wno-main -Wno-pointer-sign -Wpointer-arith -Wexpansion-to-defined -Wno-unused-but-set-variable -Werror=implicit-int -fno-asynchronous-unwind-tables -fno-pie -fno-pic -fno-strict-overflow -fno-reorder-functions -fno-defer-pop -fmacro-prefix-map=C:/Users/ift_praveen/Desktop/IM-830/WORK2.5/im830=CMAKE_SOURCE_DIR -fmacro-prefix-map=C:/Users/ift_praveen/ncs/v1.9.1/zephyr=ZEPHYR_BASE -fmacro-prefix-map=C:/Users/ift_praveen/ncs/v1.9.1=WEST_TOPDIR -ffunction-sections -fdata-sections -std=c99 -MD -MT modules/nrf/lib/nrf_modem_lib/CMakeFiles/..__nrf__lib__nrf_modem_lib.dir/nrf_modem_lib_trace.c.obj -MF modules\nrf\lib\nrf_modem_lib\CMakeFiles\..__nrf__lib__nrf_modem_lib.dir\nrf_modem_lib_trace.c.obj.d -o modules/nrf/lib/nrf_modem_lib/CMakeFiles/..__nrf__lib__nrf_modem_lib.dir/nrf_modem_lib_trace.c.obj -c C:/Users/ift_praveen/ncs/v1.9.1/nrf/lib/nrf_modem_lib/nrf_modem_lib_trace.c
    In file included from C:\Users\ift_praveen\ncs\v1.9.1\zephyr\include\arch\arm\aarch32\arch.h:20,
                     from C:\Users\ift_praveen\ncs\v1.9.1\zephyr\include\arch\cpu.h:19,
                     from C:\Users\ift_praveen\ncs\v1.9.1\zephyr\include\kernel_includes.h:33,
                     from C:\Users\ift_praveen\ncs\v1.9.1\zephyr\include\kernel.h:17,
                     from C:\Users\ift_praveen\ncs\v1.9.1\nrf\lib\nrf_modem_lib\nrf_modem_lib_trace.c:8:
    C:/Users/ift_praveen/ncs/v1.9.1/nrf/lib/nrf_modem_lib/nrf_modem_lib_trace.c: In function 'uart_init':
    c:\Users\ift_praveen\Desktop\IM-830\WORK2.5\im830\build\zephyr\include\generated\devicetree_unfixed.h:5158:38: error: 'DT_N_S_soc_S_peripheral_40000000_S_uart_9000_P_tx_pin' undeclared (first use in this function); did you mean 'DT_N_S_soc_S_peripheral_40000000_S_uart_8000_P_tx_pin'?
     5158 | #define DT_N_NODELABEL_uart1         DT_N_S_soc_S_peripheral_40000000_S_uart_9000
          |                                      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    C:\Users\ift_praveen\ncs\v1.9.1\zephyr\include\devicetree.h:3022:24: note: in definition of macro 'DT_CAT'
     3022 | #define DT_CAT(a1, a2) a1 ## a2
          |                        ^~
    C:\Users\ift_praveen\ncs\v1.9.1\nrf\lib\nrf_modem_lib\nrf_modem_lib_trace.c:34:14: note: in expansion of macro 'DT_PROP'
       34 |   .pseltxd = DT_PROP(DT_NODELABEL(uart1), tx_pin),
          |              ^~~~~~~
    C:\Users\ift_praveen\ncs\v1.9.1\zephyr\include\devicetree.h:3022:24: note: in expansion of macro 'DT_N_NODELABEL_uart1'
     3022 | #define DT_CAT(a1, a2) a1 ## a2
          |                        ^~
    C:\Users\ift_praveen\ncs\v1.9.1\zephyr\include\devicetree.h:177:29: note: in expansion of macro 'DT_CAT'
      177 | #define DT_NODELABEL(label) DT_CAT(DT_N_NODELABEL_, label)
          |                             ^~~~~~
    C:\Users\ift_praveen\ncs\v1.9.1\nrf\lib\nrf_modem_lib\nrf_modem_lib_trace.c:34:22: note: in expansion of macro 'DT_NODELABEL'
       34 |   .pseltxd = DT_PROP(DT_NODELABEL(uart1), tx_pin),
          |                      ^~~~~~~~~~~~
    c:\Users\ift_praveen\Desktop\IM-830\WORK2.5\im830\build\zephyr\include\generated\devicetree_unfixed.h:5158:38: note: each undeclared identifier is reported only once for each function it appears in
     5158 | #define DT_N_NODELABEL_uart1         DT_N_S_soc_S_peripheral_40000000_S_uart_9000
          |                                      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    C:\Users\ift_praveen\ncs\v1.9.1\zephyr\include\devicetree.h:3022:24: note: in definition of macro 'DT_CAT'
     3022 | #define DT_CAT(a1, a2) a1 ## a2
          |                        ^~
    C:\Users\ift_praveen\ncs\v1.9.1\nrf\lib\nrf_modem_lib\nrf_modem_lib_trace.c:34:14: note: in expansion of macro 'DT_PROP'
       34 |   .pseltxd = DT_PROP(DT_NODELABEL(uart1), tx_pin),
          |              ^~~~~~~
    C:\Users\ift_praveen\ncs\v1.9.1\zephyr\include\devicetree.h:3022:24: note: in expansion of macro 'DT_N_NODELABEL_uart1'
     3022 | #define DT_CAT(a1, a2) a1 ## a2
          |                        ^~
    C:\Users\ift_praveen\ncs\v1.9.1\zephyr\include\devicetree.h:177:29: note: in expansion of macro 'DT_CAT'
      177 | #define DT_NODELABEL(label) DT_CAT(DT_N_NODELABEL_, label)
          |                             ^~~~~~
    C:\Users\ift_praveen\ncs\v1.9.1\nrf\lib\nrf_modem_lib\nrf_modem_lib_trace.c:34:22: note: in expansion of macro 'DT_NODELABEL'
       34 |   .pseltxd = DT_PROP(DT_NODELABEL(uart1), tx_pin),
          |                      ^~~~~~~~~~~~
    c:\Users\ift_praveen\Desktop\IM-830\WORK2.5\im830\build\zephyr\include\generated\devicetree_unfixed.h:5158:38: error: 'DT_N_S_soc_S_peripheral_40000000_S_uart_9000_P_rx_pin' undeclared (first use in this function); did you mean 'DT_N_S_soc_S_peripheral_40000000_S_uart_8000_P_rx_pin'?
     5158 | #define DT_N_NODELABEL_uart1         DT_N_S_soc_S_peripheral_40000000_S_uart_9000
          |                                      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    C:\Users\ift_praveen\ncs\v1.9.1\zephyr\include\devicetree.h:3022:24: note: in definition of macro 'DT_CAT'
     3022 | #define DT_CAT(a1, a2) a1 ## a2
          |                        ^~
    C:\Users\ift_praveen\ncs\v1.9.1\nrf\lib\nrf_modem_lib\nrf_modem_lib_trace.c:35:14: note: in expansion of macro 'DT_PROP'
       35 |   .pselrxd = DT_PROP(DT_NODELABEL(uart1), rx_pin),
          |              ^~~~~~~
    C:\Users\ift_praveen\ncs\v1.9.1\zephyr\include\devicetree.h:3022:24: note: in expansion of macro 'DT_N_NODELABEL_uart1'
     3022 | #define DT_CAT(a1, a2) a1 ## a2
          |                        ^~
    C:\Users\ift_praveen\ncs\v1.9.1\zephyr\include\devicetree.h:177:29: note: in expansion of macro 'DT_CAT'
      177 | #define DT_NODELABEL(label) DT_CAT(DT_N_NODELABEL_, label)
          |                             ^~~~~~
    C:\Users\ift_praveen\ncs\v1.9.1\nrf\lib\nrf_modem_lib\nrf_modem_lib_trace.c:35:22: note: in expansion of macro 'DT_NODELABEL'
       35 |   .pselrxd = DT_PROP(DT_NODELABEL(uart1), rx_pin),
          |                      ^~~~~~~~~~~~
    [323/375] Building C object modules/nrf/lib/nrf_modem_lib/CMakeFiles/..__nrf__lib__nrf_modem_lib.dir/nrf_modem_os.c.obj
    [324/375] Linking C static library zephyr\drivers\flash\libdrivers__flash.a
    [325/375] Building C object modules/nrf/lib/nrf_modem_lib/CMakeFiles/..__nrf__lib__nrf_modem_lib.dir/shmem_sanity.c.obj
    [326/375] Linking C static library zephyr\drivers\entropy\libdrivers__entropy.a
    [327/375] Building C object modules/nrf/lib/nrf_modem_lib/CMakeFiles/..__nrf__lib__nrf_modem_lib.dir/nrf91_sockets.c.obj
    [328/375] Linking C static library zephyr\drivers\timer\libdrivers__timer.a
    [329/375] Building C object zephyr/kernel/CMakeFiles/kernel.dir/kheap.c.obj
    [330/375] Linking C static library zephyr\drivers\serial\libdrivers__serial.a
    [331/375] Building C object zephyr/kernel/CMakeFiles/kernel.dir/fatal.c.obj
    ninja: build stopped: subcommand failed.
    FATAL ERROR: command exited with status 1: 'c:\Users\ift_praveen\ncs\v1.9.1\toolchain\opt\bin\cmake.EXE' --build 'c:\Users\ift_praveen\Desktop\IM-830\WORK2.5\im830\build'
    
     *  The terminal process terminated with exit code: 1. 
     *  Terminal will be reused by tasks, press any key to close it. 

    Here it is the complete build error log.

    8510.build_error_log.txt

    I am also attaching the source code of application here. 
    0181.im830.zip

    Please select the board from custom boards.



    Kindly check it and help me in solving the issue.

    Thank you.

    Best Regards

    Praveen Deshmane

  • The problem is because you don't have UART1 enabled.

    By default, that is the UART which is used for modem traces.

    What do you use UART0 for?

    If it is only used for logging, the easiest way to get a trace is probably to send the application logs over RTT, use the freed up serial peripheral for I2C (so use i2c0 instead of i2c1) and use enable uart1 (you can change still use the same pins for both UART and I2C). The reason for why you have to do this is that the UART, I2C and SPI peripherals use the same hardware (it's really just one "serial" peripheral), which means that you can only use one of UARTn, I2Cn or SPIn at a time.

    Alternatively, you can change the code in nrf\lib\nrf_modem_lib\nrf_modem_lib_trace.c to use the UART0 peripheral instead of UART1. Unfortunately, there is no easy way to do this, other than manually changing every place where the peripheral instance is referenced. There is a PR that will make it possible to choose which peripheral is used for modem trace that is open, so this will be better in the future.

    A third option is to send the modem traces over RTT. The problem with this method is that the RTT modem trace backend is less stable than the UART backend, so there is a higher chance of corrupted traces, or the traces not capturing the important events. We also don't have proper tooling for this on the PC side, so capturing the traces is a bit more complex. If you choose this option, you can follow these steps:

    Requirement: NCS v1.9.x or newer

    1. Go into prj.conf and add these two lines:
    CONFIG_NRF_MODEM_LIB_TRACE_ENABLED=y
    CONFIG_NRF_MODEM_LIB_TRACE_MEDIUM_RTT=y

     

    You might also need to disable other RTT logging channels:
    CONFIG_LOG_BACKEND_RTT=n
    CONFIG_RTT_CONSOLE=n

     

    2. Compile and flash the project.

     

    3. Open JLinkRTTViewer, select device "nRF9160_xxaa"

     

    4. When successfully connected, go to "Logging" -> "Start Data Logging", and select a path to save the file.

     

    5. See that the .log file grows in size. When finished tracing, stop data logging and rename the .log file to .bin

Related