Quality RTOS & Embedded Software

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


dynamically generated structure object's address to memory regions of a restricted task criation in MPU mode

Posted by bhaveshshah2310 on February 26, 2015

I am here trying to make project where i create some different tasks are intersecting with different peripherals and isolate those tasks for memory usage using MPU in freeRTOS on LPC 1769, when i open a peripheral say UART or I2C there a structure object is been generated related to that peripheralcontrolt as it is done by FreeRTOS+IO framework.

Now my object is been created and the address is returned by FreeRTOS_open api now i want to use those address in creating a ristrected task using xTaskCreateRestricted, As i use this handler as in starting point of any region it gives me error like its not constant.

how do i solve this problem ? how can i pass memory space generated at run time as this FreeRTOS_open api is been called at starting of main() and then give them in such restricted tasks are been created after that.

I am bit confused over here.

dynamically generated structure object's address to memory regions of a restricted task criation in MPU mode

Posted by rtel on February 27, 2015

I can't recall without checking the code, which I can't do right now, but you might find that the structure is not allocated in one go. For example, if a structure is allocated, but that structure contains a semaphore, then the semaphore will have been allocated separately and therefore not necessarily be in the region you are defining for the MPU. If that were the case then you may be able to access the containing structure without a problem, but get a memory fault when the semaphore is allocated inside the structure.

Also the MPU does not allow fine grained memory regions to be defined, I think they have to be a power of two (can't quite remember) so you could not define one just for the allocated structure with including a lot of unused RAM in the region allocated to the MPU.


[ 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 & STM32H745 dual core (AMP) 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