Quality RTOS & Embedded Software

 Real time embedded FreeRTOS RSS feed 
Real time embedded FreeRTOS mailing list 
Quick Start Supported MCUs PDF Books Trace Tools Ecosystem TCP & FAT Training




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 ]    [ Sitemap ]    [ ]




Copyright (C) 2004-2010 Richard Barry. Copyright (C) 2010-2016 Real Time Engineers Ltd.
Any and all data, files, source code, html content and documentation included in the FreeRTOSTM distribution or available on this site are the exclusive property of Real Time Engineers Ltd.. See the files license.txt (included in the distribution) and this copyright notice for more information. FreeRTOSTM and FreeRTOS.orgTM are trade marks of Real Time Engineers Ltd.

Latest News:

FreeRTOS V9.0.0 is now available for download.


Free TCP/IP and file system demos for the RTOS


Sponsored Links

⇓ Now With No Code Size Limit! ⇓
⇑ Free Download Without Registering ⇑


FreeRTOS Partners

ARM Connected RTOS partner for all ARM microcontroller cores

Renesas Electronics Gold Alliance RTOS Partner.jpg

Microchip Premier RTOS Partner

RTOS partner of NXP for all NXP ARM microcontrollers

Atmel RTOS partner supporting ARM Cortex-M3 and AVR32 microcontrollers

STMicro RTOS partner supporting ARM7, ARM Cortex-M3, ARM Cortex-M4 and ARM Cortex-M0

Xilinx Microblaze and Zynq partner

Silicon Labs low power RTOS partner

Altera RTOS partner for Nios II and Cortex-A9 SoC

Freescale Alliance RTOS Member supporting ARM and ColdFire microcontrollers

Infineon ARM Cortex-M microcontrollers

Texas Instruments MCU Developer Network RTOS partner for ARM and MSP430 microcontrollers

Cypress RTOS partner supporting ARM Cortex-M3

Fujitsu RTOS partner supporting ARM Cortex-M3 and FM3

Microsemi (previously Actel) RTOS partner supporting ARM Cortex-M3

Atollic Partner

IAR Partner

Keil ARM Partner

Embedded Artists