Assistance Requested for OTA Configuration on nRF7002DK with Memfault Integration

Dear Nordic Support Team,

I am currently working on a project involving Over-the-Air (OTA) firmware updates using the Memfault platform with a Nordic sample application. While I can download new firmware using the shell, I'm encountering difficulties with the installation process post-download.

Memfault representatives have advised enabling mcuboot and dfu support in the sample app, either by using a specific sample app or by updating the prj.conf in the Memfault+Nordic sample app. Additionally, Memfault's documentation was referenced for configuring and invoking an OTA update in the Nordic nRF Connect SDK.

However, my specific concern is with implementing this configuration on the nRF7002DK board, particularly over WiFi. The available documentation and guidance seem primarily focused on LTE and Bluetooth configurations. I am seeking clarification on whether the standard Memfault configurations for OTA (as applied to nRF9160) are applicable to nRF7002DK, and any specific considerations or challenges I should be aware of, especially regarding the use of internal vs. external flash memory for secondary image slots.

I would appreciate a complete walk-through of the configuration I need to make it work from your memfault sample. 

Your expert advice on this matter would be greatly appreciated to ensure successful implementation and address any potential issues specific to the nRF7002DK board.

Thank you for your assistance.

Best regards,
Actif


Vincent Morin (Actif)

Hello, folks; I have another question.
One of my clients tasked my team to investigate OTA capabilities with memfault from the Nordic sample.  I wonder if the sample provides OTA out of the box.
I am able to download the new firmware with the shell, but I don't see any installation process triggered after.
Any guidance that could help me answer my client's request faster would be welcome.
Regards,
Vincent
8 replies


(Memfault)
Hi 
@Vincent Morin (Actif)
 -- for OTA to work end to end, mcuboot + dfu support needs to be enabled in the sample app.
One option would be to try this sample app which does enable Mcuboot.
Alternatively, you could enable mcuboot in the memfault+Nordic sample app by updating the prj.conf. These should be the approximate flags you need.


Vincent Morin (Actif)
Thank you, name_hidden! I appreciate your support. I will definitely give it a try.


(Memfault)
Depending on the specific chip, there's a few more bits of information here:
https://docs.memfault.com/docs/mcu/nordic-nrf-connect-sdk-guide/#configuring-and-invoking-an-ota-update
docs.memfault.comdocs.memfault.com
Nordic nRF Connect SDK Integration Guide | Memfault Docs
Integrate Memfault using the Nordic Semiconductor's nRF Connect SDK.

Vincent Morin (Actif)
Thank you for providing the information.
I am attempting to configure it, but I am facing some issues. Although I plan to investigate the issue further, could you clarify whether this configuration has been tested with a 7002DK over WiFi? I tried looking for a mention of the 7002DK in the documentation, and the steps appear to have been written for LTE and Bluetooth.
Is the configuration could be different for the 7002DK?


(Memfault)
The nRF7002 will use the same Memfault configs as the nRF9160 for OTA. Note that as far as I know, Nordic doesn't have a functional OTA example for that board; the base image size is about 700kB, which prevents using a secondary image slot using internal (nRF53) flash, and requires placing the secondary slot in the external qspi nor flash chip, which is tricky. If you're getting stuck I definitely recommend posting to Nordic devzone, they're pretty responsive usually.

Vincent Morin (Actif)
Thank you for following up with me. I will reach out to Nordic for assistance regarding this matter.

(Memfault)
No problem! Let us know if you get it working, it's been on our to-do list to get OTA tested on that board

