nrf54L15, mx24r64 and FOTA

I have searched all responses here and whatever sources I can find, but not have any success.  
The main problem is that existing materials appear incompatible with the 54L range of parts, so following guides and dev academy materials proved somewhat frustrating.
The other observation is, I am starting out with Nordic and Zephyr as a beginner, and my entry device is a 54L15. That's probably part of the problem. No history with older parts.

So firstly, the elephant in the room … why is there no example for FOTA using the external flash memory and the 54L part?
Hopefully, if answers are posted here, maybe that elephant can be removed.

Board used is a Ezerio 54L15 Kit. (basically the same as a Nordic version - same pinout for MX25r64)
Project I am using as a base example is the "peripheral_lbs".
The board file used is nrf54l15dK/nrf54l15/cpuapp.
The overlay file is as below.
Build selected is sysbuild
Tool Chain is V3.0.2

Now regards adding FOTA, existing materials do appear somewhat applicable. The issue I believe I am facing is not knowing if the external flash is being addressed correctly.
This is where there is so much conflicting information on how to configure the flash for a 54L device and how to partition. Is the partition manager instruction applicable the 54 device?
To add, my current status is that I am able to do a sysbuild, load board with firmware and get the DFU symbol on the Nordic Phone app to appear. Downloading a new zip file with updated revision status does not write to external flash, but rather to address 0x000C4800 of the 54l memory space. Hence I believe there is an issue with how the flash is configured.

My prj.conf

CONFIG_NCS_SAMPLES_DEFAULTS=y
CONFIG_BT=y
CONFIG_BT_PERIPHERAL=y
CONFIG_BT_DEVICE_NAME="Nordic_LBS"
CONFIG_NORDIC_QSPI_NOR=y

# Enable the LBS service
CONFIG_BT_LBS=y
CONFIG_BT_LBS_POLL_BUTTON=y
CONFIG_DK_LIBRARY=y
CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=2048
CONFIG_NCS_SAMPLE_MCUMGR_BT_OTA_DFU=y

I manually created sysbuild.conf which has

SB_CONFIG_PARTITION_MANAGER=y
SB_CONFIG_BOOTLOADER_MCUBOOT=y


My overlay file...

/ {
chosen {
nordic,pm-ext-flash = &mx25r64;
};
};

/delete-node/ &boot_partition;
/delete-node/ &slot0_partition;
/delete-node/ &slot1_partition;

/delete-node/ &slot0_ns_partition;
/delete-node/ &slot1_ns_partition;

/delete-node/ &storage_partition;

&cpuapp_rram {
reg = < 0x0 DT_SIZE_K(1524) >;
partitions {
boot_partition: partition@0 {
label = "mcuboot";
reg = <0x000000000 0x00014000>;
};
slot0_partition: partition@14000 {
label = "image-0";
reg = <0x000014000 0x0015A000>;
};
storage_partition: partition@16E000 {
label = "storage";
reg = < 0x16E000 0x9000 >;
};
};
};

&mx25r64 {
status = "okay";
partitions {
compatible = "fixed-partitions";
#address-cells = <1>;
#size-cells = <1>;

slot1_partition: partition@0 {
label = "image-1";
reg = <0x000000000 0x0015A000>;
};
};
};


&pinctrl {
spi00_default: spi00_default {
group1 {
psels = <NRF_PSEL(SPIM_MISO, 2, 4)>,
<NRF_PSEL(SPIM_MOSI, 2, 2)>,
<NRF_PSEL(SPIM_SCK, 2, 1)>;
};
};

/omit-if-no-ref/ spi00_sleep: spi00_sleep {
group1 {
psels = <NRF_PSEL(SPIM_SCK, 2, 1)>,
<NRF_PSEL(SPIM_MOSI, 2, 2)>,
<NRF_PSEL(SPIM_MISO, 2, 4)>;
low-power-enable;
};
};
};

