Main Site Documentation

Cerberus RLPLite Example Project question


#1

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);
        }

#2

[quote] 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 [/quote]
You can’t guess about those addresses. You must get them from the map file after compiling. If they are wrong then you will crash the Cerberus…


#3

In addition to what GMod said

From the wiki: (http://wiki.tinyclr.com/index.php?title=RLPLite_Demo)

[em]In order to execute the RLPLite functions that you compiled with Keil µVision4, you will need the specific address in memory that they are placed. You will need to go to the RLPLite Keil project folder and open the map file (RLPLite.map) with any text editor. Search for the names of the functions that you created, for this example RLP_MemSet, and RLP_MemSetStdLib. To the right of their names will be the addresses in memory that these functions are placed.[/em]


#4

Man you guys are good! I guess I got too excited jumping around trying to find the address for the Cerb-Family (on the firmware page if anybody asks).

Thanks for just kicking that Q’s butt in record time!


#5

Sorry continuing old thread, Hi rbrainard did find the address of the R/O Base and R/W Base, Am load the R/O with 0x2001A000 and R/W with 0x2009A000. After uploading, my firmware is crashed.Am using the stm32f407 with cerb family firmware. So can you able to confirm the address of the R/O and R/W.?