Porting Cortex-M4 with MPU


I am trying to port M4 with MPU using the GCC\CM4_MPU port. It seems everything is alright, but a linker error appears.

(mpu_wrappers_v2_asm.o): In function `MPU_xTaskDelayUntil':
C:\development\code\predevelopmnet\FreeRTOS\build\debug/..\..\Components\FreeRTOS\Kernel\portable\GCC\ARM_CM4_MPU/mpu_wrappers_v2_asm.c:55: undefined reference to `MPU_xTaskDelayUntilImpl'

The same error for TaskDelay, TaskPriorityGet ent, etc.

Hello, isnt there a CM3_MPU port that you can use as a reference? I believe (the developers would correct me if I am wrong on this one) that’s what was recommended for both the CM3 AND CM4 since the MPU is pretty much identical (as I seem to recall the discussion) based microcontrollers here on the forum.


Hi @tgrigorov
INCLUDE_xTaskDelayUntil should be set to 1 in FreeRTOSConfig.h, for MPU_xTaskDelayUntilImpl to be defined, could you confirm if that is set in the config file.
Similar scenarios for the other APIs you mentioned
INCLUDE_vTaskDelay for MPU_vTaskDelayImpl
INCLUDE_vTaskPrioritySet for MPU_vTaskPrioritySet

Hi @karahulx,
Yes, I set them in the config file. It’s turned out that, in addition to the CM4 MPU port should be added portable/Common/mpu_wrappers.c, mpu_wrappers_v2.c. I missed that step, migrating from the CM4F port to MPU.
Thanks for the help!