Quality RTOS & Embedded Software

 Real time embedded FreeRTOS RSS feed 
Quick Start Supported MCUs PDF Books Trace Tools Ecosystem


Setting compiler path to ARM_CM4_MPU showing error

Posted by xuccccc on August 9, 2017


I am currently using the stm32f446 for development. I found that there is the MPU support for it, I am tring to use the MPU function, but failed. The problme is after I chagned the complier path from GCC/AMRCM4F to GCC/ARMCM4MPU and compiled the code, it gave me the error: FreeRTOS/Source/portable/GCC/ARMCM4MPU/portmacro.h:176:96: error: '**portNVICPENDSVSET**' undeclared (first use in this function) #define portENDSWITCHINGISR( xSwitchRequired ) if( xSwitchRequired ) portNVICINTCTRLREG = portNVICPENDSVSET

However, the portNVICPENDSVSET is declared in the FreeRTOS/Source/portable/Tasking/ARMCM4F. As my understading this Tasking folder should be anohter complier, then it makes me comfusing.

It might be I am in the wrong way to use the FREEROTS MPU. I would ask is there anyboday who could provide me some ideasw how to use the MPU for M4?

Thanks a lot, Xu

Setting compiler path to ARM_CM4_MPU showing error

Posted by rtel on August 9, 2017

It is not clear what you are doing. The MPU port is a completely different port. To use it you need to remove all the non MPU port layer code and add in the MPU port layer code, then also update the include paths to ensure the portmacro.h is picked up from the MPU port layer.

Is that what you did?

I would recommend pulling the latest code from the public SVN repository on SourceForge as it contains some improvements to the MPU port.

Setting compiler path to ARM_CM4_MPU showing error

Posted by xuccccc on August 10, 2017

Thanks for your reply. I updated the FreeRTOS, remove all non MPU port layer code and update the include path to the MPU code. It's still not working. Now it shows the error: arm-none-eabi-ld: section privilegedfunctions LMA [000000000000a7a0,000000000000d39b] overlaps section .data LMA [000000000000a79b,000000000000ac3e] arm-none-eabi-ld: section privilegeddata LMA [000000000000ac40,000000000000ad7f] overlaps section privilegedfunctions LMA [000000000000a7a0,000000000000d39b] bin-vt8x8/cpu.o: In function reboot': /home/xu/dev/volaWare/stm32-common/cpu.c:168: undefined reference toMPUvTaskDelay' bin-vt8x8/port.o: In function vPortStoreTaskMPUSettings': /home/xu/dev/volaWare/module/FreeRTOS/Source/portable/GCC/ARM_CM4_MPU/port.c:769: undefined reference toSRAMsegmentstart' /home/xu/dev/volaWare/module/FreeRTOS/Source/portable/GCC/ARMCM4MPU/port.c:769: undefined reference to __SRAM_segment_end__' /home/xu/dev/volaWare/module/FreeRTOS/Source/portable/GCC/ARM_CM4_MPU/port.c:769: undefined reference toprivilegeddatastart' /home/xu/dev/volaWare/module/FreeRTOS/Source/portable/GCC/ARMCM4MPU/port.c:769: undefined reference to __privileged_data_end__' bin-vt8x8/port.o: In functionxPortStartScheduler': /home/xu/dev/volaWare/module/FreeRTOS/Source/portable/GCC/ARMCM4MPU/port.c:462: undefined reference to __FLASH_segment_start__' /home/xu/dev/volaWare/module/FreeRTOS/Source/portable/GCC/ARM_CM4_MPU/port.c:462: undefined reference toFLASHsegmentend' /home/xu/dev/volaWare/module/FreeRTOS/Source/portable/GCC/ARMCM4MPU/port.c:462: undefined reference to __privileged_functions_end__' /home/xu/dev/volaWare/module/FreeRTOS/Source/portable/GCC/ARM_CM4_MPU/port.c:462: undefined reference toprivilegeddatastart' /home/xu/dev/volaWare/module/FreeRTOS/Source/portable/GCC/ARMCM4MPU/port.c:462: undefined reference to __privileged_data_end__' bin-vt8x8/crc32.o: In functioncrc32lock': /home/xu/dev/volaWare/module/crc32/stm32/crc32.c:63: undefined reference to MPU_xQueueSemaphoreTake' bin-vt8x8/crc32.o: In functioncrc32unlock': /home/xu/dev/volaWare/module/crc32/stm32/crc32.c:76: undefined reference to MPU_xQueueGenericSend' bin-vt8x8/crc32.o: In functioncrc32init': /home/xu/dev/volaWare/module/crc32/stm32/crc32.c:203: undefined reference to MPU_xQueueCreateMutex' bin-vt8x8/init.o: In functionmainloop': /home/xu/dev/volaWare/arm-common/init.c:373: undefined reference to MPU_xTaskGetTickCount' /home/xu/dev/volaWare/arm-common/init.c:381: undefined reference toMPUvTaskDelete' bin-vt8x8/init.o: In function _init': /home/xu/dev/volaWare/arm-common/init.c:398: undefined reference toMPUxTaskCreate'

It seems some linker issue. Then is there any linker example for using the MPU code?

To make the things more clear. I would talk about what I really want to do. What I want to do is to replace the xTaskCreate() with xTaskCreateRestricted(), test and evaluate if this function can solve some problem, since I think in my code there is some memory corruption issue. The complier path for FreeRTOS I used before is ARMCM4F, which I think is not support xTaskCreateRestricted(), so I want to change it to ARMCM4_MPU. But I didn't make it work.

[ Back to the top ]    [ About FreeRTOS ]    [ Privacy ]    [ Sitemap ]    [ ]

Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.

Latest News

FreeRTOS v10.2.1 is available for immediate download. MIT licensed, includes 64-bit RISC-V, NXP Cortex-M33 demo & Nuvoton Cortex-M23 demo.

NXP tweet showing LPC5500 (ARMv8-M Cortex-M33) running FreeRTOS.

View a recording of the "OTA Update Security and Reliability" webinar, presented by TI and AWS.


FreeRTOS and other embedded software careers at AWS.

FreeRTOS Partners

ARM Connected RTOS partner for all ARM microcontroller cores

Cadence Tensilica Cortes

Espressif ESP32

IAR Partner

Microchip Premier RTOS Partner

RTOS partner of NXP for all NXP ARM microcontrollers





STMicro RTOS partner supporting ARM7, ARM Cortex-M3, ARM Cortex-M4 and ARM Cortex-M0

Texas Instruments MCU Developer Network RTOS partner for ARM and MSP430 microcontrollers

OpenRTOS and SafeRTOS

Xilinx Microblaze and Zynq partner