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.
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.
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
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
Hi Håkon Alseth,
Thank you for the response, please see below comments.
What exactly did you add here?
--> Nothing, plain example as is.
And what is the assert output?
--> Reason holds 2
I suspect that the data that you added is stacked memory. If yes, then try to adjust your CONFIG_MAIN_STACK_SIZE.
--> I don't think so, the data is a string with only 20-30 chars defined global which I believe is not stacked.
I just adjusted the partition size to be 1000 instead and nothing else changed.
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.
--> Yet the same result. For reference I have attached the logs screenshot.
You can see it's not able execute the application.
Please let me know if my setup is wrong or missing something.
Thank you.
Hi,
Jithin A said:I just adjusted the partition size to be 1000 instead and nothing else changed.
Can you share your changes?
Kind regards,
Håkon
Hi,
PFA for the file you requested.
I have added a macro: SIZE_OF_TEST_STRING_1 in which I am modifying the partition size when setting.
Please correct me if my understanding is wrong.
Thank you.
Hi,
By changing the sizeof, it does not make the string any larger. You are effectively reading outside of the pointer. This also uses stack memory, as it declares a char array of size 1000, so you will need to adjust the main stack size, as previously mentioned.
I would recommend that you instead declare a static/global array of your wanted size and store that.
Kind regards,
Håkon
Thank you for the quick response, let me try and get back to you shortly.