我在使用TM4C123GH6PM時有遇到一個關於記憶體保護(MPU)的問題,在這裡面會有一個API函數"void MPURegionSet(uint32_t ui32Region,uint32_t ui32Addr,uint32_t ui32Flags)"需要填入內存的訪問權限
"MPU_RGN_PERM_PRV_NO_USR_NO - no access in privileged or user mode",其中我想請問在TM4C123GH6PM這一顆晶片,
(1)特權權限和用戶權限是可以設定的嗎?我不知道我一開機後,開始在main函數中寫程式時,此時是在用戶權限還是特權權限。
(2)當我只要填入"MPU_RGN_PERM_PRV_RO_USR_NO ",晶片上就是變成可讀,填入"MPU_RGN_PERM_PRV_RW_USR_NO" 就變成可讀可寫,我好像都是處在特權權限模式下,
我該怎麼切換成用戶模式,來試驗用戶模式的MPU設定功能呢?
(3)MPU是否可以限制晶片ICE( in circuit emulator)的行為?例如我設定成"MPU_RGN_PERM_PRV_RO_USR_NO",這樣是否可以阻止data下載到Flash,或將程式燒錄至FLASH?
(1) Can privilege and user access permissions be configured using the "void MPURegionSet(uint32_t ui32Region, uint32_t ui32Addr, uint32_t ui32Flags)" API function? I'm not sure whether I am in user mode or privilege mode when I start writing code in the main function after booting up on the TM4C123GH6PM microcontroller.
(2) When I use "MPU_RGN_PERM_PRV_RO_USR_NO," it seems that the chip becomes read-only, and with "MPU_RGN_PERM_PRV_RW_USR_NO," it becomes readable and writable. It appears that I am in privilege mode. How can I switch to user mode to test the MPU settings in user mode?
(3) Can the MPU restrict the behavior of the in-circuit emulator (ICE) on the TM4C123GH6PM microcontroller? For example, if I configure it with "MPU_RGN_PERM_PRV_RO_USR_NO," can this prevent data downloads to Flash or programming of Flash memory using the ICE?