# How to build a port of freeRTOS for MPU with TI Code Composer Studio?

**URL:** <https://forums.freertos.org/t/how-to-build-a-port-of-freertos-for-mpu-with-ti-code-composer-studio/21190>\
**Category:** Texas Instruments\
**Created:** [August 13, 2024, 8:10pm UTC](https://forums.freertos.org/t/how-to-build-a-port-of-freertos-for-mpu-with-ti-code-composer-studio/21190 "2024-08-13T20:10:00Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![eric-wu](https://avatars.discourse-cdn.com/v4/letter/e/5fc32e/32.png) [@eric-wu](https://forums.freertos.org/u/eric-wu)\
**Post date:** [August 13, 2024, 8:10pm UTC](https://forums.freertos.org/t/how-to-build-a-port-of-freertos-for-mpu-with-ti-code-composer-studio/21190/1 "2024-08-13T20:10:00Z")

</div>

Hi,

I am currently working in TI Code Composer Studio (CCS), and I’ve built a small project using freeRTOS by downloading the freeRTOS kernel source code (v20240601), copying it into the CCS project, and configuring include paths as needed.

When choosing a port of freeRTOS, I chose portable/CCS/ARM\_CM4F. This port compiles with the CCS compiler, however, it does not support usage of the MPU. Are there any examples of using freeRTOS on the TI Tiva Series chips and also enabling the MPU?

I have also tried using a port such as portable/GCC/ARM\_CM4\_MPU, but the kernel code in this port does not compile, since CCS does not use the gcc compiler.

I am using the TM4C129ENCPDT microcontroller, which does have a hardware MPU. Is it true that I must use GCC if I want to use a freeRTOS port which supports the MPU?

---

<div class="post-metadata">

**Author:** ![karahulx](https://d3iykfbgfh8zhg.cloudfront.net/user_avatar/forums.freertos.org/karahulx/32/4893_2.png) [@karahulx](https://forums.freertos.org/u/karahulx)\
**Post date:** [August 13, 2024, 10:38pm UTC](https://forums.freertos.org/t/how-to-build-a-port-of-freertos-for-mpu-with-ti-code-composer-studio/21190/2 "2024-08-13T22:38:37Z")

</div>

Hi @eric-wu  
Welcome to the FreeRTOS Community Forums.  
We have 2 examples of FreeRTOS for MPU with CCS:

1. [FreeRTOS/FreeRTOS/Demo/CORTEX\_MPU\_R4F\_TI\_RM46\_HERCULES\_GCC at main · FreeRTOS/FreeRTOS · GitHub](https://github.com/FreeRTOS/FreeRTOS/tree/main/FreeRTOS/Demo/CORTEX_MPU_R4F_TI_RM46_HERCULES_GCC)
2. [FreeRTOS/FreeRTOS/Demo/CORTEX\_MPU\_R5F\_TI\_RM57\_HERCULES\_GCC at main · FreeRTOS/FreeRTOS · GitHub](https://github.com/FreeRTOS/FreeRTOS/tree/main/FreeRTOS/Demo/CORTEX_MPU_R5F_TI_RM57_HERCULES_GCC)

Both of these demos can be built using CCS and are using the [GCC/ARM\_CRx\_MPU](https://github.com/FreeRTOS/FreeRTOS-Kernel/tree/53c7e7c46f20dbd941d3f17116725d8fda9e6b90/portable/GCC/ARM_CRx_MPU) port.  
You can look at these for reference and let us know if you have any more questions.

Thanks.

---

<div class="post-metadata">

**Author:** ![aggarg](https://d3iykfbgfh8zhg.cloudfront.net/user_avatar/forums.freertos.org/aggarg/32/4245_2.png) [@aggarg](https://forums.freertos.org/u/aggarg)\
**Post date:** [August 14, 2024, 5:50am UTC](https://forums.freertos.org/t/how-to-build-a-port-of-freertos-for-mpu-with-ti-code-composer-studio/21190/3 "2024-08-14T05:50:22Z")

</div>

> [@eric-wu](#):
>
> I have also tried using a port such as portable/GCC/ARM\_CM4\_MPU, but the kernel code in this port does not compile, since CCS does not use the gcc compiler.

You are right that we do not have a CCS port for Cortex-M4 with MPU support.

> [@eric-wu](#):
>
> Is it true that I must use GCC if I want to use a freeRTOS port which supports the MPU?

Using GCC is one option and I think you can still use the CCS as your IDE. Do you not want to use GCC?.

---

<div class="post-metadata">

**Author:** ![eric-wu](https://avatars.discourse-cdn.com/v4/letter/e/5fc32e/32.png) [@eric-wu](https://forums.freertos.org/u/eric-wu)\
**Post date:** [August 14, 2024, 3:37pm UTC](https://forums.freertos.org/t/how-to-build-a-port-of-freertos-for-mpu-with-ti-code-composer-studio/21190/4 "2024-08-14T15:37:31Z")

</div>

Ah, thanks.

I was hoping there was some way to use the CCS compiler, since I was having issues installing the GCC add-on in CCS. I have asked on the TI forums for help resolving my GCC install issues.
