Skip to content

Commit

Permalink
[uTVM] Reset target and wait for runtime initialization on connect. (a…
Browse files Browse the repository at this point in the history
…pache#5499)

* This ensures a clean runtime environment for tuning and evaluating
   tasks.
 * This patch assumes that the code flashed to target executes the ARM
   BKPT or RISC-V EBREAK instructions after startup.
  • Loading branch information
areusch authored and trevor-m committed Jun 18, 2020
1 parent 0b2cac5 commit 63b9333
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/runtime/micro/openocd_low_level_device.cc
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
/*!
* \file openocd_low_level_device.cc
*/
#include <sstream>
#include <iomanip>
#include <sstream>

#include "micro_common.h"
#include "low_level_device.h"
Expand All @@ -46,7 +46,10 @@ class OpenOCDLowLevelDevice final : public LowLevelDevice {
port_ = port;

socket_.Connect(tvm::support::SockAddr(server_addr_.c_str(), port_));
socket_.cmd_builder() << "halt 0";
socket_.cmd_builder() << "reset run";
socket_.SendCommand();

socket_.cmd_builder() << "halt 500";
socket_.SendCommand();
}

Expand Down

0 comments on commit 63b9333

Please sign in to comment.