isystem.UMIUtils API
API for manipulating UMI-2 compliant storage devices
 All Classes Files Functions Variables Enumerations Enumerator Defines
About isystem.UMIUtils API

isystem.UMIUtils API contains set of classes, allowing UMI-2 compliant storage device manipulation/debugging.

isystem.UMIUtils is built on top of isystem.connect library, allowing UMI driver code to be executed on the client.

As a benefit, debugging monitor code (without instrumentation) becomes possible.

Examples are written in Python, but it is easy to adapt them to other supported languages.

Setup

Unzip the iSystem.UMIUtils.Python.SDK.zip to an arbitary folder. Examine the sdk folder structure:

documentation The documentation folder
samples Monitor samples with full source code
lib UMIUtils API libraries for Python 2.6, 2.7 and 3.3

Usage


The fundamental precondition for isystem.umiutils is an established connection to winIDEA, because that is the place, where functions get executed. To establish a connection, we use the class isys::ConnectionMgr.
If you run Python console from winIdea, cmgr and dbg objects are already instantiated.

 {.py}

    import isystem.connect as ic
    import isystem.umiutils as uu

    # Prepare project-specific stuff. Change to your specifics 
    strWorkspace = 'D:\\BlueBox\\FlashMonitors\\UMI\\STM32F10xxCDE_2\\STM32F10xxCDE_2.xjrf' 
    strWinIdeaFolder = 'D:\\winIDEA'                                       
    strFlashFile = 'D:\\BlueBox\\FlashMonitors\\UMI\\STM32F10xxCDE_2\\STM32F10xxE_2.flash'

    # Create isystem.connect ConnectionMgr and connect to winIdea
    cmgr=ic.ConnectionMgr();
    try:
            cmgr.connectMRU(strWorkspace)
    except ic.IOException as ex:
            print('Problems connecting to winIdea! Error was {0}'.format(ex))
            exit
    
    # create isystem.connect CDebugFacade object to control the target
    dbg=ic.CDebugFacade(cmgr);


Next mandatory steps would be

Optionally,

 {.py}
    
    # Create UMI debug provider
    umiProvider = uu.CUMIDebugProvider(cmgr, strWinIdeaFolder)

    # Create storage device instance from the configuration FLASH file
    storageDevice=uu.CUMIStorageDevice(umiProvider, strFlashFile)

    # Adjust UMI engine options 
    umiEngineOpt = uu.CUMIEngine.eOptPreserveTarget | uu.CUMIEngine.eOptDebugEnable
    umiProvider.setUmiEngineOptions(umiEngineOpt)

    # Adjust storage device settings - enable after write verify and on-the-fly-verify
    conf=storageDevice.getConfigurationSp()
    conf.UMIDeviceSetVerify(True, True)


Now reset the target to activate memory access.
If you want to debug monitor, download code to the target and place breakpoint(s) at desired places.

 {.py}

    try:
        dbg.reset()
        dbg.download()
    except Exception as ex:
        print ('Reset target failed! Error was {0}'.format(ex))
        pass


Now perform desired storage device manipulation. For instance, mass erase the storage device:

 {.py}

    # Mass erase the storage device
    storageDevice.massErase()

Complete Python code may be found here: HelloUMI.py

That's it. Now you should examine CUMIStorageDevice class to find more about the available functionality.