You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by GitBox <gi...@apache.org> on 2020/05/14 10:31:34 UTC

[GitHub] [incubator-nuttx] jlaitine commented on a change in pull request #1042: stm32h7 progmem fixes

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



##########
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:
       This indeed looks suspicious, and I can't recall if there was some reason for it. Maybe we need to study this one more and come back to this PR later. I will contact the original author of this patch to get more info.
   




----------------------------------------------------------------
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:
users@infra.apache.org