MPU region parameters passed


In the task.h file, the parameters of the memory regions are defined as follows:

// MPU region parameters passed in ulParameters
#define tskMPU_REGION_READ_ONLY ( 1UL << 0UL )
#define tskMPU_REGION_READ_WRITE ( 1UL << 1UL )
#define tskMPU_REGION_EXECUTE_NEVER ( 1UL << 2UL )
#define tskMPU_REGION_NORMAL_MEMORY ( 1UL << 3UL )
#define tskMPU_REGION_DEVICE_MEMORY ( 1UL << 4UL )

The first three definitions have a suggestive name and do not require comments.

Please comment on the last two definitions. What exactly can they be used for?



I think tskMPU_REGION_NORMAL_MEMORY is normal, cacheable RAM with speculative access and prefetching allowed if supported by MCU.
tskMPU_REGION_DEVICE_MEMORY only allows strictly ordered access means no speculative access nor prefetching. It’s memory mapped I/O address range and not real RAM.
See also p4 table 26