Other Parts Discussed in Thread: UNIFLASH
Hi,
SDK version: mmwave_sdk_03_02_00_04
CCS: 8.3.1
I want to CCS debug MPU functions(I config the TCMA with read only access and execute), I expect to get a data abort exception when I write to address 0 for test purpose.
But the the codes after configure TCMA MPU write protect will enter prefetch abnormal CPU mode when CCS debug.
Original codes as blow( compile SOC lib with definition of DOWNLOAD_FROM_CCS):
#if ((SOC_XWR18XX_MSS_TCMA_BASE_ADDRESS & (512U * ONE_KB - 1)) != 0) #error SOC_XWR18XX_MSS_TCMA_BASE_ADDRESS not aligned to 512 KB #endif SOC_MPUSetRegion(SOC_MPU_REGION2); SOC_MPUSetRegionBaseAddress(SOC_XWR18XX_MSS_TCMA_BASE_ADDRESS); #ifdef DOWNLOAD_FROM_CCS SOC_MPUSetRegionTypeAndPermission(SOC_MPU_NORMAL_OINC_NONSHARED, SOC_MPU_PRIV_RW_USER_RW_EXEC); #else SOC_MPUSetRegionTypeAndPermission(SOC_MPU_NORMAL_OINC_NONSHARED, SOC_MPU_PRIV_RO_USER_RO_EXEC); #endif SOC_MPUSetRegionSizeRegister(SOC_MPU_REGION_ENABLE | SOC_MPU_512_KB);
I remove DOWNLOAD_FROM_CCS judge, then use write protect function directly for TCMA memory. as below:
SOC_MPUSetRegion(SOC_MPU_REGION2); SOC_MPUSetRegionBaseAddress(SOC_XWR18XX_MSS_TCMA_BASE_ADDRESS); SOC_MPUSetRegionTypeAndPermission(SOC_MPU_NORMAL_OINC_NONSHARED, SOC_MPU_PRIV_RO_USER_RO_EXEC); SOC_MPUSetRegionSizeRegister(SOC_MPU_REGION_ENABLE | SOC_MPU_512_KB);
Then CCS debugging the edited codes will enter exception after execute up codes after SOC_MPUEnable();
What can I do to support ccs debug test for the MPU write-protect with codes memory area. Why the second configuration parameter from SOC_MPU_PRIV_RW_USER_RW_EXEC to SOC_MPU_PRIV_RO_USER_RO_EXEC ( no write permission) will cause the exception which I cannot debug anymore. All code load to TCMA already ok when execute mpu config( called by SOC_init codes in main funciton)
Thanks.
Jeff