Skip to content

Commit 9db704c

Browse files
docs: clarify MPU region parameter macros (#1445)
Document that MemoryRegion_t.ulParameters macros are port specific so users select the tskMPU_REGION_* or portMPU_REGION_* values that match their MPU port. Signed-off-by: Old-Ding <ai.neo.ae86@gmail.com> Co-authored-by: Old-Ding <ai.neo.ae86@gmail.com>
1 parent d72263b commit 9db704c

1 file changed

Lines changed: 24 additions & 0 deletions

File tree

include/task.h

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -548,6 +548,14 @@ typedef enum
548548
* The function parameters define the memory regions and associated access
549549
* permissions allocated to the task.
550550
*
551+
* The parameter macros used in MemoryRegion_t.ulParameters are port specific.
552+
* Some ports, including the Cortex-M3/4 MPU ports, use the portMPU_REGION_*
553+
* values shown below.
554+
* ARMv8-M MPU ports, such as CM23, CM33, CM52, CM55, CM85 and STAR_MC3, use
555+
* the tskMPU_REGION_* values defined in this header; the port translates them
556+
* into MPU register settings. Check the selected port's headers before selecting
557+
* the region parameter macros.
558+
*
551559
* See xTaskCreateRestrictedStatic() for a version that does not use any
552560
* dynamic memory allocation.
553561
*
@@ -639,6 +647,14 @@ typedef enum
639647
* xTaskCreateRestrictedStatic() therefore allows a memory protected task to be
640648
* created without using any dynamic memory allocation.
641649
*
650+
* The parameter macros used in MemoryRegion_t.ulParameters are port specific.
651+
* Some ports, including the Cortex-M3/4 MPU ports, use the portMPU_REGION_*
652+
* values shown below.
653+
* ARMv8-M MPU ports, such as CM23, CM33, CM52, CM55, CM85 and STAR_MC3, use
654+
* the tskMPU_REGION_* values defined in this header; the port translates them
655+
* into MPU register settings. Check the selected port's headers before selecting
656+
* the region parameter macros.
657+
*
642658
* @param pxTaskDefinition Pointer to a structure that contains a member
643659
* for each of the normal xTaskCreate() parameters (see the xTaskCreate() API
644660
* documentation) plus an optional stack buffer and the memory region
@@ -728,6 +744,14 @@ typedef enum
728744
* @param[in] pxRegions A pointer to a MemoryRegion_t structure that contains the
729745
* new memory region definitions.
730746
*
747+
* The parameter macros used in MemoryRegion_t.ulParameters are port specific.
748+
* Some ports, including the Cortex-M3/4 MPU ports, use the portMPU_REGION_*
749+
* values shown below.
750+
* ARMv8-M MPU ports, such as CM23, CM33, CM52, CM55, CM85 and STAR_MC3, use
751+
* the tskMPU_REGION_* values defined in this header; the port translates them
752+
* into MPU register settings. Check the selected port's headers before selecting
753+
* the region parameter macros.
754+
*
731755
* Example usage:
732756
* @code{c}
733757
* // Define an array of MemoryRegion_t structures that configures an MPU region

0 commit comments

Comments
 (0)