Parents
  • Hello,

    I'm leaving this comment as a reference for anyone who might encounter similar needs in the future. Initially, I must express my appreciation for the exceptional service provided by Memfault. Their support throughout the entire process was outstanding.

    It's important to ensure that your NCS (Nordic Connect SDK) version is compatible with Memfault SDK tag versions of 1.6.0 or higher. This is crucial because critical fixes were implemented starting from version 1.6.0, enabling seamless integration and functionality. For my project, I successfully used NCS version 2.5.1 and a homemade fork of the Memfault SDK to apply the fixes since the release was not yet there.

    • Start from the default memfault sample .
    • Add the wi-fi credential support to your proj.conf:

    # WiFi credentials
    CONFIG_WIFI_CREDENTIALS=y
    CONFIG_WIFI_CREDENTIALS_BACKEND_SETTINGS=y
    CONFIG_WIFI_CREDENTIALS_STATIC=y
    CONFIG_WIFI_CREDENTIALS_STATIC_SSID="ORBI70"
    CONFIG_WIFI_CREDENTIALS_STATIC_PASSWORD="REDACED"

    • Add the support for the FOTA to your proj.conf

    ##
    # FOTA Support
    CONFIG_SPI=y
    CONFIG_SPI_NOR=y
    CONFIG_SPI_NOR_SFDP_DEVICETREE=y
    CONFIG_PM_OVERRIDE_EXTERNAL_DRIVER_CHECK=y
    
    CONFIG_BOOTLOADER_MCUBOOT=y
    CONFIG_MCUBOOT_IMG_MANAGER=y
    
    CONFIG_IMG_MANAGER=y
    CONFIG_STREAM_FLASH=y
    CONFIG_IMG_ERASE_PROGRESSIVELY=y
    
    CONFIG_FOTA_DOWNLOAD=y
    CONFIG_DFU_TARGET=y
    
    CONFIG_DOWNLOAD_CLIENT=y
    CONFIG_DOWNLOAD_CLIENT_STACK_SIZE=4096
    
    CONFIG_MEMFAULT_NRF_CONNECT_SDK=y
    CONFIG_MEMFAULT_FOTA=y
    CONFIG_DOWNLOAD_CLIENT_MAX_FILENAME_SIZE=400
    
    # Print download progress to console
    CONFIG_FOTA_DOWNLOAD_PROGRESS_EVT=y

    • Enable the device tree to be aware of the external flash by creating the following file:  samples/debug/memfault/boards/nrf7002dk_nrf5340_cpuapp.overlay

    # file samples/debug/memfault/boards/nrf7002dk_nrf5340_cpuapp.overlay
    
    / {
    	/* Configure the partition manager to use the mx25r64 external flash memory. */
    	chosen {
    		nordic,pm-ext-flash = &mx25r64;
    	};
    };
    
    &mx25r64 {
    	status = "okay";
    };

     

    • Enable your build process to have multiple images; let's create the MCU boot image.
      • Add the following file for generic configuration.
      • # file: samples/debug/memfault/child_image/mcuboot.conf
        
        # General MCUboot image configurations for all boards.
        
        # Disable serial output
        CONFIG_SERIAL=n
        CONFIG_UART_CONSOLE=n
      • Add specific board config
      •  # file: samples/debug/memfault/child_image/mcuboot/boards/nrf7002dk_nrf5340_cpuapp.conf
        
        # MCUboot configurations to host the secondary image slot on the mx25r64 external flash memory.
        
        # General
        CONFIG_FLASH=y
        CONFIG_MULTITHREADING=y
        CONFIG_MAIN_STACK_SIZE=4096
        
        # Serial Peripheral Interface (SPI)
        CONFIG_SPI=y
        CONFIG_SPI_NOR=y
        CONFIG_SPI_NOR_SFDP_DEVICETREE=y
        CONFIG_SPI_NOR_FLASH_LAYOUT_PAGE_SIZE=4096
        
        # MCUBoot and Partition Manager
        CONFIG_PM_OVERRIDE_EXTERNAL_DRIVER_CHECK=y
        CONFIG_PM_PARTITION_SIZE_MCUBOOT=0x10000
        CONFIG_BOOT_MAX_IMG_SECTORS=256
        CONFIG_BOOT_ERASE_PROGRESSIVELY=y
        CONFIG_SOC_FLASH_NRF_EMULATE_ONE_BYTE_WRITE_ACCESS=y
        
        # Use minimal C library instead of the Picolib
        CONFIG_MINIMAL_LIBC=y
      • Add specific board device tree config
      • # file: samples/debug/memfault/child_image/mcuboot/boards/nrf7002dk_nrf5340_cpuapp.overlay
        
        / {
        	/* Configure the partition manager to use the mx25r64 external flash memory. */
        	chosen {
        		nordic,pm-ext-flash = &mx25r64;
        	};
        };
      • Following memfault documentation should be straightforward for how to do an OTA.
      • The shell command to trigger it will be 
        mflt_nrf fota
      • Be sure to upload the following build build/zephyr/app_update.bin The zephyr.bin file is intended for flashing directly, so it doesn't have the image header pre-pended.

    Don't hesitate to ask if you have questions, and if you need help, the Slack community of memfault is there for you.

    Cheers all.

    Vincent
    Actif

    EDIT: I (Sigurd) took the liberty to edit this answer to redact the Wi-Fi password

