From dd309ad9e8a82f30ef94a65b00dac614ddeedc29 Mon Sep 17 00:00:00 2001 From: David Sidrane Date: Thu, 8 Dec 2016 21:14:31 +0000 Subject: [PATCH] I was wrong - the original commit was correct. Assume a write op on the last word: address of 0xxxxxfe and count of 2. It is a valid operation and address+count is == STM32_FLASH_SIZE - so that is OK --- arch/arm/src/stm32/stm32_flash.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm/src/stm32/stm32_flash.c b/arch/arm/src/stm32/stm32_flash.c index 56aa1f75ed..73f1419506 100644 --- a/arch/arm/src/stm32/stm32_flash.c +++ b/arch/arm/src/stm32/stm32_flash.c @@ -313,7 +313,7 @@ ssize_t up_progmem_write(size_t addr, const void *buf, size_t count) addr -= STM32_FLASH_BASE; } - if ((addr+count) >= STM32_FLASH_SIZE) + if ((addr+count) > STM32_FLASH_SIZE) { return -EFAULT; }