This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

nRF9160 non-secure app flash partition

I am building an non-secure app and have a few questions.

1. Looking at the DTS file for pca10090 the partition table has both non-secure and secure slots for mcuboot. Totalling 4 slots. The way I understand it mcuboot treats the entire application as one thing, so shouldn't it be possible to combine SPM + APP in a single image and put that in a single partition for mcuboot to use?

Another question is regarding the SPM. I understand *how* it works, but I don't see much being done by the SPM that is currently provided. It only configures the secure peripherals/regions and provides a few basic services (reset, random, etc.).

2. Can we add our own services? Can we reduce the 64K RAM it needs and free some of it up for the application?


3. bsdlib documentation defines BSD_RESERVED_MEMORY_SIZE, which seems to be the SRAM used by BSD. In the latest bsdlib this is far less than the 128KB that is actually allocated for it in the dts. Is this something different? Can we reduce that 128KB to be closer to this value without any issues?

Parents
  • Hi,

    1) You need the 4 slots for the DTS, but I think MCUBoot stills treats SPM+APP as a single image, i.e. both is under "mcuboot_primary_app"

    E.g. here is the rom_report for the aws_fota sample:

    2)

    Can we add our own services?

    Yes.

    Can we reduce the 64K RAM it needs and free some of it up for the application?

    You might be able to reduce it a bit, but as far as I know it's not only SPM that uses this RAM section, the MCUBoot also uses this section.

    3)

    In the latest bsdlib this is far less than the 128KB that is actually allocated for it in the dts. Is this something different? Can we reduce that 128KB to be closer to this value without any issues?

    BSDlib does not use 128K RAM. By default 64K RAM is allocated for it(sram0_bsd). Looking at the BSDlib documentation, at this link, it's mentioned that the leftover memory in the seventh block (8160 bytes, starting at address 0x2001 c020) is configured as non-secure, but it can be used by the application.

  • Thank you.

    As follow-up, I noticed that the values in DTS are ignored by pm.yml and that different values are used, per the defines in KConfig for multi-image build positions. Why is that?!

Reply Children
Related