need more DevOps :( trying with 'sleep'

This commit is contained in:
rusefi 2019-06-01 20:25:51 -04:00
parent 5b8dfbf444
commit dc9bf07414
2 changed files with 19 additions and 5 deletions

View File

@ -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
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%"

View File

@ -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%"