Skip to content

Commit

Permalink
[BACKPORT] stm32h7:flash can not use usleep
Browse files Browse the repository at this point in the history
   commit 328374f4658d11655f268f968f4c6c7a3942f320

   changed the wait to use usleep. This killed the
   write performace from the published values in the
   datasheet of ~100 us to 2 mS per 256 bits. On
   a 1000 per tick config. It can be 10 X worse
   on the default 100 per tick config.

   This changes uses up_udelay.
  • Loading branch information
davids5 committed Feb 15, 2022
1 parent 04789a7 commit c5c7d2b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions arch/arm/src/stm32h7/stm32_flash.c
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@
#define PROGMEM_NBLOCKS STM32_FLASH_NBLOCKS
#define FLASH_NPAGES (STM32_FLASH_SIZE / FLASH_PAGE_SIZE)

#define FLASH_TIMEOUT_VALUE 500000 /* 5s */
#define FLASH_TIMEOUT_VALUE 5000000 /* 5s */

/****************************************************************************
* Private Types
Expand Down Expand Up @@ -429,7 +429,7 @@ static int stm32h7_wait_for_last_operation(FAR struct stm32h7_flash_priv_s
break;
}

usleep(1000);
up_udelay(1);
}

if (timeout)
Expand Down

0 comments on commit c5c7d2b

Please sign in to comment.