cortex-r5 MPU task with xilinx FreeRTOS BSP

Thans for yesterday’s help, Richard. I encountered a new problem when I try to do memset(addr, 0, size)in my nomal task, and addr is a pointer to physical addresss0x1000 0000 that is a DDR4 address. Of cource I failed and the previous value in ddr did not change. I think it is MPU cause this issue so I wanted to build a MPU task with API function xTaskCreateRestricted, and then I found that xTaskCreateRestricted is an implicit function because portUSINGMPUWRAPPERS is zero in mpu_wrappers.h. and I checked this record https://sourceforge.net/p/freertos/discussion/382005/thread/85ea3529/?limit=25#d985/b6fa/2a7a/c241/7acd . So I set portUSINGMPUWRAPPERS to 1 and defined vPortResetPrivilege() in my portmacro.h files, I am not sure if it works because a new problem appeared after I set portUSINGMPUWRAPPERS to 1—unknown type name ‘xMPU_SETTINGS’ . I think I can google the definetion for xMPU_SETTINGS and add it to my file, but I wonder whether it is right. I doubt that FreeRTOS did not provide MPU for ARM R5 processor? My compile tool is xilinx SDK and processor is ARM Cortex-R5, and I build FreeRTOS source file in BSP acording to https://www.freertos.org/RTOS-Xilinx-SDK-BSP.html.

cortex-r5 MPU task with xilinx FreeRTOS BSP

Unfortunately the FreeRTOS download does not contain an MPU port for the R5, although from your description it doesn’t sound like an MPU issue in any case. If it were an MPU issue I would expect you would get a memory protection fault, but your post didn’t say that was happening. I don’t think this a FreeRTOS issue.

cortex-r5 MPU task with xilinx FreeRTOS BSP

I think part of the issue is you don’t create an MPU port by just setting portUSINGMPUWRAPERS to 1. You need the code that actually uses the MPU, and if FreeRTOS doesn’t have an MPU port for the R5, which seems to be what Richard B is saying, The solution would be to look at similar MPU ports and add the needed definitons to match that processor into the port files.

cortex-r5 MPU task with xilinx FreeRTOS BSP

I think you were right and that was indeed nothing to do with MPU. mm… I found I misstoke the address when I checked my code again (I give it 0xE000 0000 but not 0x1000 0000), anyway, thanks for help me correct my fault.