This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

[参考译文] TMS570LS1227:针对 Cortex R4 (TMS570LS1227)和 ARM R4手册的 FreeRTOS MPU #defines。

Guru**** 2028300 points
Other Parts Discussed in Thread: HALCOGEN
请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

https://e2e.ti.com/support/microcontrollers/arm-based-microcontrollers-group/arm-based-microcontrollers/f/arm-based-microcontrollers-forum/1001306/tms570ls1227-freertos-mpu-defines-for-cortex-r4-tms570ls1227-and-arm-r4-manual

器件型号:TMS570LS1227
主题中讨论的其他器件:HALCOGEN

我正在尝试将 MPU #defines 调和为 HalCoGen 在 os_portmacro.h 中为目标生成的:

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
#define portMPU_PRIV_NA_USER_NA_EXEC ( 0x0000UL ) /**< Alias no access in privileged mode, no access in user mode and execute */
#define portMPU_PRIV_RW_USER_NA_EXEC ( 0x0100UL ) /**< Alias no read/write in privileged mode, no access in user mode and execute */
#define portMPU_PRIV_RW_USER_RO_EXEC ( 0x0200UL ) /**< Alias no read/write in privileged mode, read only in user mode and execute */
#define portMPU_PRIV_RW_USER_RW_EXEC ( 0x0300UL ) /**< Alias no read/write in privileged mode, read/write in user mode and execute */
#define portMPU_PRIV_RO_USER_NA_EXEC ( 0x0500UL ) /**< Alias no read only in privileged mode, no access in user mode and execute */
#define portMPU_PRIV_RO_USER_RO_EXEC ( 0x0600UL ) /**< Alias no read only in privileged mode, read only in user mode and execute */
#define portMPU_PRIV_NA_USER_NA_NOEXEC ( 0x1000UL ) /**< Alias no access in privileged mode, no access in user mode and no execution */
#define portMPU_PRIV_RW_USER_NA_NOEXEC ( 0x1100UL ) /**< Alias no read/write in privileged mode, no access in user mode and no execution */
#define portMPU_PRIV_RW_USER_RO_NOEXEC ( 0x1200UL ) /**< Alias no read/write in privileged mode, read only in user mode and no execution */
#define portMPU_PRIV_RW_USER_RW_NOEXEC ( 0x1300UL ) /**< Alias no read/write in privileged mode, read/write in user mode and no execution */
#define portMPU_PRIV_RO_USER_NA_NOEXEC ( 0x1500UL ) /**< Alias no read only in privileged mode, no access in user mode and no execution */
#define portMPU_PRIV_RO_USER_RO_NOEXEC ( 0x1600UL ) /**< Alias no read only in privileged mode, read only in user mode and no execution */
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

使用 ARM R4中的访问控制寄存器手册:

然后说: #define portMPU_PRIV_RW_USER_RW_EXEC  (0x0300UL)/**<在特权模式下不能读取/写入别名,在用户模式下读取/写入并执行*/

应为 X300 =位8和9、 AP b011、这是完全读取/写入任何模式 且执行正常。   但为什么描述中会显示“别名不可读/写…… "?

实际上每行都有"否"、因此这必须是拼写错误。

还想问:

#define portMPU_PRIV_NA_USER_NA_EXEC  (0x0000UL)/**<在特权模式下无访问权限、在用户模式下无访问权限并执行*/

#define portMPU_PRIV_NA_USER_NA_NOexec ( 0x1000UL )/**<别名:在特权模式下无访问权限,在用户模式下无访问权限,不执行*/

根据,在任何模式下,宏似乎都不能访问,但仍可执行。 ? (全0 1)。

另一方面、如果我想拥有特权模式只能读取、但非特权(例如、正常任务不是内核)读取和写入的区域、  人们该怎么做? 或者这毫无意义吗?
(例如,如果我要保护 用户模式任务不受内核的影响... 是的,这听起来很糟糕,但假设我确实这么做了)

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    您好!

    描述中有几个拼写错误。 仅当 AP=1/2/3时、存储器区域在特权模式下可为 R/W、AP=5/6、在特权模式下为 RO。  

    是的、当 AP=0时、两种模式下都无法访问存储器区域。

    从 ARM TRM 中、不存在这种 设置:用户模式为 R/W、特权模式为 RO。