From dc9bf07414e750d2458c488b37df91900ce66d78 Mon Sep 17 00:00:00 2001 From: rusefi Date: Sat, 1 Jun 2019 20:25:51 -0400 Subject: [PATCH] need more DevOps :( trying with 'sleep' --- firmware/flash_erase407.bat | 11 +++++++++-- .../functional_test_and_build_bundle/hw_test.bat | 13 ++++++++++--- 2 files changed, 19 insertions(+), 5 deletions(-) diff --git a/firmware/flash_erase407.bat b/firmware/flash_erase407.bat index c3f32b2df3..1dd1ea9c0e 100644 --- a/firmware/flash_erase407.bat +++ b/firmware/flash_erase407.bat @@ -1,7 +1,9 @@ rem st-link_cli -c SWD ur -ME rem 0x100000 would erase both code and configuration rem use 0x080000 if you want to erase only configuratio -echo I am flash_erase407.bat +set script_name=flash_erase407.bat +echo Entering %script_name% + rem weird, it used to be much nicer with openocd 0.8.0, file location was not broken? rem maybe https://sourceforge.net/p/openocd/tickets/105/ ? @@ -16,8 +18,13 @@ if not exist openocd/openocd.exe exit -1 rem newer discovery boards echo Invoking openocd... openocd\openocd.exe -f openocd/stm32f4discovery.cfg -c init -c targets -c "halt" -c "flash erase_address 0x08000000 0x0100000" -c shutdown +IF NOT ERRORLEVEL 0 echo ERROR in %script_name% +IF NOT ERRORLEVEL 0 EXIT /B 1 + echo Just invoked openocd to erase chip! rem older disocovery boards or cheap eBay ST-Link -rem openocd\openocd.exe -f openocd/stm32f4discovery.cfg -c init -c targets -c "halt" -c "flash erase_address 0x08000000 0x0100000" -c shutdown \ No newline at end of file +rem openocd\openocd.exe -f openocd/stm32f4discovery.cfg -c init -c targets -c "halt" -c "flash erase_address 0x08000000 0x0100000" -c shutdown + +echo "exiting %script_name%" diff --git a/misc/jenkins/functional_test_and_build_bundle/hw_test.bat b/misc/jenkins/functional_test_and_build_bundle/hw_test.bat index ca49b00737..8f11a399f7 100644 --- a/misc/jenkins/functional_test_and_build_bundle/hw_test.bat +++ b/misc/jenkins/functional_test_and_build_bundle/hw_test.bat @@ -1,16 +1,22 @@ echo "TIMESTAMP %date% %time%" -echo I am hw_test.bat +set script_name=hw_test.bat +echo Entering %script_name% pwd cd firmware rem Using magic 'cd' system variable here set "cur_folder=%cd%" +echo "%script_name%: erasing first" call flash_erase407.bat cd %cur_folder% pwd -echo "hw_test.bat: trying to flash" +rem there is some instability with failed flash sometimes, maybe sleep would help? +sleep 3 +echo "%script_name%: trying to flash" rem This script depends on someone else building firmware call flash_openocd407.bat +IF NOT ERRORLEVEL 0 echo ERROR invoking flash_openocd407.bat +IF NOT ERRORLEVEL 0 EXIT /B 1 cd %cur_folder% @@ -36,4 +42,5 @@ IF NOT ERRORLEVEL 0 echo ERROR DETECTED IF NOT ERRORLEVEL 0 EXIT /B 1 echo "TIMESTAMP %date% %time%" -echo hw_test.bat: done +pwd +echo "exiting %script_name%"