nuttx-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [incubator-nuttx] jlaitine commented on a change in pull request #1042: stm32h7 progmem fixes
Date Thu, 14 May 2020 10:31:34 GMT

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



Mime
View raw message