nuttx-commits mailing list archives

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

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




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