|
ICARUS OS (Intelligent Cooperative Architecture for Real-time Unified Systems) 0.1.0
Preemptive Real-Time Operating System for ARM Cortex-M7
|
Go to the source code of this file.
Macros | |
| #define | BSP_ITCM_BASE 0x00000000UL |
| ITCM RAM base address (64KB, zero wait-state code) | |
| #define | BSP_ITCM_SIZE (64 * 1024) |
| #define | BSP_DTCM_BASE 0x20000000UL |
| DTCM RAM base address (128KB, zero wait-state data) | |
| #define | BSP_DTCM_SIZE (128 * 1024) |
| #define | BSP_DTCM_OBC_BASE 0x20010000UL |
| Upper DTCM for OBC application hot data (64KB, unprivileged RW) | |
| #define | BSP_DTCM_OBC_SIZE (64 * 1024) |
| #define | BSP_RAM_D1_BASE 0x24000000UL |
| AXI SRAM (RAM_D1) base address (512KB) | |
| #define | BSP_RAM_D1_SIZE (512 * 1024) |
| #define | BSP_RAM_D2_BASE 0x30000000UL |
| AHB SRAM (RAM_D2) base address (288KB) | |
| #define | BSP_RAM_D2_SIZE (288 * 1024) |
| #define | BSP_RAM_D3_BASE 0x38000000UL |
| AHB SRAM (RAM_D3) base address (64KB) | |
| #define | BSP_RAM_D3_SIZE (64 * 1024) |
| #define | BSP_FLASH_BASE 0x08000000UL |
| Internal Flash base address (128KB) | |
| #define | BSP_FLASH_SIZE (128 * 1024) |
| #define | BSP_QSPI_BASE 0x90000000UL |
| QSPI Flash base address (8MB external) | |
| #define | BSP_QSPI_SIZE (8 * 1024 * 1024) |
| #define | BSP_PERIPH_BASE 0x40000000 |
| Peripheral base address (512MB) | |
| #define | BSP_PERIPH_SIZE (512 * 1024 * 1024) |
| #define | MPU_REGION_ITCM_BASE MPU_REGION_NUMBER0 |
| #define | MPU_REGION_QSPI_FLASH MPU_REGION_NUMBER1 |
| #define | MPU_REGION_FLASH MPU_REGION_NUMBER2 |
| #define | MPU_REGION_DTCM_OBC MPU_REGION_NUMBER3 |
| #define | MPU_REGION_TASK_DATA MPU_REGION_NUMBER4 |
| #define | MPU_REGION_DTCM MPU_REGION_NUMBER5 |
| #define | MPU_REGION_RAM_D1 MPU_REGION_NUMBER6 |
| #define | MPU_REGION_PERIPH MPU_REGION_NUMBER7 |
| #define | BYTES_TO_MPU_SIZE(bytes) |
| Convert size in bytes to MPU region size constant. | |
| #define | TASK_DATA_SIZE_BYTES ((ICARUS_DATA_WORDS) * 4u) |
| Task data region size for MPU configuration. | |
| #define | TASK_DATA_SIZE_MPU MPU_REGION_SIZE_2KB |
Functions | |
| void | MPU_Config (void) |
| Configure Memory Protection Unit regions. | |
| void | MPU_ConfigureTaskData (uint32_t task_data_base) |
| Configure MPU Region 4 for current task's data region. | |
| #define BYTES_TO_MPU_SIZE | ( | bytes | ) |
Convert size in bytes to MPU region size constant.
| #define TASK_DATA_SIZE_BYTES ((ICARUS_DATA_WORDS) * 4u) |
| void MPU_Config | ( | void | ) |
Configure Memory Protection Unit regions.
Sets up 8 MPU regions for memory protection:
| Region | Base | Size | Access | Purpose |
|---|---|---|---|---|
| 0 | 0x00000000 | 64KB | Priv+User RO | ITCM code protection |
| 1 | 0x90000000 | 8MB | Priv+User RO | QSPI Flash |
| 2 | 0x08000000 | 128KB | Priv+User RO | Internal Flash |
| 3 | 0x20010000 | 64KB | Full Access | DTCM OBC hot data |
| 4 | Dynamic | 2KB | Priv+User RW | Task data isolation |
| 5 | 0x20000000 | 128KB | Priv RW | DTCM kernel data |
| 6 | 0x24000000 | 512KB | Full Access | RAM_D1 shared buffers |
| 7 | 0x40000000 | 512MB | Full Access | Peripherals |
Sets up 8 MPU regions for memory protection:
Enables MPU with privileged default background map to block unprivileged access to system control space (NVIC, SCB, etc.)
Definition at line 64 of file mpu.c.
References BSP_DTCM_BASE, BSP_DTCM_OBC_BASE, BSP_FLASH_BASE, BSP_ITCM_BASE, BSP_PERIPH_BASE, BSP_RAM_D1_BASE, MPU_REGION_DTCM, MPU_REGION_DTCM_OBC, MPU_REGION_FLASH, MPU_REGION_ITCM_BASE, MPU_REGION_PERIPH, MPU_REGION_QSPI_FLASH, and MPU_REGION_RAM_D1.
Referenced by hal_init().
| void MPU_ConfigureTaskData | ( | uint32_t | task_data_base | ) |
Configure MPU Region 4 for current task's data region.
| task_data_base | Base address of task's 2KB data region (must be 2KB-aligned) |
Reconfigures MPU Region 4 to grant the current task exclusive access to its data region. This provides task data isolation - each task can only access its own 2KB data region, preventing cross-task corruption.
Configure MPU Region 4 for current task's data region.
| task_data_base | Base address of the task's data pool |
Definition at line 204 of file mpu.c.
References MPU_REGION_TASK_DATA, and TASK_DATA_SIZE_MPU.