Setup secure storage memory for data storage inside TFM

Hi,

We are working on nrf5340 board with NS and TF-M setup and we have SDK v2.7.0

We need to have a flash partition to store the some secure data may be a size of 4KB inside the TF-M.

Please help us or direct us to any reference.

Parents
  • Hi, any one please guide us through the setup please.

    I see they have an example psa_protected_storage. If I set any partition size to 1KB the example does not work, it just goes into  arch_system_halt().

    How can I modify the partition size?

  • Hi,

     

    You seem to have found an example that provides what you are looking for:

    Jithin A said:
    example psa_protected_storage.

    What exactly did you add here?

    Jithin A said:
    If I set any partition size to 1KB the example does not work, it just goes into  arch_system_halt().

    And what is the assert output? 

    I suspect that the data that you added is stacked memory. If yes, then try to adjust your CONFIG_MAIN_STACK_SIZE.

     

    If you want to store larger than 2k objects, you should adjust the CONFIG_TFM_PS_MAX_ASSET_SIZE. This can max. be 4020 due to overhead, and aligning to a flash page.

     

    Kind regards,

    Håkon

Reply
  • Hi,

     

    You seem to have found an example that provides what you are looking for:

    Jithin A said:
    example psa_protected_storage.

    What exactly did you add here?

    Jithin A said:
    If I set any partition size to 1KB the example does not work, it just goes into  arch_system_halt().

    And what is the assert output? 

    I suspect that the data that you added is stacked memory. If yes, then try to adjust your CONFIG_MAIN_STACK_SIZE.

     

    If you want to store larger than 2k objects, you should adjust the CONFIG_TFM_PS_MAX_ASSET_SIZE. This can max. be 4020 due to overhead, and aligning to a flash page.

     

    Kind regards,

    Håkon

Children
Related