Reply
  • Hello,

    I'm leaving this comment as a reference for anyone who might encounter similar needs in the future. Initially, I must express my appreciation for the exceptional service provided by Memfault. Their support throughout the entire process was outstanding.

    It's important to ensure that your NCS (Nordic Connect SDK) version is compatible with Memfault SDK tag versions of 1.6.0 or higher. This is crucial because critical fixes were implemented starting from version 1.6.0, enabling seamless integration and functionality. For my project, I successfully used NCS version 2.5.1 and a homemade fork of the Memfault SDK to apply the fixes since the release was not yet there.

    • Start from the default memfault sample .
    • Add the wi-fi credential support to your proj.conf:

    # WiFi credentials
    CONFIG_WIFI_CREDENTIALS=y
    CONFIG_WIFI_CREDENTIALS_BACKEND_SETTINGS=y
    CONFIG_WIFI_CREDENTIALS_STATIC=y
    CONFIG_WIFI_CREDENTIALS_STATIC_SSID="ORBI70"
    CONFIG_WIFI_CREDENTIALS_STATIC_PASSWORD="REDACED"

    • Add the support for the FOTA to your proj.conf

    ##
    # FOTA Support
    CONFIG_SPI=y
    CONFIG_SPI_NOR=y
    CONFIG_SPI_NOR_SFDP_DEVICETREE=y
    CONFIG_PM_OVERRIDE_EXTERNAL_DRIVER_CHECK=y
    
    CONFIG_BOOTLOADER_MCUBOOT=y
    CONFIG_MCUBOOT_IMG_MANAGER=y
    
    CONFIG_IMG_MANAGER=y
    CONFIG_STREAM_FLASH=y
    CONFIG_IMG_ERASE_PROGRESSIVELY=y
    
    CONFIG_FOTA_DOWNLOAD=y
    CONFIG_DFU_TARGET=y
    
    CONFIG_DOWNLOAD_CLIENT=y
    CONFIG_DOWNLOAD_CLIENT_STACK_SIZE=4096
    
    CONFIG_MEMFAULT_NRF_CONNECT_SDK=y
    CONFIG_MEMFAULT_FOTA=y
    CONFIG_DOWNLOAD_CLIENT_MAX_FILENAME_SIZE=400
    
    # Print download progress to console
    CONFIG_FOTA_DOWNLOAD_PROGRESS_EVT=y

    • Enable the device tree to be aware of the external flash by creating the following file:  samples/debug/memfault/boards/nrf7002dk_nrf5340_cpuapp.overlay

    # file samples/debug/memfault/boards/nrf7002dk_nrf5340_cpuapp.overlay
    
    / {
    	/* Configure the partition manager to use the mx25r64 external flash memory. */
    	chosen {
    		nordic,pm-ext-flash = &mx25r64;
    	};
    };
    
    &mx25r64 {
    	status = "okay";
    };

     

    • Enable your build process to have multiple images; let's create the MCU boot image.
      • Add the following file for generic configuration.
      • # file: samples/debug/memfault/child_image/mcuboot.conf
        
        # General MCUboot image configurations for all boards.
        
        # Disable serial output
        CONFIG_SERIAL=n
        CONFIG_UART_CONSOLE=n
      • Add specific board config
      •  # file: samples/debug/memfault/child_image/mcuboot/boards/nrf7002dk_nrf5340_cpuapp.conf
        
        # MCUboot configurations to host the secondary image slot on the mx25r64 external flash memory.
        
        # General
        CONFIG_FLASH=y
        CONFIG_MULTITHREADING=y
        CONFIG_MAIN_STACK_SIZE=4096
        
        # Serial Peripheral Interface (SPI)
        CONFIG_SPI=y
        CONFIG_SPI_NOR=y
        CONFIG_SPI_NOR_SFDP_DEVICETREE=y
        CONFIG_SPI_NOR_FLASH_LAYOUT_PAGE_SIZE=4096
        
        # MCUBoot and Partition Manager
        CONFIG_PM_OVERRIDE_EXTERNAL_DRIVER_CHECK=y
        CONFIG_PM_PARTITION_SIZE_MCUBOOT=0x10000
        CONFIG_BOOT_MAX_IMG_SECTORS=256
        CONFIG_BOOT_ERASE_PROGRESSIVELY=y
        CONFIG_SOC_FLASH_NRF_EMULATE_ONE_BYTE_WRITE_ACCESS=y
        
        # Use minimal C library instead of the Picolib
        CONFIG_MINIMAL_LIBC=y
      • Add specific board device tree config
      • # file: samples/debug/memfault/child_image/mcuboot/boards/nrf7002dk_nrf5340_cpuapp.overlay
        
        / {
        	/* Configure the partition manager to use the mx25r64 external flash memory. */
        	chosen {
        		nordic,pm-ext-flash = &mx25r64;
        	};
        };
      • Following memfault documentation should be straightforward for how to do an OTA.
      • The shell command to trigger it will be 
        mflt_nrf fota
      • Be sure to upload the following build build/zephyr/app_update.bin The zephyr.bin file is intended for flashing directly, so it doesn't have the image header pre-pended.

    Don't hesitate to ask if you have questions, and if you need help, the Slack community of memfault is there for you.

    Cheers all.

    Vincent
    Actif

    EDIT: I (Sigurd) took the liberty to edit this answer to redact the Wi-Fi password

Children
No Data
Related