Hi,
I am finding one weird issue while the task get scheduled. Appreciate any help in this regard.
I am using FreeRTOS v10.4.3 MPU port on ARM v8 M55 based system. Here is the code snippet to create task:
void create_task(struct thread_attr *attr)
{
. . .
TaskParameters_t task_cfg_params =
{
.pvTaskCode = (TaskFunction_t)attr->entrypoint,
.pcName = arrt->name,
.usStackDepth = (attr->stack_size / sizeof(StackType_t)),
.pvParameters = arg,
.uxPriority = 0x80000000U | attr->priority,
.puxStackBuffer = (StackType_t *)attr->stack_addr,
.xRegions =
{
{(void *)__heap_start__, /* 32 byte aligned */
heap_size, /* multiple of 32 bytes */
tskMPU_REGION_READ_WRITE},
{0, 0, 0},
{0, 0, 0},
}
};
xRunningPrivileged = xPortRaisePrivilege();
ret = xTaskCreateRestricted(&(task_cfg_params), (TaskHandle_t *)thread_id);
vPortResetPrivilege( xRunningPrivileged );
}
If task stack (stack_addr) is reserved in “privileged_data” section, task gets scheduled perfectly. However, if stack buffer is allocated in any other data section (say, heap or bss), a fault occurs during the MPU configuration when the particular task gets scheduled.
Here are few configs defined in FreeRTOSConfg.h:
configENABLE_MPU = 1
configENABLE_TRUSTZONE = 0
configRUN_FREERTOS_SECURE_ONLY = 1
configSUPPORT_STATIC_ALLOCATION = 1
configSUPPORT_DYNAMIC_ALLOCATION = 1
etc.
Could some one point me what I am missing?
Thanks and regards,
Sandip