Dear All,
I'm willing to set up a project based on the nRF9160, using the Trustzone. Thus, I have two firmwares, two zephyrs that will run in Secure and Non Secure memories as defined by SPU configuration. My problem appears when in both firmwares I have to use the "k_busy_wait" or "k_sleep".
In fact, Zephyr during it's early initialization phases, has to configure the RTC and CLOCK peripherals. So when the Secure Firmware starts first, no problem. I can use the mentioned delay functions. Before switching to Non Secure Firmware, I must configure those two peripherals as Non Secure (in SPU config) for the Non Secure Zephyr initialization to succeed. If I don't it crashes as the RTC and CLOCK peripherals won't be configurable.
So I do configure them a Non Secure, but my issue is that if I call back a Secure service from Non Secure (using veneers), a Secure service that use "k_sleep" or "k_busy_wait", it will crash as the RTC / CLOCK peripheral has changed its state to Non Sec in SPU.
How should I manage such issue ?
I tried the configure the RTC / CLOCK with SPU_PERIPHID_PERM_SECUREMAPPING_Split but it does not work neither.
Any hint ?
Thanks.