Azure FOTA w/o Partition Manager (NCS v2.9.3)

Hi,

 I would like to know if its possible to run Azure FOTA functionality w/o using Partition Manager (aka `SB_CONFIG_PARTITION_MANAGER=n`) ?

 Trying to build this gets the following errors:

1. 

nrf/subsys/dfu/dfu_target/src/dfu_target_mcuboot.c:20:10: fatal error: pm_config.h: No such file or directory
   20 | #include <pm_config.h>
      |          ^~~~~~~~~~~~~
compilation terminated.

2. 

nrf/subsys/net/lib/fota_download/src/fota_download.c:12:10: fatal error: pm_config.h: No such file or directory
   12 | #include <pm_config.h>
      |          ^~~~~~~~~~~~~
compilation terminated.

Trying to remove the include, creates these other issues:

3. 

nrf/subsys/dfu/dfu_target/src/dfu_target_mcuboot.c:60:41: error: 'PM_MCUBOOT_SECONDARY_SIZE' undeclared here (not in a function); did you mean 'PM_MCUBOOT_SECONDARY_0_SIZE'?
   60 | #define PM_MCUBOOT_SECONDARY_0_SIZE     PM_MCUBOOT_SECONDARY_SIZE
      |                                         

4. 

nrf/subsys/dfu/dfu_target/src/dfu_target_mcuboot.c:61:41: error: 'PM_MCUBOOT_SECONDARY_ADDRESS' undeclared here (not in a function); did you mean 'PM_MCUBOOT_SECONDARY_0_ADDRESS'?
   61 | #define PM_MCUBOOT_SECONDARY_0_ADDRESS  PM_MCUBOOT_SECONDARY_ADDRESS
      |                                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~

Trying to hack these further you get:

ncs/toolchains/b620d30767/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd.exe:zephyr/linker_zephyr_pre0.cmd:61 cannot move location counter backwards (from 000000000000c300 to 000000000000c200)
collect2.exe: error: ld returned 1 exit status
ninja: build stopped: subcommand failed.

Best regards.

Parents Reply Children
  • Hi Benjamin,

     I've [manually] applied that commit (made pseudo-patch) on top of existing v2.9.3 ncs folder.

     I've noticed that it does not fix all the issues, for example:

    nrf/subsys/net/lib/fota_download/src/fota_download.c:12:10: fatal error: pm_config.h: No such file or directory
       12 | #include <pm_config.h>
          |          ^~~~~~~~~~~~~
    compilation terminated.

    Trying to remove the include resutls in other issues which I assume are fixed in the v3.3.0 where the patch is intended to be applied on:

    nrf/subsys/dfu/dfu_target/src/dfu_target_mcuboot.c:177:23: error: 'target_id_name' undeclared (first use in this function)
      177 |                 .id = target_id_name[img_num],
          |                       

    What is you partition layout? 

    &mx25u128 {
        partitions {
            compatible = "fixed-partitions";
            #address-cells = <1>;
            #size-cells = <1>;
    
            slot1_partition: partition@0 {
            	label = "image-1";
            	reg = <0x00000000 0x00080000>;
            };
    		 partition@80000 {
    			label = "external-flash";
    			reg = <0x00080000 0x10000000>;
    		 };
        };
    };
    
    &flash0 {
    	partitions {
    		compatible = "fixed-partitions";
    		#address-cells = <1>;
    		#size-cells = <1>;
    
    		boot_partition: partition@0 {
    			label = "mcuboot";
    			reg = <0x00000000 0x0000C000>;
    		};
    		slot0_partition: partition@c000 {
    			label = "image-0";
    			reg = <0x0000C000 0x0008C000>;
    		};
    		storage_partition: partition@f8000 {
    			label = "storage";
    			reg = <0x000f8000 0x00008000>;
    		};
    	};
    };
    

    Best regards

  • Yes, there may be more patchwork to do for it to work unfortunately. The easiest option would be to just Partition Manager if you need to use v2.9.3.

  • Hi Benjamin,

     I've tried that as well, I get the following issue debugging [1] the bootloader

    BOOT_LOG_ERR("Unable to find bootable image");

    I assume it has to do with the fact that the application is larger than internal flash memory can support and I've moved the BANK1 to external flash (tried also to move storage partition, no change). But then I get this error message inside the bootloader and then it panics.

    Posted this message on discord as well :D

    References:

    [1]: How to Debug MCUboot (and Why I Needed To) - The Golioth Developer Blog

    Best regards

Related