Quality RTOS & Embedded Software

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


Loading

Freertos-mpu with cortex m3

Posted by Marwa gdoura on April 8, 2010
Hi all,

I'm developing a project with freertos-mpu v6.0.0 on STM32 (mcu based on cortex m3) with IAR 5.4 compiler.
I noticed that the parameters "portPRIVILEGE_BIT" of the function "xTaskCreateRestricted" has no effect.
Example : I created a task in user mode, but this stack is always able to access all region even the privileged one.
Please correct me if I'm wrong.

Thank you in advance,
Marwa.

RE: Freertos-mpu with cortex m3

Posted by Richard on April 8, 2010
Can you post the function call used to create the task, and the structure passed into the function call. Thanks.

Regards.

RE: Freertos-mpu with cortex m3

Posted by Marwa gdoura on April 8, 2010
Hi,
Thank you for your quick answer.
Below is the function call:

static const xTaskParameters xUSARTTASKParameters =
{
prvUSARTTASKParameters,
( signed char * ) "TASK",
configMINIMAL_STACK_SIZE,
( void * ) 0x12345678,
(tskIDLE_PRIORITY + 2 ) ,
xUSARTTASKStack,
{/* Base addressLengthParameters */
{cPrivilegedOnlyAccessArray, mainPRIVILEGED_ONLY_ACCESS_ALIGN_SIZE, portMPU_REGION_PRIVILEGED_READ_ONLY },
{ 0x00,0x00,0x00 },
{ 0x00,0x00,0x00 }
}
};

void main (void)
{
xTaskCreateRestricted( &xUSARTTASKParameters, NULL );
}

static void prvUSARTTASKParameters( void *pvParameters )
{

for( ;; )
{


cPrivilegedOnlyAccessArray[ 0 ] = 'a';
}
}


Your help is much appreciated,
Regards,
Mariamario.

RE: Freertos-mpu with cortex m3

Posted by Richard on April 8, 2010
I cannot see where you are using portPRIVILEGE_BIT in this code, but presume this is because you are trying to create a User mode task, as per your original post. Also, I cannot see where you are starting the scheduler, but assume this is just because you have cut the code out to post it here.

Hang on - you said an STM32? The only STM32 devices I know of that have an MPU are the ones that were announced last month. Does your STM32 have an MPU at all? That would explain the problem.

Regards.

RE: Freertos-mpu with cortex m3

Posted by Marwa gdoura on April 9, 2010
Hi,

Yes, my board has an MPU, I have an STM32F103ZG board.
The task I'm creating is in user mode, that's why I didn't put the "portPRIVILEGE_BIT".
The problem is that despite that this task is created in user mode, it can access the previliged regions.
the scheduler is staretd in the main function (after creating all tasks). It contains the MPU setup.

Thns in advance,
Mariamario


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


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

Latest News

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

Meet Richard Barry and learn about running FreeRTOS on RISC-V at FOSDEM 2019

Version 10.1.1 of the FreeRTOS kernel is available for immediate download. MIT licensed.

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


Careers

FreeRTOS and other embedded software careers at AWS.



FreeRTOS Partners

ARM Connected RTOS partner for all ARM microcontroller cores

Espressif ESP32

IAR Partner

Microchip Premier RTOS Partner

RTOS partner of NXP for all NXP ARM microcontrollers

Renesas

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