Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 11f5e89

Browse files
author
rechrtb
committedApr 24, 2024
Add new entry in the mpu region table for increased non-cached ram size
1 parent abd4152 commit 11f5e89

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed
 

‎src/Cache.cpp

+11-6
Original file line numberDiff line numberDiff line change
@@ -238,35 +238,40 @@ void Cache::Init() noexcept
238238
ARM_MPU_RBAR(4, IRAM_ADDR + 0x00010000),
239239
ARM_MPU_RASR_EX(1u, ARM_MPU_AP_FULL, ARM_MPU_ACCESS_NORMAL(ARM_MPU_CACHEP_NOCACHE, ARM_MPU_CACHEP_NOCACHE, 1u), 0u, ARM_MPU_REGION_SIZE_32KB)
240240
},
241+
// Next 1kb RAM, read-write, shared, non-cacheable, execute disabled
242+
{
243+
ARM_MPU_RBAR(5, IRAM_ADDR + 0x00018000),
244+
ARM_MPU_RASR_EX(1u, ARM_MPU_AP_FULL, ARM_MPU_ACCESS_NORMAL(ARM_MPU_CACHEP_NOCACHE, ARM_MPU_CACHEP_NOCACHE, 1u), 0u, ARM_MPU_REGION_SIZE_1KB)
245+
},
241246
// RAMFUNC memory. Read-only (the code has already been written to it), execution allowed. The initialised data memory follows, so it must be RW.
242247
// 256 bytes is enough at present (check the linker memory map if adding more RAMFUNCs).
243248
{
244-
ARM_MPU_RBAR(5, IRAM_ADDR + 0x00018000),
249+
ARM_MPU_RBAR(6, IRAM_ADDR + 0x00018400),
245250
ARM_MPU_RASR_EX(0u, ARM_MPU_AP_FULL, ARM_MPU_ACCESS_NORMAL(CACHE_MODE, CACHE_MODE, 0u), 0u, ARM_MPU_REGION_SIZE_256B)
246251
},
247252
// Final 128kb RAM, read-write, cacheable, execute disabled
248253
{
249-
ARM_MPU_RBAR(6, IRAM_ADDR + 0x00040000),
254+
ARM_MPU_RBAR(7, IRAM_ADDR + 0x00040000),
250255
ARM_MPU_RASR_EX(1u, ARM_MPU_AP_FULL, ARM_MPU_ACCESS_NORMAL(CACHE_MODE, CACHE_MODE, 0u), 0u, ARM_MPU_REGION_SIZE_128KB)
251256
},
252257
// Peripherals
253258
{
254-
ARM_MPU_RBAR(7, 0x40000000),
259+
ARM_MPU_RBAR(8, 0x40000000),
255260
ARM_MPU_RASR_EX(1u, ARM_MPU_AP_FULL, ARM_MPU_ACCESS_DEVICE(1u), 0u, ARM_MPU_REGION_SIZE_16MB)
256261
},
257262
// USBHS
258263
{
259-
ARM_MPU_RBAR(8, 0xA0100000),
264+
ARM_MPU_RBAR(9, 0xA0100000),
260265
ARM_MPU_RASR_EX(1u, ARM_MPU_AP_FULL, ARM_MPU_ACCESS_DEVICE(1u), 0u, ARM_MPU_REGION_SIZE_1MB)
261266
},
262267
// ROM
263268
{
264-
ARM_MPU_RBAR(9, IROM_ADDR),
269+
ARM_MPU_RBAR(10, IROM_ADDR),
265270
ARM_MPU_RASR_EX(0u, ARM_MPU_AP_RO, ARM_MPU_ACCESS_NORMAL(ARM_MPU_CACHEP_WT_NWA, ARM_MPU_CACHEP_WT_NWA, 0u), 0u, ARM_MPU_REGION_SIZE_4MB)
266271
},
267272
// ARM Private Peripheral Bus
268273
{
269-
ARM_MPU_RBAR(10, 0xE0000000),
274+
ARM_MPU_RBAR(11, 0xE0000000),
270275
ARM_MPU_RASR_EX(1u, ARM_MPU_AP_FULL, ARM_MPU_ACCESS_ORDERED, 0u, ARM_MPU_REGION_SIZE_1MB)
271276
}
272277
};

0 commit comments

Comments
 (0)
Please sign in to comment.