NRF52840: mcuboot (ota) and external flash / Compilation Problem

Hye everyone, thanks for the project
i have a problem on NRF52840 on a project using mcuboot (ota) and an external flash used independently by the app (not for ota)

prj.conf:

...
CONFIG_BOOTLOADER_MCUBOOT=y
CONFIG_NCS_SAMPLE_MCUMGR_BT_OTA_DFU=y

myboard.dts:

...
&zd25wq32 {
    partitions {
        compatible = "fixed-partitions";
        #address-cells = <1>;
        #size-cells = <1>;
        
        storagenor_part: partition@0 {
            label = "storagenor";
            reg = <0x000000 0x400000>; /* 0x00100000 -> 4MB */
        };
    };
};

storage.c

...
#define STORAGE_PARTITION storagenor_part
#define STORAGE_PARTITION_ID FIXED_PARTITION_ID(STORAGE_PARTITION)

my code build when CONFIGBOOTLOADER_MCUBOOT=n
but i get a compilation error when CONFIG_BOOTLOADER_MCUBOOT=y

[15/363] Building C object CMakeFiles/app.dir/src/drivers/storage.c.obj
FAILED: CMakeFiles/app.dir/src/drivers/storage.c.obj
...
In file included from /opt/nordic/ncs/v2.5.2/zephyr/include/zephyr/storage/flash_map.h:275,
from ../src/drivers/storage.c:19:
../src/drivers/storage.c: In function 'setup_flash':
/opt/nordic/ncs/v2.5.2/nrf/include/flash_map_pm.h:43:22: error: 'PM_storagenor_part_ID' undeclared (first use in this function)
43 | #define PM_ID(label) PM##label##_ID
| ^
/opt/nordic/ncs/v2.5.2/nrf/include/flash_map_pm.h:48:35: note: in expansion of macro 'PM_ID'
48 | #define FIXED_PARTITION_ID(label) PM_ID(label)
| ^
../src/drivers/storage.c:12:41: note: in expansion of macro 'FIXED_PARTITION_ID'
12 | #define STORAGE_PARTITION_ID FIXED_PARTITION_ID(STORAGE_PARTITION)
| ^~~~
../src/drivers/storage.c:36:36: note: in expansion of macro 'STORAGE_PARTITION_ID'
36 | mnt->storage_dev = (void *)STORAGE_PARTITION_ID;
| ^~~~~~~~

tried a lot but i can't pass through this
same pb with toolchain 2.4.2 and 2.5.2.
any advice ?!

Parents
  • Hi Pierre

    I see that your fs log says that you're trying to initialize a NAND device. Unfortunately the QSPI peripheral on the nRF52/53 series isn't designed to be used with NAND flash devices, and our QSPI drivers/libraries doesn't support it either, so you will have a hard time getting it up and running. Depending on what NAND device you're using, it might be possible, but it's not something we support or will be able to help you out with setting up I'm afraid. The QSPI peripheral and libraries only support the NOR flashes.

    Best regards,

    Simon

  • Thanks, i pass the problem with littlefs.

    I always have a pb with mcuboot_secondary partition on external drive at flashing step.

    i will post any solution i could found.

Reply Children
No Data
Related