Hi Alice_Yang !
Yes, I'm able quite freely to alocate code in both parts and use MPUs for configure "access windows" and etc.
But enforcing privilege check give a lot of code repartitioning and may be not so everything is clear for me yet.
Let's talk about simple case for non-secure part only.
I have privileged RTOS code and nonprivileged tasks code and nonprivileges library functions and also privileged ISR/SVC handlers.
All of them calls memcpy/memset functions what located in unprivileged code area by MPU and AHB matrix settings.
I have got impression , I should have privileged and nonprivileged copied of memset/memcpy.
If nonprivileged code would like to execute privileged ones, it can be done by SVC call.
But privileged can't execute nonprivileged code at all. Is this so ?
Similar problem coming with peripherals. I can use 1-2 peripherals in nonprivileged mode per RTOS task.
but not more, becouse limited amount of MPU sections. As result some peripherals can be accessed in SVC call only.
But in case of data , peripheral code can access privileged and nonprivileged data/peripherals. Is this so ?
Regards,
Eugene