Hi Stanislav,
Can you please check if the issue described here https://developer.trustedfirmware.org/T234 is the same as you are reporting?
/George
-----Original Message----- From: TF-M tf-m-bounces@lists.trustedfirmware.org On Behalf Of Stanislav Jancik via TF-M Sent: 16 April 2019 13:21 To: tf-m@lists.trustedfirmware.org Subject: [TF-M] TF-M ARM GCC Optimization issue
Hi,
I am currently working on porting TF-M to our (NXP's) LPC55S69 platform. We have supported armclang compiler and we work on support of armgcc compiler. I found out, that the TF-M is working correctly only with optimization -O0 for secure code. I use "7 2018-q2-update" compiler.
For example, when optimization -O1 is set for secure code, the regression tests are running correctly until TFM_IPC_TEST_1XXX test suite. When I debugged this issue, I found out that function and arguments are not properly assigned in function tfm_core_ns_ipc_request (tfm_psa_api_client.c). When I updated this function so the variables int32_t args[4]; struct tfm_sfn_req_s desc, *desc_ptr = &desc; and nt32_t res; were global instead of local. The tests have started running correctly.
I so similar issue, when optimization was -Os, but only secure test suites run correctly in this case. I did not see such a behavior when I used armclang compiler.
Did you try to use different optimization at Musca boards as well?
Regards
Stanislav
tf-m@lists.trustedfirmware.org