Skip to main content
AChau.5
Associate
January 11, 2019
Question

FreeRTOS - Adding MPU support for tasks

  • January 11, 2019
  • 1 reply
  • 1028 views

Hi..

I am trying to test MPU support in FreeRTOS on STM32L476G-EVAL board.

In addition to common files like tasks.c, queue.c etc., I added below files for MPU support to my project.

1.) port.c (for ARM_CM4_MPU)

2.) mpu_wrappers.c

3) event_groups.c

And also modified linker file, adding modified memory layout needed by this port.c file for MPU configuration.

But, when i create a restricted task using "xTaskCreateRestricted" API, it crashes inside "prvAddNewTaskToReadyList".

What else am i missing , with regards to configuring FreeRTOS for MPU support for tasks.

Below is the stack for this crash (if it helps):

Thread #1 (Suspended : Signal : SIGTRAP:Trace/breakpoint trap)   

debugHardfault() at stm32l4xx_it.c:97 0x80042ae   

<signal handler called>() at 0xfffffff9   

prvAddNewTaskToReadyList() at tasks.c:1,030 0x8000c9e   

xTaskCreateRestricted() at tasks.c:663 0x8000e16   

MPU_xTaskCreateRestricted() at mpu_wrappers.c:104 0x80069b0   

main() at main.c:156 0x8004162

This topic has been closed for replies.

1 reply

Innomatic
Associate III
January 13, 2019

In my case of CubeMX v5.01, FreeRTOS does not work with the default setting. I created a new project with the selection of FreeRTOS only. Stil the StartDefaultTask() crashes (or stuck somewhere). Changing Timebase Source from SysTick to any other TIM does not help. Something about FreeRTOS seems to be broken after CubeMX v5