Please enable JavaScript to view this site.

winIDEA Help

Version: 9.21.300

Implement a Custom emuSync Hook

In this topic:

Requirement

Configuration steps

 

 

Introduction

This is a step-by-step example of a situation where you want a custom Python script to run after a Stop command is executed on the CPU. For more information refer to emuSync Hooks.

 

 

Requirement

The hook must be passed an instance of the ConnectionMgr class.

 

 

Configuration steps

number1

Prepare the Python script.

The script file is called onStopScript.py and it is located in the Desktop. Inside the file, there is a function called onStopHook which is the one you want emuSync to run after Stop commands.

 

import isystem.connect as ic
import time

 
# The connection manager is passed to the hook from emuSync so that you can manipulate winIDEA inside the hook.

 
def onStopHook(connMgr):
   loaderMgr = ic.CLoaderController(connMgr)
   loaderMgr.download()
   executionMgr = ic.CExecutionController(connMgr)
   executionMgr.run()
   time.sleep(5)
   executionMgr.stop()
   print(“Hook over.”)

 

 

number2

Update the onStop hook in the configuration file:

hookPath - Python script path.

hookStart - Python method/function you wish to call.

isActive - True.

 

module:
 onStop:
   hookPath: C:\Users\User1\Desktop\onStopScript.py
   hookStart: onStopHook
   isActive: True

 

 

number3

Save the configuration file and then open it in emuSync.

 

 

More resources

Multi-Core and Multi-SoC Synchronization - Overview

emuSync - Overview

 

 

Copyright © 2024 TASKING