We currently are using the CSpyBat program to reset/download/run a cortex-r4f target device. Something like the following:
set CSPY="C:\Program Files\IAR Systems\Embedded Workbench 6.0\common\bin\cspybat" "C:\Program Files\IAR Systems\Embedded Workbench 6.0\arm\bin\armproc.dll" "C:\Program Files\IAR Systems\Embedded Workbench 6.0\arm\bin\armjlink.dll"
set CSPYPARAMS=--plugin "C:\Program Files\IAR Systems\Embedded Workbench 6.0\arm\bin\armbat.dll" --backend -B "--endian=little" "--cpu=Cortex-R4F" "--fpu=VFPv3" "--semihosting" "--drv_communication=USB0" "--jlink_speed=auto" "--jlink_initial_speed=32" "--drv_catch_exceptions=0x000"
!CSPY! target.out !CSPYPARAMS!
I would like to progammatically do the same steps but in a C/C++ program using the Jlinksdk.dll API.
I have seen example postings on this forum that do similar steps but related to Flash programming like the following:
JLinkApi.Open();
JLinkApi.SelectInterface(ApiInterfaceType.JLINKARM_TIF_SWD);
JLinkApi.SetSpeed(1000);
JLinkApi.ExecCommand_Device("LM3S1968");
JLinkApi.Reset();
JLinkApi.Halt();
JLinkApi.BeginDownload();
JLinkApi.WriteMem(0x0, b);
JLinkApi.EndDownload();
JLinkApi.Reset();
JLinkApi.Go();
However I do not want to update the flash, I just want to download into RAM.
In the FlashDownload.c example I see this code but the comments certainly imply this is flash related:
JLINKARM_Reset();
JLINKARM_BeginDownload(0); // Indicates start of flash download
JLINKARM_WriteMem(FLASH_START_ADDR, FileSize, pBuffer); // Download file (into flash).
JLINKARM_EndDownload(); // Indicates end of flash download
would something like the following api calls be what is required?
JLINKARM_Halt();
JLINKARM_WriteMem(RAM_INSTRUCTION_START_ADDR, FileSize, pBuffer);
JLINKARM_Reset();
JLINKARM_Go();
set CSPY="C:\Program Files\IAR Systems\Embedded Workbench 6.0\common\bin\cspybat" "C:\Program Files\IAR Systems\Embedded Workbench 6.0\arm\bin\armproc.dll" "C:\Program Files\IAR Systems\Embedded Workbench 6.0\arm\bin\armjlink.dll"
set CSPYPARAMS=--plugin "C:\Program Files\IAR Systems\Embedded Workbench 6.0\arm\bin\armbat.dll" --backend -B "--endian=little" "--cpu=Cortex-R4F" "--fpu=VFPv3" "--semihosting" "--drv_communication=USB0" "--jlink_speed=auto" "--jlink_initial_speed=32" "--drv_catch_exceptions=0x000"
!CSPY! target.out !CSPYPARAMS!
I would like to progammatically do the same steps but in a C/C++ program using the Jlinksdk.dll API.
I have seen example postings on this forum that do similar steps but related to Flash programming like the following:
JLinkApi.Open();
JLinkApi.SelectInterface(ApiInterfaceType.JLINKARM_TIF_SWD);
JLinkApi.SetSpeed(1000);
JLinkApi.ExecCommand_Device("LM3S1968");
JLinkApi.Reset();
JLinkApi.Halt();
JLinkApi.BeginDownload();
JLinkApi.WriteMem(0x0, b);
JLinkApi.EndDownload();
JLinkApi.Reset();
JLinkApi.Go();
However I do not want to update the flash, I just want to download into RAM.
In the FlashDownload.c example I see this code but the comments certainly imply this is flash related:
JLINKARM_Reset();
JLINKARM_BeginDownload(0); // Indicates start of flash download
JLINKARM_WriteMem(FLASH_START_ADDR, FileSize, pBuffer); // Download file (into flash).
JLINKARM_EndDownload(); // Indicates end of flash download
would something like the following api calls be what is required?
JLINKARM_Halt();
JLINKARM_WriteMem(RAM_INSTRUCTION_START_ADDR, FileSize, pBuffer);
JLINKARM_Reset();
JLINKARM_Go();