&spi00 {
status = "okay";
cs-gpios = <&gpio2 5 GPIO_ACTIVE_LOW>;
pinctrl-0 = <&spi00_default>;
pinctrl-1 = <&spi00_sleep>;
pinctrl-names = "default", "sleep";

mx25r64: mx25r6435f@0 {
compatible = "jedec,spi-nor";
status = "okay";
reg = <0>;
spi-max-frequency = <2000000>;
jedec-id = [c2 28 17];
sfdp-bfp = [
e5 20 f1 ff ff ff ff 03 44 eb 08 6b 08 3b 04 bb
ee ff ff ff ff ff 00 ff ff ff 00 ff 0c 20 0f 52
10 d8 00 ff 23 72 f5 00 82 ed 04 cc 44 83 48 44
30 b0 30 b0 f7 c4 d5 5c 00 be 29 ff f0 d0 ff ff
];
size = <67108864>;
has-dpd;
t-enter-dpd = <10000>;
t-exit-dpd = <35000>;
};
};


Lastly, I did go into the nRF Kconfig GUI and "tick" NVS, but did not see any change.
Thank You.

Parents
  • Hello,

    So firstly, the elephant in the room … why is there no example for FOTA using the external flash memory and the 54L part?

    In general there are samples, but most of the samples showcasing FOTA in NCS also showcases (mainly) other things. 

    The main problem is that existing materials appear incompatible with the 54L range of parts, so following guides and dev academy materials proved somewhat frustrating.

    You also mention the academy pages, but I'm not certain which courses you've gone through. Both the fundamentals and intermediary course (as well as the BLE fundamentals course) have support for the nRF54L15DK, so could you describe closer which parts that you're having issues with w.r.t compatability?

    So firstly, the elephant in the room … why is there no example for FOTA using the external flash memory and the 54L part?

    Based on your configurations it seems to me that you've been following https://academy.nordicsemi.com/courses/nrf-connect-sdk-intermediate/lessons/lesson-9-bootloaders-and-dfu-fota/ to some extent at least. The reason for why the https://academy.nordicsemi.com/courses/nrf-connect-sdk-intermediate/lessons/lesson-9-bootloaders-and-dfu-fota/topic/exercise-5-fota-over-bluetooth-low-energy/ does not contain an external flash is because for the purpose of the academy courses we keep the samples as minimal as we can. This means that users will have to merge the exercise 3 containing steps for how to configure the external flash for DFU with the transport for FOTA that the user chooses. The only exception is the simultaneous DFU for the nRF5340 which requires external flash to work (mentioned at the bottom of Exercise 5). 

      

    This brings me to the reason for why your update image is not being loaded to the external flash; you're missing some configurations from exercise 3, which you can see here: https://github.com/NordicDeveloperAcademy/ncs-inter/blob/main/l9/l9_e3_sol/spi/sysbuild.conf, more specifically in steps 1-3 in https://academy.nordicsemi.com/courses/nrf-connect-sdk-intermediate/lessons/lesson-9-bootloaders-and-dfu-fota/topic/exercise-3-dfu-with-external-flash/  (select the SPI tab whenever you can for the nrf54L15

    This is where there is so much conflicting information on how to configure the flash for a 54L device and how to partition. Is the partition manager instruction applicable the 54 device?

    Could you point me to the conflicting information so I can bring the feedback to the authors and/or help you clarify any misunderstandings?

    Let me know if this clarifies the uncertainties for you.

    Kind regards,
    Andreas

  • Andreas ..Thank you for taking the time to respond. Much appreciated.

    I have been mainly following this youtube video by Nordic .. www.youtube.com/watch
    In addition, I have searched through many material looking for clues, but its difficult and confusing for a Nordic beginner to make sene of it all. A lot to take in and also to miss.
    Never the less, your comment are certainly helpful and some progress made, but also a step back that hopefully is simple to remedy.

    Changes made:

    Created a directory sysbuild.
    Inside sysbuild, created file mcuboot.conf and mcuboot.overlay

    mcuboot.conf has only ..
    CONFIG_GPIO=y
    CONFIG_NORDIC_QSPI_NOR=y

    mcuboot.overlay has only..

    &mx25r64 {
    status = "okay";
    };

    / {
    chosen {
    nordic,pm-ext-flash = &mx25r64;
    };
    };


    Then in sysbuild.conf, I comment out
    #SB_CONFIG_PARTITION_MANAGER=y
    and added
    SB_CONFIG_PM_EXTERNAL_FLASH_MCUBOOT_SECONDARY=y
    # Step 3.1 - For SPI, we need to set this
    SB_CONFIG_PM_OVERRIDE_EXTERNAL_DRIVER_CHECK=y

    This in accordance to Exercise 3: DFU with External Flash

    The moment I add SB_CONFIG_PM_EXTERNAL_FLASH_MCUBOOT_SECONDARY=y

    the mcuboot complile section fails with

    c:/ncs/toolchains/0b393f9e1b/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd.exe: zephyr/libzephyr.a(flash_map_partition_manager.c.obj):(.rodata.default_flash_map+0x1c): undefined reference to `__device_dts_ord_117'

    The memory map does look better and it is showing up the second boot image in Flash.. so thats good.
    Out of interest, if I leave out SB_CONFIG_PM_EXTERNAL_FLASH_MCUBOOT_SECONDARY=y, the entire project will compile, but when board is programmed, the app fails to run.

  • Aha, thank you for sharing. The webinars are great for that specific setup shown in the video/session, but they have a unfortunate side effect of not being too generic and easy to adapt. The academy pages are maintained atleast for every major release of the SDK so they should be up to date and work out of the box.

    Jasper_Golden said:
    but its difficult and confusing for a Nordic beginner to make sene of it all.

    I can understand this. There's a lot to grasp w.r.t Zephyr and NCS so the learning curve is unfortunately steep. If I would've given myself a "golden path" that I should follow if I had to start over again I would've said that the best approach is to go methodically through the academy courses, at least the following:

    1. Decide which SDK version you're working with. For instance if you're not going to use sysbuild, you will have to stick with NCS v2.6.x. If it doesn't really matter, start with the latest tagged release (currently NCS v3.0.2)
    2. Fundamentals NCS lesson 1, 2, 3, 4 and 5
    3. Intermediate NCS lesson 1, 2, 3, 8, and 9 and then maybe 7
    4. Any other lesson that contains peripherals that you will be using within these courses
    5. BLE fundamentals if you intend to have something BLE related on your application,
    Jasper_Golden said:
    c:/ncs/toolchains/0b393f9e1b/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd.exe: zephyr/libzephyr.a(flash_map_partition_manager.c.obj):(.rodata.default_flash_map+0x1c): undefined reference to `__device_dts_ord_117'

    Lesson 2 in the intermediate course would point you to how to debug this, i.e https://academy.nordicsemi.com/courses/nrf-connect-sdk-intermediate/lessons/lesson-2-debugging/topic/troubleshooting-the-devicetree/ and https://academy.nordicsemi.com/courses/nrf-connect-sdk-intermediate/lessons/lesson-2-debugging/topic/exercise-3/ 

    You can find which peripheral it is complaining about by going to build/<bootloader/zephyr/include/generated/zephyr/devicetree_generated.h and find the ID found in the error message. 

    I'm guessing that what it's compl

    aining about is the SPI peripheral, but I could be wrong. Could you check this file and see what it complains about?

    Jasper_Golden said:
    Out of interest, if I leave out SB_CONFIG_PM_EXTERNAL_FLASH_MCUBOOT_SECONDARY=y, the entire project will compile, but when board is programmed, the app fails to run.

    Without this configuration you will have a situation where you have an external flash set up and some of your companion images may or may not expect the secondary image to reside there, but you have not compiled MCUboot to use partition manager to state that the update image and thus the secondary partition should reside on the external flash. 

    Kind regards,
    Andreas

