diff --git a/arch/arm/src/stm32l4/hardware/stm32l4_memorymap.h b/arch/arm/src/stm32l4/hardware/stm32l4_memorymap.h index 3b1631ad487..66c669aed35 100644 --- a/arch/arm/src/stm32l4/hardware/stm32l4_memorymap.h +++ b/arch/arm/src/stm32l4/hardware/stm32l4_memorymap.h @@ -68,6 +68,7 @@ /* 0x00100000-0x07ffffff: Reserved */ #define STM32L4_FLASH_BASE 0x08000000 /* 0x08000000-0x080fffff: FLASH memory */ /* 0x08100000-0x0fffffff: Reserved */ +#define STM32L4_FLASH_MASK 0xf8000000 /* Test if addr in FLASH */ #define STM32L4_SRAM2_BASE 0x10000000 /* 0x10000000-0x1000ffff: 16k to 64k SRAM2 */ /* 0x10010000-0x1ffeffff: Reserved */ #define STM32L4_SRAM3_BASE 0x20040000 /* 0x20040000-0x3fffffff: SRAM3 (STM32L4R9xx only, 384k) */ diff --git a/arch/arm/src/stm32l4/stm32l4_firewall.c b/arch/arm/src/stm32l4/stm32l4_firewall.c index 30378c858f4..392d6f13540 100644 --- a/arch/arm/src/stm32l4/stm32l4_firewall.c +++ b/arch/arm/src/stm32l4/stm32l4_firewall.c @@ -56,7 +56,7 @@ int stm32l4_firewallsetup(FAR struct stm32l4_firewall_t *setup) { uint32_t reg; - /* code and nvdata must be aligned to 256 bytes + /* Code and nvdata must be aligned to 256 bytes * data must be aligned to 64 bytes */ @@ -66,7 +66,7 @@ int stm32l4_firewallsetup(FAR struct stm32l4_firewall_t *setup) return -EINVAL; } - /* code and nvdata length must be a multiple of 256 bytes + /* Code and nvdata length must be a multiple of 256 bytes * data length must be a multiple of 64 bytes */ @@ -76,16 +76,16 @@ int stm32l4_firewallsetup(FAR struct stm32l4_firewall_t *setup) return -EINVAL; } - /* code and nvdata must be in flash + /* Code and nvdata must be in flash * data must be in SRAM1 */ - if ((setup->codestart & STM32L4_REGION_MASK) != STM32L4_FLASH_BASE) + if ((setup->codestart & STM32L4_FLASH_MASK) != STM32L4_FLASH_BASE) { return -EINVAL; } - if ((setup->nvdatastart & STM32L4_REGION_MASK) != STM32L4_FLASH_BASE) + if ((setup->nvdatastart & STM32L4_FLASH_MASK) != STM32L4_FLASH_BASE) { return -EINVAL; }