jlaitine commented on a change in pull request #1042:
URL: https://github.com/apache/incubator-nuttx/pull/1042#discussion_r425036831



##########
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:
       I assume that it doesn't cause any errors (since this is very thoroughly 
tested), but it may be useless if.




----------------------------------------------------------------
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]


Reply via email to