Is it possible to automate UDE by Windows PowerShell?

Yes, because Windows PowerShell can deal with COM objects it can also control UDE.

Here is a small example which starts UDE, programs the FLASH with an application, executes the program for 1 seconds and read some variables.


  # UDE automation basics - PowerShell demo script
  # On command line run: "powershell .\UDEAutomationDemo.ps1"
  # In PowerShell console run: ".\UDEAutomationDemo.ps1"
  # Note: Don't use expression '$true' together with UDE functions, use 1 instead

  # Helper function to release COM objects
  function Release-Ref ($ref)
    ([System.Runtime.InteropServices.Marshal]::ReleaseComObject([System.__ComObject]$ref) -gt 0)


  $WspFile = "D:\UdeAutomationDemo\UdeAutomationDemo.wsx"
  $CfgFile = "D:\UdeAutomationDemo\TriBoard_TC27xB_dap.cfg"
  $ElfFile = "D:\UdeAutomationDemo\MulticoreDemo.elf"

  write-output "Create new UDELauncher object ..."
  $UDELauncher = New-Object -ComObject $ProgId

  write-output "Start new UDE instance"
  $UDEApplication = $UDELauncher.StartAndCreateWorkspace("UDEVisualPlatform.exe", $WspFile, $CfgFile, 1)
  $Output = " UDE version: " + $UDEApplication.VersionInfo
  write-output $Output

  write-output "Access workspace"
  $UDEWorkspace = $UDEApplication.Workspace
  $Output = " Workspace: " + $UDEWorkspace.ProjectTitle
  write-output $Output

  write-output "Access first core debugger"
  $UDEDebugger = $UDEWorkspace.CoreDebugger(0)

  write-output "Wait for target connected"
  while (0 -eq $UDEDebugger.Connected)

  write-output "Load target application"

  write-output "Start target application"

  write-output "Wait a second"

  write-output "Read some variables"
  $Seconds = $UDEDebugger.ReadVariable("g_SharedData.Seconds")
  $Output = " Time: " + $Seconds
  write-output $Output

  write-output "Release objects and close UDE instance"

  write-output "Release UDE launcher (optional)"

  write-output "Finished"

Please see the UDE Manual, the UDE Help and UDEAutomation.chm for more details about automation with UDE.