diff --git a/arch/arm/src/lpc17xx/lpc17_allocateheap.c b/arch/arm/src/lpc17xx/lpc17_allocateheap.c index 839c5a3987..14c5508598 100644 --- a/arch/arm/src/lpc17xx/lpc17_allocateheap.c +++ b/arch/arm/src/lpc17xx/lpc17_allocateheap.c @@ -369,10 +369,16 @@ void up_addregion(void) /* Yes.. allow user-mode access to the AHB SRAM user heap memory */ - lpc17_mpu_uheap((uintptr_t)LPC17_AHB_HEAPBASE, LPC17_AHB_HEAPSIZE); - +#if defined(LPC17_BANK0_HEAPBASE) && defined(LPC17_BANK0_HEAPSIZE) + lpc17_mpu_uheap((uintptr_t)LPC17_BANK0_HEAPBASE, LPC17_BANK0_HEAPSIZE); #endif +#if defined(LPC17_BANK1_HEAPBASE) && defined(LPC17_BANK1_HEAPSIZE) + lpc17_mpu_uheap((uintptr_t)LPC17_BANK1_HEAPBASE, LPC17_BANK1_HEAPSIZE); +#endif + +#endif /* CONFIG_BUILD_PROTECTED && CONFIG_MM_KERNEL_HEAP */ + /* Add the AHB SRAM user heap region. */ kumm_addregion((FAR void *)LPC17_AHB_HEAPBASE, LPC17_AHB_HEAPSIZE);