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? 

  • Check the CONFIG_PM_PARTITION_SIZE_LITTLEFS value. 

    -Amanda H.

  • I'm getting this error now when I set CONFIG_PM_PARTITION_SIZE_LITTLEFS to any value bigger than 0xf000:

    do you know what could it be?

  • even when the value is 0x7000, it still gives this error: 

  • Hi, 

    Could you provide the memory layout for the partition, partitions.yml under build folder, overlay, and config files? If you are using pm_static.yml, please also share it. 

    -Amanda H.

  • The memory report I can't generate, when I try to generate it, it gives me an error.
    partitions.yml:

    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    app:
    address: 0xc200
    end_address: 0x80000
    region: flash_primary
    size: 0x73e00
    external_flash:
    address: 0x83000
    end_address: 0x200000
    region: external_flash
    size: 0x17d000
    littlefs_storage:
    address: 0x74000
    device: DT_CHOSEN(nordic_pm_ext_flash)
    end_address: 0x83000
    placement:
    before:
    - tfm_storage
    - end
    region: external_flash
    size: 0xf000
    mcuboot:
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    overlay file:
    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    /*
    * Copyright (c) 2019 Nordic Semiconductor ASA
    *
    * SPDX-License-Identifier: Apache-2.0
    */
    &pinctrl {
    spi0_default: spi0_default {
    group1 {
    psels = <NRF_PSEL(SPIM_SCK, 0, 6)>,
    <NRF_PSEL(SPIM_MOSI, 0, 5)>,
    <NRF_PSEL(SPIM_MISO, 0, 4)>;
    };
    };
    spi0_sleep: spi0_sleep {
    group1 {
    psels = <NRF_PSEL(SPIM_SCK, 0, 6)>,
    <NRF_PSEL(SPIM_MOSI, 0, 5)>,
    <NRF_PSEL(SPIM_MISO, 0, 4)>;
    low-power-enable;
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    config file:
    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    CONFIG_JSON_LIBRARY=y
    CONFIG_CBPRINTF_FP_SUPPORT=y
    CONFIG_DEBUG=y
    CONFIG_CPLUSPLUS=y
    CONFIG_LIB_CPLUSPLUS=y
    CONFIG_NEWLIB_LIBC=y
    CONFIG_NEWLIB_LIBC_FLOAT_PRINTF=y
    CONFIG_SIZE_OPTIMIZATIONS=y
    CONFIG_CONSOLE=y
    CONFIG_USE_SEGGER_RTT=y
    CONFIG_RTT_CONSOLE=y
    CONFIG_THREAD_CUSTOM_DATA=n
    CONFIG_FPU=y
    CONFIG_FP16=n
    CONFIG_EDGE_IMPULSE=y
    CONFIG_EDGE_IMPULSE_URI="http://studio.edgeimpulse.com/v1/api/160376/deployment/download?type=zip"
    CONFIG_EI_WRAPPER=y
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX


    I have no pm_static.yml file.

Reply
  • The memory report I can't generate, when I try to generate it, it gives me an error.
    partitions.yml:

    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    app:
    address: 0xc200
    end_address: 0x80000
    region: flash_primary
    size: 0x73e00
    external_flash:
    address: 0x83000
    end_address: 0x200000
    region: external_flash
    size: 0x17d000
    littlefs_storage:
    address: 0x74000
    device: DT_CHOSEN(nordic_pm_ext_flash)
    end_address: 0x83000
    placement:
    before:
    - tfm_storage
    - end
    region: external_flash
    size: 0xf000
    mcuboot:
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    overlay file:
    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    /*
    * Copyright (c) 2019 Nordic Semiconductor ASA
    *
    * SPDX-License-Identifier: Apache-2.0
    */
    &pinctrl {
    spi0_default: spi0_default {
    group1 {
    psels = <NRF_PSEL(SPIM_SCK, 0, 6)>,
    <NRF_PSEL(SPIM_MOSI, 0, 5)>,
    <NRF_PSEL(SPIM_MISO, 0, 4)>;
    };
    };
    spi0_sleep: spi0_sleep {
    group1 {
    psels = <NRF_PSEL(SPIM_SCK, 0, 6)>,
    <NRF_PSEL(SPIM_MOSI, 0, 5)>,
    <NRF_PSEL(SPIM_MISO, 0, 4)>;
    low-power-enable;
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    config file:
    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    CONFIG_JSON_LIBRARY=y
    CONFIG_CBPRINTF_FP_SUPPORT=y
    CONFIG_DEBUG=y
    CONFIG_CPLUSPLUS=y
    CONFIG_LIB_CPLUSPLUS=y
    CONFIG_NEWLIB_LIBC=y
    CONFIG_NEWLIB_LIBC_FLOAT_PRINTF=y
    CONFIG_SIZE_OPTIMIZATIONS=y
    CONFIG_CONSOLE=y
    CONFIG_USE_SEGGER_RTT=y
    CONFIG_RTT_CONSOLE=y
    CONFIG_THREAD_CUSTOM_DATA=n
    CONFIG_FPU=y
    CONFIG_FP16=n
    CONFIG_EDGE_IMPULSE=y
    CONFIG_EDGE_IMPULSE_URI="http://studio.edgeimpulse.com/v1/api/160376/deployment/download?type=zip"
    CONFIG_EI_WRAPPER=y
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX


    I have no pm_static.yml file.

Children
  • Hi, 

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

    Fullscreen
    1
    2
    3
    &qspi {
    status = "disabled";
    };
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    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:
     
    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    /*
    * 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)>,
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    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:

    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    &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)>;
    };
    };
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    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.