Hello,
We are using the S32K144 with the FuSa RTS and noticed that the device isn't equipped with a standard ARM MPU.
The RTS Blinky example is configuring the MPU to use zones but it won't work because registers are different.
Can someone point us in the right direction or maybe provide some sample code?
static const ARM_MPU_Region_t mpu_table[ZONES_NUM][MPU_REGIONS];
extern void stop_on_error(uint32_t cond);
/* Update MPU settings for newly activating Zone */
void osZoneSetup_Callback (uint32_t zone) {
stop_on_error(zone >= ZONES_NUM);
ARM_MPU_Disable();
ARM_MPU_Load(mpu_table[zone], MPU_REGIONS);
ARM_MPU_Enable(MPU_CTRL_PRIVDEFENA_Msk);
}
/* MPU table specifying MPU regions for all Zones */
static const ARM_MPU_Region_t mpu_table[ZONES_NUM][MPU_REGIONS] = {
/* Zone 'ZONE_CTRL' */
{
// FLASH (0x00000000..0x00020000)
{ .RBAR = ARM_MPU_RBAR(0U, 0x00000000), .RASR = ARM_MPU_RASR_EX(0U, ARM_MPU_AP_RO, ARM_MPU_ACCESS_NORMAL(ARM_MPU_CACHEP_NOCACHE, ARM_MPU_CACHEP_NOCACHE, 1U), 0x00U, ARM_MPU_REGION_SIZE_128KB) },
// RAM_SHARED, RAM_EVR (0x20000000..0x20001FFF)
{ .RBAR = ARM_MPU_RBAR(1U, 0x20000000), .RASR = ARM_MPU_RASR_EX(1U, ARM_MPU_AP_FULL, ARM_MPU_ACCESS_NORMAL(ARM_MPU_CACHEP_NOCACHE, ARM_MPU_CACHEP_NOCACHE, 1U), 0x00U, ARM_MPU_REGION_SIZE_8KB) },
// RAM_CTRL (0x20002000..0x20003FFF)
{ .RBAR = ARM_MPU_RBAR(2U, 0x20002000), .RASR = ARM_MPU_RASR_EX(1U, ARM_MPU_AP_FULL, ARM_MPU_ACCESS_NORMAL(ARM_MPU_CACHEP_NOCACHE, ARM_MPU_CACHEP_NOCACHE, 0U), 0x00U, ARM_MPU_REGION_SIZE_8KB) },
{ .RBAR = ARM_MPU_RBAR(3U, 0U), .RASR = 0U },
{ .RBAR = ARM_MPU_RBAR(4U, 0U), .RASR = 0U },
{ .RBAR = ARM_MPU_RBAR(5U, 0U), .RASR = 0U },
{ .RBAR = ARM_MPU_RBAR(6U, 0U), .RASR = 0U },
{ .RBAR = ARM_MPU_RBAR(7U, 0U), .RASR = 0U }
},
Regards Peter