# FreeRTOS port for ARM M4, no FPU, no MPU

**URL:** <https://forums.freertos.org/t/freertos-port-for-arm-m4-no-fpu-no-mpu/7089>\
**Category:** Kernel\
**Created:** [March 28, 2018, 10:33am UTC](https://forums.freertos.org/t/freertos-port-for-arm-m4-no-fpu-no-mpu/7089 "2018-03-28T10:33:16Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![system](https://d2v6vdsk2p900z.cloudfront.net/original/1X/7fc8fdb729c645aab5b20282bbe34e57cb407be6.jpeg) [@system](https://forums.freertos.org/u/system)\
**Post date:** [March 28, 2018, 10:33am UTC](https://forums.freertos.org/t/freertos-port-for-arm-m4-no-fpu-no-mpu/7089/1 "2018-03-28T10:33:16Z")

</div>

**[dcrocker](https://sourceforge.net/u/dcrocker/)** wrote on [Wednesday, March 28, 2018](https://sourceforge.net/p/freertos/discussion/382005/thread/25989e7c/#22ca):

Does any one have version 10.0 port files for an ARM Cortex M4 without floating point or MPU? The files in the version 10 distribution include M4F and M4\_MPU but not plain M4. There is a version in Atmel Software Framework for the SAM4S chip that I need to target, but it’s for FreeRTOS version 7.

Alternatively, can someone tell me which bits of the M4F port files I need to strip out to support a M4 without FPU? The application needs to support M4F processors too, so adding conditionals to the M4F port files might be an attractive solution.

btw the application is open source 3D printer control firmware, see [https://github.com/dc42/RepRapFirmware](https://github.com/dc42/RepRapFirmware).

Thanks in advance - David

---

<div class="post-metadata">

**Author:** ![rtel](https://d3iykfbgfh8zhg.cloudfront.net/user_avatar/forums.freertos.org/rtel/32/31_2.png) [@rtel](https://forums.freertos.org/u/rtel)\
**Post date:** [March 28, 2018, 1:56pm UTC](https://forums.freertos.org/t/freertos-port-for-arm-m4-no-fpu-no-mpu/7089/2 "2018-03-28T13:56:19Z")

</div>

**[rtel](https://sourceforge.net/u/rtel/)** wrote on [Wednesday, March 28, 2018](https://sourceforge.net/p/freertos/discussion/382005/thread/25989e7c/#22ca/5609):

If you have a Cortex-M4 with floating point then use the port files in  
FreeRTOS/source/portable/[compiler]/ARM\_CM4F

If you have a Cortex-M4 without a floating point unit, or a Cortex-M3,  
then use the port files in FreeRTOS/source/portable/[compiler]/ARM\_CM3

---

<div class="post-metadata">

**Author:** ![system](https://d2v6vdsk2p900z.cloudfront.net/original/1X/7fc8fdb729c645aab5b20282bbe34e57cb407be6.jpeg) [@system](https://forums.freertos.org/u/system)\
**Post date:** [March 28, 2018, 3:50pm UTC](https://forums.freertos.org/t/freertos-port-for-arm-m4-no-fpu-no-mpu/7089/3 "2018-03-28T15:50:08Z")

</div>

**[dcrocker](https://sourceforge.net/u/dcrocker/)** wrote on [Wednesday, March 28, 2018](https://sourceforge.net/p/freertos/discussion/382005/thread/25989e7c/#56db):

Thanks, I didn’t know that the M4 without FP was compatible with M3 as far as FreeRTOS is concerned.

---

<div class="post-metadata">

**Author:** ![stephanhd](https://d3iykfbgfh8zhg.cloudfront.net/user_avatar/forums.freertos.org/stephanhd/32/1188_2.png) [@stephanhd](https://forums.freertos.org/u/stephanhd)\
**Post date:** [January 14, 2021, 12:19pm UTC](https://forums.freertos.org/t/freertos-port-for-arm-m4-no-fpu-no-mpu/7089/4 "2021-01-14T12:19:29Z")

</div>

Dear Richard and SAM4S-Users,  
I want to move our project from v9.0 (using the IAR/CM3 port) to most current 10 (202012.00) AND we are using the SAM4S which is a Cortex-M4 **with MPU** but **w/o FP**.

Is your 2018 response:  
“_If you have a Cortex-M4 without a floating point unit, or a Cortex-M3,_  
_then use the port files in FreeRTOS/source/portable/[compiler]/ARM\_CM3_”  
still valid?

This then includes the fact that use of the MPU in this specific CPU is not supported.  
Is this correct or is it worth to try the v10.4.3 IAR/CM4F\_MPU but "remove all the FP dependencies … " [i.e. “\_\_ARMVFP\_\_”] ?

Kind regards, Stephan

---

<div class="post-metadata">

**Author:** ![rtel](https://d3iykfbgfh8zhg.cloudfront.net/user_avatar/forums.freertos.org/rtel/32/31_2.png) [@rtel](https://forums.freertos.org/u/rtel)\
**Post date:** [January 14, 2021, 4:48pm UTC](https://forums.freertos.org/t/freertos-port-for-arm-m4-no-fpu-no-mpu/7089/5 "2021-01-14T16:48:07Z")

</div>

Do you want to use the MPU? If no, then yes the information is still valid you should just use the CM3 port.

---

<div class="post-metadata">

**Author:** ![stephanhd](https://d3iykfbgfh8zhg.cloudfront.net/user_avatar/forums.freertos.org/stephanhd/32/1188_2.png) [@stephanhd](https://forums.freertos.org/u/stephanhd)\
**Post date:** [January 15, 2021, 5:56am UTC](https://forums.freertos.org/t/freertos-port-for-arm-m4-no-fpu-no-mpu/7089/6 "2021-01-15T05:56:13Z")

</div>

> [@rtel](#):
>
> Do you want to use the MPU

YES:) I want to use the MPU!  
Meanwhile I checked that “ **ARMVFP** ” is used only as a “warning” message, not not elsewhere…  
So I could use the M4F\_MPU and remove the “ **ARMVFP** ” section - shouldn’t I?  
Best, Stephan

---

<div class="post-metadata">

**Author:** ![rtel](https://d3iykfbgfh8zhg.cloudfront.net/user_avatar/forums.freertos.org/rtel/32/31_2.png) [@rtel](https://forums.freertos.org/u/rtel)\
**Post date:** [January 15, 2021, 3:59pm UTC](https://forums.freertos.org/t/freertos-port-for-arm-m4-no-fpu-no-mpu/7089/7 "2021-01-15T15:59:42Z")

</div>

Why not use the ARM\_CM3\_MPU port if you don’t want the FPU supported?

---

<div class="post-metadata">

**Author:** ![stephanhd](https://d3iykfbgfh8zhg.cloudfront.net/user_avatar/forums.freertos.org/stephanhd/32/1188_2.png) [@stephanhd](https://forums.freertos.org/u/stephanhd)\
**Post date:** [January 15, 2021, 6:10pm UTC](https://forums.freertos.org/t/freertos-port-for-arm-m4-no-fpu-no-mpu/7089/8 "2021-01-15T18:10:05Z")

</div>

> [@rtel](#):
>
> Why not use the ARM\_CM3\_MPU port

a simple answer:  
there is **no** ARM\_CM3\_MPU in .\FreeRTOSv202012.00\FreeRTOS\Source\portable\IAR  
🙂  
Best, Stephan

---

<div class="post-metadata">

**Author:** ![rtel](https://d3iykfbgfh8zhg.cloudfront.net/user_avatar/forums.freertos.org/rtel/32/31_2.png) [@rtel](https://forums.freertos.org/u/rtel)\
**Post date:** [January 15, 2021, 9:53pm UTC](https://forums.freertos.org/t/freertos-port-for-arm-m4-no-fpu-no-mpu/7089/9 "2021-01-15T21:53:09Z")

</div>

Ah, ok. I was looking at the GCC directory. Would suggest diff’ing the two GCC versions to see what needs to be done. For the most part, it is removing lines of code, although take care in the context switch code where the push and pop multiple instructions use slightly different registers.
