Merged in david_s5/nuttx/upstream_to_greg_HSI_not_req_on_F4 (pull request #192)

STM32F4 does not have the requierment that the HSI be on for FLASH erase/write operations
This commit is contained in:
Gregory Nutt 2017-01-11 17:13:36 -06:00
commit 62fe2bf11a

View File

@ -231,12 +231,14 @@ ssize_t up_progmem_erasepage(size_t page)
return -EFAULT;
}
/* Get flash ready and begin erasing single page */
#if !defined(CONFIG_STM32_STM32F40XX)
if (!(getreg32(STM32_RCC_CR) & RCC_CR_HSION))
{
return -EPERM;
}
#endif
/* Get flash ready and begin erasing single page */
stm32_flash_unlock();
@ -318,12 +320,14 @@ ssize_t up_progmem_write(size_t addr, const void *buf, size_t count)
return -EFAULT;
}
/* Get flash ready and begin flashing */
#if !defined(CONFIG_STM32_STM32F40XX)
if (!(getreg32(STM32_RCC_CR) & RCC_CR_HSION))
{
return -EPERM;
}
#endif
/* Get flash ready and begin flashing */
stm32_flash_unlock();