MCUBoot without Partition Manager

Hi, I want to implement DFU on an nRF52832 with a mx25r1635f external flash, originally I implement the partitions and everything using the devicetree since I find it a lot more comfortable to use. I followed this proccess: https://devzone.nordicsemi.com/guides/nrf-connect-sdk-guides/b/software/posts/ncs-dfu , but the CONFIG_BOOTLOADER_MCUBOOT option enables the partition manager by default, is there a way to use it with the devicetree method for partitions? I saw that most applications on Zephyr do actually use the devicetree instead of the partition manager, so I expect it to be possible, but couldn't find a way to do it.

Parents
  • Hi, 

    Which NCS are you using? Is it v2.2.0? If so, You can have .conf and .overly for mcuboot as this example

    Regards,
    Amanda H.

  • Hi, I tried to build the code, but I'm getting a lot of error messages, I tried taking out a couple of config parameters, even after trying many combinations, I still can't make it build. Do you know what config parameters I need to use for the nRF52832 with SPI-NOR flash, not QSPI? 

  • Hi, 

    Not sure what causes the issue, but the overlay seems you are using qpsi for mx25r16. If you disable qpsi as following 

    &qspi {
    	status = "disabled";
    };

    L114 &mx25r16 will not work because the parent's node &qspi is disabled. To use SPI_NOR driver with your external mx25r16, it should have the thing like this example . Here is my overlay for your reference:
     
    /*
     * Copyright (c) 2022 Nordic Semiconductor ASA
     *
     * SPDX-License-Identifier: Apache-2.0
     */
    
    /* This DTS overlay allows to test MX25R6435F  using SPI_NOR driver */
    
    &pinctrl {
    	spi1_alt_default: spi1_alt_default {
    		group1 {
    			psels = <NRF_PSEL(SPIM_SCK, 0, 19)>,
    				<NRF_PSEL(SPIM_MOSI, 0, 20)>,
    				<NRF_PSEL(SPIM_MISO, 0, 21)>;
    		};
    	};
    
    	spi1_alt_sleep: spi1_alt_sleep {
    		group1 {
    			psels = <NRF_PSEL(SPIM_SCK, 0, 19)>,
    				<NRF_PSEL(SPIM_MOSI, 0, 20)>,
    				<NRF_PSEL(SPIM_MISO, 0, 21)>;
    			low-power-enable;
    		};
    	};
    };
    
    /delete-node/ &mx25r64;
    / {
    	chosen {
    		nordic,pm-ext-flash = &mx25r64;
    	};
    
    	fstab {
    	compatible = "zephyr,fstab";
    	lfs1: lfs1 {
    		compatible = "zephyr,fstab,littlefs";
    		mount-point = "/lfs1";
    		partition = <&lfs1_part>;
    		automount;
    		read-size = <16>;
    		prog-size = <16>;
    		cache-size = <64>;
    		lookahead-size = <32>;
    		block-cycles = <512>;
    		};
    	};
    };
    
    &spi1 {
    	compatible = "nordic,nrf-spi";
    	status = "okay";
    	cs-gpios = <&gpio0 17 GPIO_ACTIVE_LOW>;
    	pinctrl-0 = <&spi1_alt_default>;
    	pinctrl-1 = <&spi1_alt_sleep>;
    	pinctrl-names = "default", "sleep";
    	mx25r64: mx25r6435f@0  {
    		compatible = "jedec,spi-nor";
    		reg = <0>;
    		spi-max-frequency = <33000000>;
    		jedec-id = [c2 28 17];
    		size = <67108864>;
    		wp-gpios = <&gpio0 22 GPIO_ACTIVE_LOW>;
    		hold-gpios = <&gpio0 23 GPIO_ACTIVE_LOW>;
    		partitions {
    			compatible = "fixed-partitions";
    			#address-cells = <1>;
    			#size-cells = <1>;
    	
    		};
    	};
    };
    
    &qspi {
    	status = "disabled";
    };

    Then, it would show the FS at the external flash as

    -Amanda H.

  • Hi, I don't have it in the QSPI bus, as I'm using a nrf52832 it does not even include a QSPI bus, I have the flash SPI definitions on the dts file for the custom board:

     &spi1 {
    	 compatible = "nordic,nrf-spi";
    	 status = "okay";
    	 pinctrl-0 = <&spi1_default>;
    	 pinctrl-1 = <&spi1_sleep>;
    	 pinctrl-names = "default", "sleep";
    	 clock-frequency = <20000000>;
    	 mx25r16: mx25r1635f@0 {
    		compatible = "jedec,spi-nor";
    		reg = <0>;
    		spi-max-frequency = <33000000>;
    		jedec-id = [c2 28 15];
    		size = <DT_SIZE_M(16)>;
    	};
     };

    I forgot to add this piece of code before, sorry.

  • Does the issue only happen when the CONFIG_PM_PARTITION_SIZE_LITTLEFS is 0x6000? If not, is it possible to provide the log and the updated overly?

    -Amanda H.

  • it happens only when CONFIG_PM_PARTITION_SIZE_LITTLEFS is 0xf000 or more

  • Please upload the latest overlay file. Thanks. 

    -Amanda H.

Reply Children
Related