This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
我正在开发一个 C#应用程序、使用 Uniflash CLI 加载 TI DSP。 使用 UNIFLASH 工具创建了一个软件包、并在 C#应用程序中调用了该批处理文件。
问题:配置调试器时,执行似乎停止。 上次从 CLI 返回:
配置调试器(首次启动时可能需要几分钟时间)...
从 Windows 控制台运行相同的批处理文件时、它会按预期完成。 是否有示例 CLI UNIFLASH 对话框或此问题的已知解决方案?
C#代码段:
//将目录设置为应用程序文件夹
System.Diagnostics.Process Process = new System.Diagnostics.Process();
Process.StartInfo.WindowStyle = System.Diagnostics.ProcessWindowStyle.Hidden;
process.StartInfo.filename ="cmd.exe";
Process.StartInfo.arguments ="C CD "+ folder;
Process.StartInfo.UseShellExecute = false;
Process.StartInfo.CreateNoWindow = true;
Process.StartInfo.RedirectStandardOutput = true;
Process.StartInfo.RedirectStandardError = false;
Process.Start();
Process.WaitForExit();
process.close ();
//第一个 UNIFLASH 批处理文件
Process.StartInfo.arguments ="C "+ tbCmd.text;
Process.Start();
rtnval =等待 process.StandardOutput.ReadToEndAsync();
David、您好!
您在使用什么 TI DSP?
谢谢!
~伦纳德
TMS320F28384D
批处理文件
"回波。
CMD..."
不从 C#执行,而是按预期从 Windows cmd 窗口执行。
REM 未给出任何参数,使用默认生成的命令
如果"%1" EQU""(
回波执行默认命令:
echo ^> dslite --mode !模式! !生成命令! !附加!
回波。
CMD /S /C "%executive%!mode! !生成命令! !添加!"
退出/b !错误级别!
)
尊敬的 David:
将线程传输到 Uniflash 团队时、他们将提供输入。
此致、
拉杰什怀特
尊敬的 David:
未从 C#执行,但按预期从 Windows cmd 窗口执行。
UniFlash 设计为从 Windows cmd 或 PowerShell 等系统命令窗口运行。 虽然人们已经通过标准的脚本语言(如 javascript 和 python)顺利地完成了工作、但我们没有任何关于从 C#应用程序运行的额外专业知识来分享。
解决了问题。 您必须 对 c#的 CLI 命令中的引用使用绝对路径。 从 UNIFLASH 创建的软件包采用相对路径。 环境变量不带有 C#。 也许这对某人来说是有价值的。
绝对路径示例(与 C#配合使用):
C:\ti\uniflash_6.2.0\desktopdb\content\TICloudAgent\win\ccs_base\DebugServer\bin\DSLite.exe flash -c C:\ \user_files\configs\f28384d.ccxml -l C:\ user_files\settings\generated.ufsettings -s VerifyAfterProgramLoad="No verifications"-e -f -v "C:\ USER_FILES\IMAGE\MyCpu1Firmware.OUT""C:\ \user_files\images\MyCpu2Firmware.out" C:\ \user_files\images\MyCmFirmware.out"
感谢您分享您的解决方案!