Utilize external flash with nrf9160 SiP on Custom board.

Hi,

I would like to use the external flash to increase the internal flash, no intention, at the moment, to use it for MCUBoot file or FOTA .

How do I configure it, if it is even possible.

Info:

- nRF Connect SDK: 2.0.0

- nrf9160 SiP on custom board.

- Flash commuincate over SPI.

- Flash is working.

Thanks in advance.

Parents
  • DevZone does not let me reply inline to the last comment, so I reply in the "top" instead.

    Replay said:
    I have not found anything that is giving me an idea of why it should not work.

    If you upload these files, I can have a look myself.
    Also include the same files for the application alone (since it works).

    Replay said:
    boards/arm/customBoard_nrf9160/c

    If you post the board folder, I can have a look at this as well.

    If you do not want to upload your files in a public case, you can just create a new private ticket for these, and then   and I will find it.

    Do you have a nRF9160DK?
    Cause if you do, we can try to reproduce for the DK and then I can have a similar project on my end.

    Replay said:
    and I'm totally lost on the cause for this failure.

    This case is approaching the point where I struggle to help without being able to reproduce.
    If you have an extra custom PCB laying around, you can ship it to me, and I can reproduce the issue here.
    This way, I can use the experience and tools I got at my disposal to debug this issue.
    Let me know if you want this, and I will send you my shipping info on your DevZone-registered email.

    Regards,
    Sigurd Hellesvik

  • Hi Sigurd

    I really appreciate the support.

    There has been a development in the situation. I cannot explain how but the mcuboot secondary image is now placed in external flash and the user app is being booted.

    The problem is now that im getting this on boot:

     

    *** Booting Zephyr OS build v3.1.99-ncs1-2  ***
    I: Starting bootloader
    W: Failed reading sectors; BOOT_MAX_IMG_SECTORS=256 - too small?
    W: Cannot upgrade: not a compatible amount of sectors
    I: Bootloader chainload address offset: 0x10000
    I: Jumping to the first image slot
    *** Booting Zephyr OS build v3.1.99-ncs1-2  ***
    
    ... Main app started ...

    Maybe this can be solved with a easy setting?

    I have tried increasing CONFIG_BOOT_MAX_IMG_SECTORS=512.

    - Replay

  • "W: Failed reading sectors; BOOT_MAX_IMG_SECTORS=256 - too small?"

    The error messages for this are not very exact.

    This means one of two things:

    • CONFIG_BOOT_MAX_IMG_SECTORS is too small
    • The flash driver for this slot is not detected
      • This means that your external flash configuration for the MCUboot child image is wrong somehow

    In your case, I guess it is the latter.

    To configure the external flash inside the MCUboot child image, see https://github.com/nrfconnect/sdk-nrf/tree/main/tests/modules/mcuboot/external_flash, and its child_image folder.

    Regards,
    Sigurd Hellesvik

  • Update.

    Okay, I got it to work on NCS 2.1.3 but only if I change cmake/partition_manager.cmake L215 to DEVICE "DT_CHOSEN(nordic_pm_ext_flash)"

    My next idea was to update to NCS 2.3.0, but now I'm back to user app never starts.

    What has changed regarding MCUboot form 2.1.3 to 2.3.0?

    - Replay

  • Replay said:
    What has changed regarding MCUboot form 2.1.3 to 2.3.0?

    v2.1.3: MCUboot revision: v1.9.99-ncs2

    v2.3.0: MCUboot revision: v1.9.99-ncs4

    Comparing these two MCUboot tags: https://github.com/nrfconnect/sdk-mcuboot/compare/v1.9.99-ncs2...v1.9.99-ncs4

    Have you debugged the issue any more since the last comment?

    Regards,
    Sigurd Hellesvik

  • Thank you for your help.

    Have you debugged the issue any more since the last comment?

    No, I have stopped trying finding the issue. Everything works fine in SDK v2.2.0, so I'm not upgrading SDK any further.

    Recap to everyone who finds the thread:

    - Nrf9160 with external flash (SPI_NOR).

    - Cannot use the external flash for storing mcuboot_secondary when using NCS v2.1.3 and below. Without change to the SDK. 

    - NCS v2.2.0 seems to get everything working.

    - NCS v2.3.0 have some changes that break my boot sequence, I have not found a way to fix this.

Reply
  • Thank you for your help.

    Have you debugged the issue any more since the last comment?

    No, I have stopped trying finding the issue. Everything works fine in SDK v2.2.0, so I'm not upgrading SDK any further.

    Recap to everyone who finds the thread:

    - Nrf9160 with external flash (SPI_NOR).

    - Cannot use the external flash for storing mcuboot_secondary when using NCS v2.1.3 and below. Without change to the SDK. 

    - NCS v2.2.0 seems to get everything working.

    - NCS v2.3.0 have some changes that break my boot sequence, I have not found a way to fix this.

Children
No Data
Related