Reply
  • Aha, thank you for sharing. The webinars are great for that specific setup shown in the video/session, but they have a unfortunate side effect of not being too generic and easy to adapt. The academy pages are maintained atleast for every major release of the SDK so they should be up to date and work out of the box.

    Jasper_Golden said:
    but its difficult and confusing for a Nordic beginner to make sene of it all.

    I can understand this. There's a lot to grasp w.r.t Zephyr and NCS so the learning curve is unfortunately steep. If I would've given myself a "golden path" that I should follow if I had to start over again I would've said that the best approach is to go methodically through the academy courses, at least the following:

    1. Decide which SDK version you're working with. For instance if you're not going to use sysbuild, you will have to stick with NCS v2.6.x. If it doesn't really matter, start with the latest tagged release (currently NCS v3.0.2)
    2. Fundamentals NCS lesson 1, 2, 3, 4 and 5
    3. Intermediate NCS lesson 1, 2, 3, 8, and 9 and then maybe 7
    4. Any other lesson that contains peripherals that you will be using within these courses
    5. BLE fundamentals if you intend to have something BLE related on your application,
    Jasper_Golden said:
    c:/ncs/toolchains/0b393f9e1b/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd.exe: zephyr/libzephyr.a(flash_map_partition_manager.c.obj):(.rodata.default_flash_map+0x1c): undefined reference to `__device_dts_ord_117'

    Lesson 2 in the intermediate course would point you to how to debug this, i.e https://academy.nordicsemi.com/courses/nrf-connect-sdk-intermediate/lessons/lesson-2-debugging/topic/troubleshooting-the-devicetree/ and https://academy.nordicsemi.com/courses/nrf-connect-sdk-intermediate/lessons/lesson-2-debugging/topic/exercise-3/ 

    You can find which peripheral it is complaining about by going to build/<bootloader/zephyr/include/generated/zephyr/devicetree_generated.h and find the ID found in the error message. 

    I'm guessing that what it's compl

    aining about is the SPI peripheral, but I could be wrong. Could you check this file and see what it complains about?

    Jasper_Golden said:
    Out of interest, if I leave out SB_CONFIG_PM_EXTERNAL_FLASH_MCUBOOT_SECONDARY=y, the entire project will compile, but when board is programmed, the app fails to run.

    Without this configuration you will have a situation where you have an external flash set up and some of your companion images may or may not expect the secondary image to reside there, but you have not compiled MCUboot to use partition manager to state that the update image and thus the secondary partition should reside on the external flash. 

    Kind regards,
    Andreas

Children
  • Hello Andreas .. once again, thank you for your support here.


    I can confirm that 117 refers to the SPI Node as referenced in 3 places in file you pointed me to.

    ----------------------------------------------------------------
    117 /soc/peripheral@50000000/spi@4a000/mx25r6435f@0

    /* Ordinals for what depends directly on this node: */
    #define DT_N_S_soc_S_peripheral_50000000_S_spi_4a000_SUPPORTS_ORDS \
    117, /* /soc/peripheral@50000000/spi@4a000/mx25r6435f@0 */

    /* Node's dependency ordinal: */
    #define DT_N_S_soc_S_peripheral_50000000_S_spi_4a000_S_mx25r6435f_0_ORD 117
    #define DT_N_S_soc_S_peripheral_50000000_S_spi_4a000_S_mx25r6435f_0_ORD_STR_SORTABLE 00117
    ----------------------------------------------------------------

    Tried adding   mx25r64: mx25r6435f@0 {...........} node to overlay files .. did not help.


    Thank You
    Brian

  • Hi,

    Could you attach the full build log in a .txt here? I'm curious to see if the board file you mention are being picked up since you mention that you're using the Ezerio 54l15 kit

    Could you also zip a somewhat minimal project that I can have a look at and compare with the solution I have for the nRF54L15DK?

    Kind regards,
    Andreas

  • Hi Andreas.   

    The Ezerio point is of no concern  ... board selected is a standard Nordic board as per pic sent.    The compile fails, so not even able to program the board.   

    The zip file is a basic project downloaded via the new project/copy a sample.   Then changes added as per the tutorials found.   Chances are that I have missed something.

    Thank you

    Brian

     1200.peripheral_lbs_1.zip

  • Noted, thank you for clarifying

    I will look into the zip tomorrow (10th of July) and get back to you with (hopefully) something more constructive then

    Kind regards,
    Andreas

  • Hi again,

    I've had a brief look through your zip and I've created a sample for you that compiles, builds and flashes (tested on nrf54l15dk/nrf54l15/cpuapp)

    Sample goes through the booting process and starts advertising as expected

    And the partition manager sets up the secondary mcuboot partition for the update image on the SPI connected external flash device: 

    Please compare this sample to your solution and let me know if you're able to spot any differences between this zip and your project

    7_54l15_fota_ext.zip

    Kind regards,
    Andreas

Related