From 31f8f51dc6f860d11b7445a49e099ea60126509d Mon Sep 17 00:00:00 2001 From: Sujit Kautkar Date: Mon, 19 Apr 2021 12:30:31 -0700 Subject: flash_fp_mcu: Add delay to consider bootloader startup Add delay of 100 ms to consider minimum bootloader start time for stm32. This fix prevents triggering stm32mon before bootloader is finished. BRANCH=none BUG=b:185074067 TEST=Multiple 'flash_fp_mcu ' Tested on coachz, nocturne and morphius boards Change-Id: Ic60e9e67c29664ce22bfc66bec6eaf76ffc80454 Signed-off-by: Sujit Kautkar Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2837485 Tested-by: Sujit Kautkar Reviewed-by: Alexandru M Stan Commit-Queue: Sujit Kautkar (cherry picked from commit 8cff79c7f79da51e20bfd76f6e1e1b3465b63262) Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2856928 Reviewed-by: Sujit Kautkar --- util/flash_fp_mcu | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/util/flash_fp_mcu b/util/flash_fp_mcu index 14a5c21907..2485acdbd1 100644 --- a/util/flash_fp_mcu +++ b/util/flash_fp_mcu @@ -295,6 +295,14 @@ flash_fp_mcu_stm32() { # Release reset as the SPI bus is now ready gpio 1 "${gpio_nrst}" + # As per section '68: Bootloader timings' from application note below: + # https://www.st.com/resource/en/application_note/cd00167594-stm32-microcontroller-system-memory-boot-mode-stmicroelectronics.pdf + # bootloader startup time is 16.63 ms for STM32F74xxx/75xxx and 53.975 ms + # for STM32H74xxx/75xxx. SPI needs 1 us delay for one SPI byte sending. + # Keeping some margin, add delay of 100 ms to consider minimum bootloader + # startup time after the reset for stm32 devices. + sleep 0.1 + # Print out the actual underlying command we're running and run it echo "# ${cmd}" ${cmd} -- cgit v1.2.1