MPU, Whether to modify xIsPrivileged() with FREERTOS_SYSTEM_CALL???

I have a problem in FreeRTOS Kernel V10.5.1。I encountered an error when calling the function vTaskDelay in a non-privileged task. Then I added the FREERTOS_SYSTEM_CALL modifier to the xIsPrivileged function. I think that there will be an error because xIsPrivileged is default in the privileged area, I don’t know if my understanding is correct or if I misunderstood something. I look forward to your reply

Hi @zouxiangqian
Welcome to the FreeRTOS Community Forums !
When calling vTaskDelay from a non-privileged task, the MPU wrapper MPU_vTaskDelay being a FREERTOS_SYSTEM_CALL temporarily grants the unprivileged task which calls the kernel API the privilege necessary to execute kernel code. See here for more info about system calls.

So, the error you encounter would not be resolved by making another system call through xIsPrivileged. You can make the function as freertos_system_calls, the error may occur in case there is overlap between the RAM regions during building the project.

Can you tell us what error you encountered during vTaskDelay
Also the latest MPU version for FreeRTOS Kernel is v11.1.0 with enhanced security features. If porting is possible, you can give this a try .

Please describe the error that you encountered.