Chapter 2. API Reference
//
configSUPPORT_STATIC_ALLOCATION
//
be used to force the variable into the RTOS
static PRIVILEGED_DATA StaticTask_t xTaskBuffer;
static const TaskParameters_t xCheckTaskParameters
{
vATask,
//
"ATask",
//
100,
//
NULL,
//
parameters.
→
( 1UL
|
portPRIVILEGE_BIT
portPRIVILEGE_BIT
→
cStackBuffer,//
//
xRegions
-
//
the task,
with
//
different memory alignment requirements
documentation
→
//
for
full
information.
{
//
Base address
{ cReadWriteArray,
{ cReadOnlyArray,
{ cPrivilegedOnlyAccessArray,
WRITE }
→
}
&xTaskBuffer;
};
int
main( void )
{
TaskHandle_t xHandle;
//
Create a task
//
is
requested (the second parameter
//
demonstration purposes
xTaskCreateRestricted( &xRegTest1Parameters, &xHandle );
//
Start the
scheduler.
vTaskStartScheduler();
//
Will only get here
//
and/or
timer
for( ;; );
}
Memory regions are assigned to a restricted task when the task is created by a call to xTaskCreateRestricted().
These regions can be redefined using vTaskAllocateMPURegions().
Example usage:
//
Define an array of MemoryRegion_t structures that configures an MPU region
//
allowing read/write access
//
ucOneKByte
array.
//
unused so
set
static const MemoryRegion_t xAltRegions[ portNUM_CONFIGURABLE_REGIONS ]
{
//
Base address
{ ucOneKByte,
{ 0,
Espressif Systems
pvTaskCode
-
the function that implements the
pcName
-
just a text name
usStackDepth
-
the stack size DEFINED IN
pvParameters
-
passed into the task function
),//
uxPriority
if
the task should run
puxStackBuffer
-
the buffer to be used
Allocate up to three separate memory regions
appropriate access
//
Holds the
task's data structure.
from
the
const structure defined
as
its
not
if
there was insufficient memory to create the idle
task.
for
1024
The other two of the maximum
to
zero.
Length
Parameters
1024,
portMPU_REGION_READ_WRITE },
0,
0
Submit Document Feedback
is set
to
1.
The PRIVILEGED_DATA macro can
kernel's privileged data area.
=
for
the task to assist
-
task priority,
in
a privileged
permissions.
Different processors have
-
refer to the
Length
Parameters
32,
portMPU_REGION_READ_WRITE },
32,
portMPU_REGION_READ_ONLY },
128,
portMPU_REGION_PRIVILEGED_READ_
above.
is not
NULL) but
actually
used.
bytes
starting at the beginning of the
3
definable regions are
},
857
(continued from previous page)
task.
debugging.
BYTES.
as
the
function␣
set
the␣
state.
as
the task
stack.
for
access by
FreeRTOS␣
The task handle
in
this case just
for
=
(continues on next page)
Release v4.4
Need help?
Do you have a question about the ESP32-S2 and is the answer not in the manual?