程序
#include <RtosLib.h>
#include <stdio.h>
UINT32 RtosToStart(const char *sLoadFile, const char *sConfigFile)
{
printf("LOADFILE: %s\n", sLoadFile);
printf("CONFIGFILE: %s\n", sConfigFile);
UINT32 dwRetVal;
dwRetVal = RtosLibInit();
if (RTE_SUCCESS != dwRetVal)
{
printf("RtosLibInit Error(0x%X)\n", dwRetVal);
return dwRetVal;
}
dwRetVal = RtosStartExA(sLoadFile, sConfigFile, 0);
if (RTE_SUCCESS != dwRetVal)
{
printf("RtosStartExA Error(0x%X)\n", dwRetVal);
return dwRetVal;
}
printf("Start RTOS\n");
return dwRetVal;
}
int main(char argc, char *argv[])
{
return RtosToStart(argv[1], argv[2]);
}
其中CONFIGFILE中指定目标workspace中的startup.config。
遇到的错误
PS C:\du\ecwin_loader\build-x64\Release> ./ecwin_loader "C:/Program Files (x86)/acontis_technologies/EC-WinRTOS-32/Bin/RTOS-32/x86/loader.bin" "'C:/du/test/config/startup.config' /vmf 'C:/Program Files (x86)/acontis_technologies/EC-WinRTOS-32/vmf.bin'"
IMAGE: C:/Program Files (x86)/acontis_technologies/EC-WinRTOS-32/Bin/RTOS-32/x86/loader.bin
CONFIG: 'C:/du/test/config/startup.config' /vmf 'C:/Program Files (x86)/acontis_technologies/EC-WinRTOS-32/vmf.bin'
RtosStartExA Error(0x10F4)
情况 | 错误码 |
---|---|
目前在x64平台的工控机使用,用32位编译。 | 0x5060051 |
指定startup.config路径错误。 | 0x10AF |
指定vmf.bin文件路径错误。 | 0x10A9 |
使用“/vmf”但不指定vmf.bin文件。 | 0x4 |