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.

[参考译文] TMS570LS3137-EP:FreeRTOS:配置 MPU

Guru**** 2553260 points
Other Parts Discussed in Thread: HALCOGEN, TMS570LS3137

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

https://e2e.ti.com/support/microcontrollers/arm-based-microcontrollers-group/arm-based-microcontrollers/f/arm-based-microcontrollers-forum/823572/tms570ls3137-ep-freertos-configuring-mpu

器件型号:TMS570LS3137-EP
主题中讨论的其他器件:HALCOGENTMS570LS3137

您好!

我将 TMS570LS3137与 FreeRTOS 配合使用(代码在 HALCoGen 中创建)。 我还使用 SPI 和闪存。 我可以在 FreeRTOS 调度程序启动之前初始化 SPI 或读取/写入闪存。 但是、在调度程序启动后、我无法初始化 SPI 或读取/写入闪存。 这是因为在 vTaskStartScheduler()->xPortStartScheduler()->prvSetupDefaultMPU()中重新配置了 MPU。 到目前为止、我找到了2个解决方案:

-Edit os_mpu_wrappers.c、这样您就可以编写禁用和启用 MPU 的函数、并在用户模式和专用模式之间切换;以及在关键操作之前和之后使用这些函数。

-Edit prvSetupDefaultMPU(),以便配置哪些区域可以在用户模式下访问。

现在、我将重点介绍第二种解决方案、并将 portPRIVILIGED_FLASH_REGION 设置为 portMPU_PRIV_RW_USER_RW_EXEC、而不 是 portMPU_PRIV_RO_USER_NA_EXEC、我可以使用 ti_FEE 读取/写入闪存。 但是、我无法处理 SPI 初始化、我认为这不是一个很好的解决方案、因为内核代码也在闪存中、可能会被损坏。

我该怎么做? 感谢您的任何帮助。

此致、

Mary Jane