I just set up my Cerberus with the RLP example based on the Hydra RLP wiki. I changed the addressing based on the firmware wiki for the Cerb-Family.
But, when I run it, the debug just hangs on the first invoke for the native code. Has anyone tried this yet? Is my addressing correct? What else could be causing this?
void ProgramStarted()
{
const int ARRAYSIZE = 10;
float TotalTime = 0;
uint TickStart = 0;
uint TickEnd = 0;
int ret = 0;
byte[] binfile = Resources.GetBytes(Resources.BinaryResources.RLPLite);
AddressSpace.Write(0x2001A000, binfile, 0, binfile.Length); //From the Cerb familiy firmware upgrade wiki
RLPLite.Procedure RLP_MemSet = new RLPLite.Procedure(0x2001A0C0); //I assumed this based on the Hydra example's offset
RLPLite.Procedure RLP_MemSetStdLib = new RLPLite.Procedure(0x2001A0F4); //I assumed this based on the Hydra example's offset
byte[] byteArray = new byte[ARRAYSIZE];
int[] length = new int[1];
length[0] = ARRAYSIZE;
byte[] value = new byte[1];
value[0] = 1;
Debug.Print("Parse an array using C# (managed) vs. C/C++ (native).");
Debug.Print("The array size holds 100,000 byte elements.");
Debug.Print("\nThis Segment uses the C# interpreter to set the array.");
TickStart = (uint)DateTime.Now.Ticks;
for (int x = 0; x < length[0]; x++)
{
byteArray[x] = value[0];
}
TickEnd = (uint)DateTime.Now.Ticks - TickStart;
TotalTime = (((float)TickEnd / 10) / 1000); // 1 tick is 1/10 of 1 µs.
Debug.Print("Parse time in ms: " + TotalTime);
value[0] = 2;
Debug.Print("\nThis segment uses native C/C++ to set the array.");
TickStart = (uint)DateTime.Now.Ticks;
ret = RLP_MemSet.Invoke(byteArray, length, value);
TickEnd = (uint)DateTime.Now.Ticks - TickStart;
TotalTime = (((float)TickEnd / 10) / 1000); // 1 tick is 1/10 of 1 µs.
Debug.Print("Parse time in ms: " + TotalTime);
value[0] = 3;
Debug.Print("\nThis segment uses the native C/C++ Standard Library to set the array. The Standard Library has optimized code.");
TickStart = (uint)DateTime.Now.Ticks;
ret = RLP_MemSetStdLib.Invoke(byteArray, length, value);
TickEnd = (uint)DateTime.Now.Ticks - TickStart;
TotalTime = (((float)TickEnd / 10) / 1000); // 1 tick is 1/10 of 1 µs.
Debug.Print("Parse time in ms: " + TotalTime);
}