SDK v2.0.0 Asset_Tracker_v2 does not run on nRF9160DK with older default version.

We received the nRF9160DK that included default firmware for the Asset Tracker v2.  The default version appears to be an older version of the application.

We built the latest version of Asset Tracker v2 from the nRF Connect SDK v2.0.0.  The build is successful.  When we flash it to the nRF9160DK, we are required to do a full erase because of UICR changes.  Upon reset, we see the bootloader logs, then it attempts to jump to the first image slot, but it does not run after that.  The startup log is shown below.

Are we missing something to set or clear a security issue that is left over from the previous version?

*** Booting Zephyr OS build v3.0.99-ncs1  ***{0D}{0A}
Attempting to boot slot 0.{0D}{0D}{0A}
Attempting to boot from address 0x8200.{0D}{0A}
{0D}Verifying signature against key 0.{0D}{0A}
{0D}Hash: 0x27...2d{0D}{0D}{0A}
Firmware signature verified.{0D}{0A}
{0D}Firmware version 1{0D}{0D}{0A}
Booting (0x8200).{0D}{0D}*** Booting Zephyr OS build v3.0.99-ncs1  ***{0D}{0A}
I: Starting bootloader{0D}{0A}
I: Primary image: magic=unset, swap_type=0x1, copy_done=0x3, image_ok=0x3{0D}{0A}
I: Secondary image: magic=unset, swap_type=0x1, copy_done=0x3, image_ok=0x3{0D}{0A}
I: Boot source: none{0D}{0A}
I: Swap type: none{0D}{0A}
I: Primary image: magic=unset, swap_type=0x1, copy_done=0x3, image_ok=0x3{0D}{0A}
I: Secondary image: magic=unset, swap_type=0x1, copy_done=0x3, image_ok=0x3{0D}{0A}
I: Boot source: none{0D}{0A}
I: Swap type: none{0D}{0A}
I: Bootloader chainload address offset: 0x28000{0D}{0A}
I: Jumping to the first image slot{0D}


  • Hello,

    I got feedback from our team. You can set CONFIG_FPROTECT=n in both b0 and MCUBoot during debugging only. 

    Thanks.

    Best Regards,

    Kazi Afroza Sultana

  • Can you please provide more details about how to make these changes in the build?

    I manually set CONFIG_FPROTECT=y in these 2 files:

    • build_dbg\b0\zephyr\.config
    • build_dbg\mcuboot\zephyr\.config

    The build failed with an error:

    __main__.PartitionError: Conflicting configuration found ...

    The full build log is shown below.

    Thanks.

    Ron

    > Executing task: nRF Connect: Build: asset_tracker_v2/build_dbg (active) <
    
    Building asset_tracker_v2
    west build --build-dir c:\Source\cust\asset_tracker_v2\build_dbg c:\Source\cust\asset_tracker_v2
    
    [0/1] Re-running CMake...
    Loading Zephyr default modules (Zephyr base (cached)).
    -- Application: C:/Source/cust/asset_tracker_v2
    -- Found Python3: C:/Nordic/toolchains/v2.0.0/opt/bin/python.exe (found suitable exact version "3.8.2") found components: Interpreter 
    -- Cache files will be written to: C:/Nordic/v2.0.0/zephyr/.cache
    -- Zephyr version: 3.0.99 (C:/Nordic/v2.0.0/zephyr)
    -- Found west (found suitable version "0.13.1", minimum required is "0.7.1")
    -- Board: nrf9160dk_nrf9160_ns, Revision: 0.7.0
    -- Found host-tools: zephyr 0.14.1 (C:/Nordic/toolchains/v2.0.0/opt/zephyr-sdk)
    -- Found dtc: C:/Nordic/toolchains/v2.0.0/opt/bin/dtc.exe (found suitable version "1.4.7", minimum required is "1.4.6")
    -- Found toolchain: zephyr 0.14.1 (C:/Nordic/toolchains/v2.0.0/opt/zephyr-sdk)
    -- Found BOARD.dts: C:/Nordic/v2.0.0/zephyr/boards/arm/nrf9160dk_nrf9160/nrf9160dk_nrf9160_ns.dts
    -- Found devicetree overlay: C:/Source/cust/asset_tracker_v2/boards/nrf9160dk_nrf9160_ns.overlay
    -- Generated zephyr.dts: C:/Source/cust/asset_tracker_v2/build_dbg/zephyr/zephyr.dts
    -- Generated devicetree_unfixed.h: C:/Source/cust/asset_tracker_v2/build_dbg/zephyr/include/generated/devicetree_unfixed.h
    -- Generated device_extern.h: C:/Source/cust/asset_tracker_v2/build_dbg/zephyr/include/generated/device_extern.h
    -- Including generated dts.cmake file: C:/Source/cust/asset_tracker_v2/build_dbg/zephyr/dts.cmake
    
    warning: Experimental symbol NET_SOCKETS_OFFLOAD is enabled.
    
    Parsing C:/Source/cust/asset_tracker_v2/Kconfig
    Loaded configuration 'C:/Source/cust/asset_tracker_v2/build_dbg/zephyr/.config'
    No change to configuration in 'C:/Source/cust/asset_tracker_v2/build_dbg/zephyr/.config'
    No change to Kconfig header in 'C:/Source/cust/asset_tracker_v2/build_dbg/zephyr/include/generated/autoconf.h'
    Changed board to secure nrf9160dk_nrf9160 (NOT NS)
    
    === child image b0 -  begin ===
    loading initial cache file C:/Source/cust/asset_tracker_v2/build_dbg/b0/child_image_preload.cmake
    Loading Zephyr default modules (Zephyr base (cached)).
    -- Application: C:/Nordic/v2.0.0/nrf/samples/bootloader
    -- Cache files will be written to: C:/Nordic/v2.0.0/zephyr/.cache
    -- Zephyr version: 3.0.99 (C:/Nordic/v2.0.0/zephyr)
    -- Found west (found suitable version "0.13.1", minimum required is "0.7.1")
    -- Board: nrf9160dk_nrf9160, Revision: 0.7.0
    -- Found host-tools: zephyr 0.14.1 (C:/Nordic/toolchains/v2.0.0/opt/zephyr-sdk)
    -- Found dtc: C:/Nordic/toolchains/v2.0.0/opt/bin/dtc.exe (found suitable version "1.4.7", minimum required is "1.4.6")
    -- Found toolchain: zephyr 0.14.1 (C:/Nordic/toolchains/v2.0.0/opt/zephyr-sdk)
    -- Found BOARD.dts: C:/Nordic/v2.0.0/zephyr/boards/arm/nrf9160dk_nrf9160/nrf9160dk_nrf9160.dts
    -- Generated zephyr.dts: C:/Source/cust/asset_tracker_v2/build_dbg/b0/zephyr/zephyr.dts
    -- Generated devicetree_unfixed.h: C:/Source/cust/asset_tracker_v2/build_dbg/b0/zephyr/include/generated/devicetree_unfixed.h
    -- Generated device_extern.h: C:/Source/cust/asset_tracker_v2/build_dbg/b0/zephyr/include/generated/device_extern.h
    -- Including generated dts.cmake file: C:/Source/cust/asset_tracker_v2/build_dbg/b0/zephyr/dts.cmake
    Parsing C:/Nordic/v2.0.0/zephyr/Kconfig
    Loaded configuration 'C:/Source/cust/asset_tracker_v2/build_dbg/b0/zephyr/.config'
    No change to configuration in 'C:/Source/cust/asset_tracker_v2/build_dbg/b0/zephyr/.config'
    No change to Kconfig header in 'C:/Source/cust/asset_tracker_v2/build_dbg/b0/zephyr/include/generated/autoconf.h'
    CMake Warning at c:\Source\cust\subsys\bootloader\CMakeLists.txt:21 (message):
      
    
            --------------------------------------------------------
            --- WARNING: When using the immutable bootloader on  ---
            --- this SoC, the UICR must be erased when flashing. ---
            --- E.g. by calling 'west flash --erase'             ---
            --------------------------------------------------------
    
    
    -- Configuring done
    -- Generating done
    -- Build files have been written to: C:/Source/cust/asset_tracker_v2/build_dbg/b0
    === child image b0 -  end ===
    
    -- Found Python3: C:/Nordic/toolchains/v2.0.0/opt/bin/python.exe (found version "3.8.2") found components: Interpreter 
    Changed board to secure nrf9160dk_nrf9160 (NOT NS)
    
    === child image mcuboot -  begin ===
    loading initial cache file C:/Source/cust/asset_tracker_v2/build_dbg/mcuboot/child_image_preload.cmake
    Loading Zephyr default modules (Zephyr base (cached)).
    -- Application: C:/Nordic/v2.0.0/bootloader/mcuboot/boot/zephyr
    -- Cache files will be written to: C:/Nordic/v2.0.0/zephyr/.cache
    -- Zephyr version: 3.0.99 (C:/Nordic/v2.0.0/zephyr)
    -- Found west (found suitable version "0.13.1", minimum required is "0.7.1")
    -- Board: nrf9160dk_nrf9160, Revision: 0.7.0
    -- Found host-tools: zephyr 0.14.1 (C:/Nordic/toolchains/v2.0.0/opt/zephyr-sdk)
    -- Found dtc: C:/Nordic/toolchains/v2.0.0/opt/bin/dtc.exe (found suitable version "1.4.7", minimum required is "1.4.6")
    -- Found toolchain: zephyr 0.14.1 (C:/Nordic/toolchains/v2.0.0/opt/zephyr-sdk)
    -- Found BOARD.dts: C:/Nordic/v2.0.0/zephyr/boards/arm/nrf9160dk_nrf9160/nrf9160dk_nrf9160.dts
    -- Found devicetree overlay: C:/Nordic/v2.0.0/bootloader/mcuboot/boot/zephyr/dts.overlay
    -- Found devicetree overlay: C:/Nordic/v2.0.0/bootloader/mcuboot/boot/zephyr/dts.overlay
    -- Found devicetree overlay: C:/Nordic/v2.0.0/bootloader/mcuboot/boot/zephyr/dts.overlay
    -- Generated zephyr.dts: C:/Source/cust/asset_tracker_v2/build_dbg/mcuboot/zephyr/zephyr.dts
    -- Generated devicetree_unfixed.h: C:/Source/cust/asset_tracker_v2/build_dbg/mcuboot/zephyr/include/generated/devicetree_unfixed.h
    -- Generated device_extern.h: C:/Source/cust/asset_tracker_v2/build_dbg/mcuboot/zephyr/include/generated/device_extern.h
    -- Including generated dts.cmake file: C:/Source/cust/asset_tracker_v2/build_dbg/mcuboot/zephyr/dts.cmake
    Parsing C:/Nordic/v2.0.0/bootloader/mcuboot/boot/zephyr/Kconfig
    Loaded configuration 'C:/Source/cust/asset_tracker_v2/build_dbg/mcuboot/zephyr/.config'
    No change to configuration in 'C:/Source/cust/asset_tracker_v2/build_dbg/mcuboot/zephyr/.config'
    No change to Kconfig header in 'C:/Source/cust/asset_tracker_v2/build_dbg/mcuboot/zephyr/include/generated/autoconf.h'
    MCUBoot bootloader key file: C:/Nordic/v2.0.0/bootloader/mcuboot/root-ec-p256.pem
    -- Configuring done
    -- Generating done
    -- Build files have been written to: C:/Source/cust/asset_tracker_v2/build_dbg/mcuboot
    === child image mcuboot -  end ===
    
    Changed board to secure nrf9160dk_nrf9160 (NOT NS)
    
    === child image s1_image -  begin ===
    loading initial cache file C:/Source/cust/asset_tracker_v2/build_dbg/mcuboot/child_image_preload.cmake
    Loading Zephyr default modules (Zephyr base (cached)).
    -- Application: C:/Nordic/v2.0.0/bootloader/mcuboot/boot/zephyr
    -- Cache files will be written to: C:/Nordic/v2.0.0/zephyr/.cache
    -- Zephyr version: 3.0.99 (C:/Nordic/v2.0.0/zephyr)
    -- Found west (found suitable version "0.13.1", minimum required is "0.7.1")
    -- Board: nrf9160dk_nrf9160, Revision: 0.7.0
    -- Found host-tools: zephyr 0.14.1 (C:/Nordic/toolchains/v2.0.0/opt/zephyr-sdk)
    -- Found dtc: C:/Nordic/toolchains/v2.0.0/opt/bin/dtc.exe (found suitable version "1.4.7", minimum required is "1.4.6")
    -- Found toolchain: zephyr 0.14.1 (C:/Nordic/toolchains/v2.0.0/opt/zephyr-sdk)
    -- Found BOARD.dts: C:/Nordic/v2.0.0/zephyr/boards/arm/nrf9160dk_nrf9160/nrf9160dk_nrf9160.dts
    -- Found devicetree overlay: C:/Nordic/v2.0.0/bootloader/mcuboot/boot/zephyr/dts.overlay
    -- Found devicetree overlay: C:/Nordic/v2.0.0/bootloader/mcuboot/boot/zephyr/dts.overlay
    -- Found devicetree overlay: C:/Nordic/v2.0.0/bootloader/mcuboot/boot/zephyr/dts.overlay
    -- Generated zephyr.dts: C:/Source/cust/asset_tracker_v2/build_dbg/s1_image/zephyr/zephyr.dts
    -- Generated devicetree_unfixed.h: C:/Source/cust/asset_tracker_v2/build_dbg/s1_image/zephyr/include/generated/devicetree_unfixed.h
    -- Generated device_extern.h: C:/Source/cust/asset_tracker_v2/build_dbg/s1_image/zephyr/include/generated/device_extern.h
    -- Including generated dts.cmake file: C:/Source/cust/asset_tracker_v2/build_dbg/s1_image/zephyr/dts.cmake
    Parsing C:/Nordic/v2.0.0/bootloader/mcuboot/boot/zephyr/Kconfig
    Loaded configuration 'C:/Source/cust/asset_tracker_v2/build_dbg/s1_image/zephyr/.config'
    No change to configuration in 'C:/Source/cust/asset_tracker_v2/build_dbg/s1_image/zephyr/.config'
    No change to Kconfig header in 'C:/Source/cust/asset_tracker_v2/build_dbg/s1_image/zephyr/include/generated/autoconf.h'
    MCUBoot bootloader key file: C:/Nordic/v2.0.0/bootloader/mcuboot/root-ec-p256.pem
    -- Configuring done
    -- Generating done
    -- Build files have been written to: C:/Source/cust/asset_tracker_v2/build_dbg/s1_image
    === child image s1_image -  end ===
    
    CMake Warning at C:\Nordic\v2.0.0\nrf\modules\mcuboot\CMakeLists.txt:281 (message):
      
    
            ---------------------------------------------------------
            --- WARNING: Using default MCUBoot key, it should not ---
            --- be used for production.                           ---
            ---------------------------------------------------------
            
    
    
    
    CMake Warning at C:\Nordic\v2.0.0\zephyr\CMakeLists.txt:1803 (message):
      __ASSERT() statements are globally ENABLED
    
    
    Traceback (most recent call last):
      File "C:/Nordic/v2.0.0/nrf/scripts/partition_manager.py", line 1938, in <module>
        main()
      File "C:/Nordic/v2.0.0/nrf/scripts/partition_manager.py", line 1006, in main
        pm_config = load_reqs(args.input_files)
      File "C:/Nordic/v2.0.0/nrf/scripts/partition_manager.py", line 675, in load_reqs
        raise PartitionError(
    __main__.PartitionError: Conflicting configuration found for 'C:/Source/cust/asset_tracker_v2/build_dbg/s1_image/zephyr/include/generated/pm.yml' value for key 'mcuboot_pad' differs. val1: {'size': 512, 'placement': {'before': ['mcuboot_primary_app'], 'align': {'start': 32768}}} val2: {'size': 512, 'placement': {'before': ['mcuboot_primary_app']}} 
    CMake Error at C:\Nordic\v2.0.0\nrf\cmake\partition_manager.cmake:274 (message):
      Partition Manager failed, aborting.  Command:
      C:/Nordic/toolchains/v2.0.0/opt/bin/python.exe;C:/Nordic/v2.0.0/nrf/scripts/partition_manager.py;--input-files;C:/Source/cust/asset_tracker_v2/build_dbg/b0/zephyr/include/generated/pm.yml;C:/Source/cust/asset_tracker_v2/build_dbg/mcuboot/zephyr/include/generated/pm.yml;C:/Source/cust/asset_tracker_v2/build_dbg/s1_image/zephyr/include/generated/pm.yml;C:/Source/cust/asset_tracker_v2/build_dbg/zephyr/include/generated/pm.yml;C:/Source/cust/asset_tracker_v2/build_dbg/modules/nrf/subsys/partition_manager/pm.yml.settings;C:/Source/cust/asset_tracker_v2/build_dbg/modules/nrf/subsys/partition_manager/pm.yml.libmodem;C:/Source/cust/asset_tracker_v2/build_dbg/modules/nrf/subsys/partition_manager/pm.yml.tfm;C:/Source/cust/asset_tracker_v2/build_dbg/modules/nrf/subsys/partition_manager/pm.yml.trustzone;--regions;sram_primary;otp;flash_primary;--output-partitions;C:/Source/cust/asset_tracker_v2/build_dbg/partitions.yml;--output-regions;C:/Source/cust/asset_tracker_v2/build_dbg/regions.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:\Nordic\v2.0.0\zephyr\cmake\modules\kernel.cmake:243 (include)
      C:\Nordic\v2.0.0\zephyr\cmake\modules\zephyr_default.cmake:130 (include)
      C:\Nordic\v2.0.0\zephyr\share\zephyr-package\cmake\ZephyrConfig.cmake:51 (include)
      C:\Nordic\v2.0.0\zephyr\share\zephyr-package\cmake\ZephyrConfig.cmake:81 (include_boilerplate)
      c:\Source\cust\asset_tracker_v2\build_dbg\CMakeLists.txt:9 (find_package)
    
    
    -- Configuring incomplete, errors occurred!
    See also "C:/Source/cust/asset_tracker_v2/build_dbg/CMakeFiles/CMakeOutput.log".
    See also "C:/Source/cust/asset_tracker_v2/build_dbg/CMakeFiles/CMakeError.log".
    FAILED: build.ninja 
    C:\Nordic\toolchains\v2.0.0\opt\bin\cmake.exe --regenerate-during-build -SC:\Source\cust\asset_tracker_v2 -BC:\Source\cust\asset_tracker_v2\build_dbg
    ninja: error: rebuilding 'build.ninja': subcommand failed
    FATAL ERROR: command exited with status 1: 'c:\Nordic\toolchains\v2.0.0\opt\bin\cmake.EXE' --build 'c:\Source\cust\asset_tracker_v2\build_dbg'
    The terminal process terminated with exit code: 1.
    
    Terminal will be reused by tasks, press any key to close it.
    

  • Hello,

    I have got feedback from my team. You can not modify the .config file. This option should be set in prj.conf. So, in the child_image folder you should create b0.conf and mcuboot.conf file where CONFIG_PROTECT = n. 

    Thanks. 

    Best Regards,

    Kazi Afroza Sultana

  • Hello,

    I have got feedback from my team. You can not modify the .config file. This option should be set in prj.conf. So, in the child_image folder you should create b0.conf and mcuboot.conf file where CONFIG_PROTECT = n. 

    Thanks. 

    Best Regards,

    Kazi Afroza Sultana

  • Thanks for the clarification. I created the config files you advised and set "CONFIG_FPROTECT=n" in both. The configuration process completes now, but the build fails with this undefined symbol:

    C:\Nordic\v2.0.0\nrf\samples\bootloader\src\main.c:83: undefined reference to `fprotect_area'

    Thanks.

    Ron

Related