Background:
Synced to the latest TF-M:
This commit works Okay:
93dabfd3a35faf9ed88285e09997491e93cefa5c
But these two commits caused the problem:
5248af2d7b86775364a0e131eb80ac0330bc81fb
490281df3736b11b62e25bc98d3e2c6e4e10478c
There is a known issue in these two patches, which accesses the privileged string table and function for printing the message. And here is the fix:
cba90782908626f955fe361f803558181a85c6fc
After switching into the latest commit, looks like the memmanage fault happens on push {r0, r1}.
Analysis
It looks like a memory accessing fault, in general, can be caused by two reasons:
- NSPM uses ARM_LIB_STACK as working stack, check if the 'sp' equals ARM_LIB_STACK, and ARM_LIB_STACK is put with npriv rw.
- R0 contains an invalid value. R0 should hold the non-secure entry address, this value is been set in:
secure_fw\spm\spm_api_ipc.c:580:tfm_spm_init 578: if (partition->static_data->partition_id == TFM_SP_NON_SECURE_ID) { 579: p_ns_entry_thread = pth; 580: pth->param = (void *)tfm_spm_hal_get_ns_entry_point(); 581: }
Please check these two places to see if the value in R0 is correct or memory attribute is okay.