FreeRTOS Support Archive
The FreeRTOS support forum is used to obtain active support directly from Real
Time Engineers Ltd. In return for using our top quality software and services for
free, we request you play fair and do your bit to help others too! Sign up
to receive notifications of new support topics then help where you can.
This is a read only archive of threads posted to the FreeRTOS support forum.
The archive is updated every week, so will not always contain the very latest posts.
Use these archive pages to search previous posts. Use the Live FreeRTOS Forum
link to reply to a post, or start a new support thread.
[FreeRTOS Home] [Live FreeRTOS Forum] [FAQ] [Archive Top] [November 2012 Threads] MPU and xTaskCreate(): errorPosted by Artem Pisarenko on November 1, 2012 FreeRTOS API documentation, function xTaskCreate() states that this function may be used with FreeRTOS-MPU: “... Using xTaskCreate() with FreeRTOS-MPU allows tasks to be created to run in either Privileged or User modes (see the description of uxPriority below). When Privileged mode it used the task will have access to the entire memory map, when User mode is used the task will have access to only its stack. ...” It's wrong. In this case MPU region for task stack isn't being set up which causes task created in user mode crash system immediately after scheduler start.
RE: MPU and xTaskCreate(): errorPosted by Richard on November 1, 2012 “ It's wrong. In this case MPU region for task stack isn't being set up which causes task created in user mode crash system immediately after scheduler start.” I have just stepped through the code, and am not sure the statement is right either, as a very quick look appears to show unprivileged tasks being given access to all unprivileged RAM not just the stack. However, I'm not sure your statement is correct either as I can create a task using xTaskCreate() and step into the task without a problem. I do get an MPU fault, but it is from the check task, which is privileged anyway so it is curious. I will need to look at that more, but have an urgent job to complete first. Regards.
RE: MPU and xTaskCreate(): errorPosted by Artem Pisarenko on November 1, 2012 I didn't checked deeply and didn't notice that task being given access to all RAM. Also I didn't checked where crash happens exactly. Anyway, bug identified.
P.S. I've just figured out that even if you fix this it will not work in my case because of my heap implementation. I relocated whole heap to privileged_data section to protect system objects which are being placed there by freertos. I didn't considered task stacks because most of my tasks are created with xTaskCreateRestricted().
Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.
|