davids5 commented on a change in pull request #1042:
URL: https://github.com/apache/incubator-nuttx/pull/1042#discussion_r425020770
##########
File path: arch/arm/src/stm32h7/stm32_flash.c
##########
@@ -762,94 +903,65 @@ ssize_t up_progmem_write(size_t addr, const void *buf,
size_t count)
ARM_DSB();
ARM_ISB();
- while (stm32h7_flash_getreg32(priv, STM32_FLASH_SR1_OFFSET) &
- (FLASH_SR_BSY | FLASH_SR_QW))
+ if (stm32h7_wait_for_last_operation(priv))
{
+ return -EIO;
}
- /* Verify */
-
- if (stm32h7_flash_getreg32(priv, STM32_FLASH_SR1_OFFSET) &
- FLASH_CR_SER)
- {
- written = -EROFS;
- break;
- }
- else
+ sr = stm32h7_flash_getreg32(priv, STM32_FLASH_SR1_OFFSET);
+ if (sr & (FLASH_SR_SNECCERR | FLASH_SR_DBECCERR))
Review comment:
Is this correct test on a write ?
```
SNECCERR1: Bank 1 single correction error flag
SNECCERR1 flag is raised when an ECC single correction error occurs during a
read
operation from bank 1. An interrupt is generated if SNECCERRIE1 is set to 1.
Writing 1 to
CLR_SNECCERR1 bit in FLASH_CCR1 register clears SNECCERR1.
0: no ECC single correction error occurs on bank 1
1: ECC single correction error occurs on bank 1
```
Or should this be checked on the read?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]