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

Weird flash usage report while using TF-M

Hi!

If I build my project with TF-M I noticed that at least the flash usage report differs dramatically compared to the original firmware:

Original:

Memory region | Used Size | Region Size | %age Used
        FLASH:   206060 B      409088 B      50.37%
         SRAM:    83760 B      178968 B      46.80%

With TF-M enabled:

Memory region | Used Size | Region Size | %age Used
        FLASH:   193676 B        208 KB      90.93%
         SRAM:    79024 B      178968 B      44.16%

The actual firmware size makes sense so far and both variants boot fine. My expectation was that the sections should be more or less identical.

Regards

Caspar

Parents
  • For my understanding the partitions should look like this (DT exerpt):

    boot_partition: partition@0 {
        label = "mcuboot";
        reg = < 0x0 0x10000 >;
    };
    slot0_partition: partition@10000 {
        label = "image-0";
        reg = < 0x10000 0x50000 >;
    };
    slot0_ns_partition: partition@50000 {
        label = "image-0-nonsecure";
        reg = < 0x60000 0x20000 >;
    };
    slot1_partition: partition@80000 {
        label = "image-1";
        reg = < 0x80000 0x50000 >;
    };
    slot1_ns_partition: partition@c0000 {
        label = "image-1-nonsecure";
        reg = < 0xd0000 0x20000 >;
    };

    But regardless of what I put in here, I the ns-partition size is always 208 kB (aka 0x34000). This matches what I can see in pm_config.h but can't see where those values come from.

Reply
  • For my understanding the partitions should look like this (DT exerpt):

    boot_partition: partition@0 {
        label = "mcuboot";
        reg = < 0x0 0x10000 >;
    };
    slot0_partition: partition@10000 {
        label = "image-0";
        reg = < 0x10000 0x50000 >;
    };
    slot0_ns_partition: partition@50000 {
        label = "image-0-nonsecure";
        reg = < 0x60000 0x20000 >;
    };
    slot1_partition: partition@80000 {
        label = "image-1";
        reg = < 0x80000 0x50000 >;
    };
    slot1_ns_partition: partition@c0000 {
        label = "image-1-nonsecure";
        reg = < 0xd0000 0x20000 >;
    };

    But regardless of what I put in here, I the ns-partition size is always 208 kB (aka 0x34000). This matches what I can see in pm_config.h but can't see where those values come from.

Children
Related