run: wait some time before loading images via JTAG

When powering up the device it sometimes needs some seconds before the
bootloader prepared the board to use JTAG uploading.
This commit is contained in:
Stefan Kalkowski 2014-07-01 12:10:57 +02:00 committed by Norman Feske
parent 3d68125b5e
commit b07b6666d6
1 changed files with 4 additions and 0 deletions

View File

@ -751,10 +751,14 @@ proc jtag_load { } {
set board [get_cmd_arg --jtag-board 1]
set elf_img "[run_dir]/image.elf"
# sleep a bit, board might need some time to come up
sleep 8
# parse ELF entrypoint
set entrypoint [exec [cross_dev_prefix]readelf -h $elf_img | \
grep "Entry point address: " | \
sed -e "s/.*Entry point address: *//"]
eval spawn openocd -f $debugger -f $board -c init -c halt -c \"load_image $elf_img\" -c \"resume $entrypoint\"
set jtag_spawn_id $spawn_id
set timeout 210