Main Site Documentation

RLP on Fez Panda [Closed]


#1

Hi guys! I’m trying to implement RLP on my Fez Panda board (USBizi, MF v 4.1) . I began with examples provided by https://www.ghielectronics.com/downloads/src/RLP_User.zip.
(RLP_User\EMX\RLP_Extensions_Example\RLP_Managed\RLP_example Folder)

I’v added RLP.Unlock() form this thread : https://www.ghielectronics.com/community/forum/topic?id=10721&page=1
But on runtime I’m getting error



 #### Exception System.Exception - 0xffffffff (1) ####
    #### Message: 
    #### GHIElectronics.NETMF.Native.RLP::LoadELF [IP: 0000] ####
    #### GHIElectronics.NETMF.Native.RLP::LoadELF [IP: 000a] ####
    #### RLP_example.Program::Main [IP: 000d] ####


Entire code looks like this:


using System;
using Microsoft.SPOT;

using GHIElectronics.NETMF.Native;

namespace RLP_example
{
    public class Program
    {
        public static void Main()
        {
            // Make sure to unlock RLP before use!
            // Unlock RLP

            RLP.Unlock("97B4DCA1A1E2470744C8E6D6BE47230C", new byte[] { 0x8E, 0xCD, 0x52, 0x1B, 0x34, 0xB2, 0xA8, 0x22, 0xD6, 0xDE, 0xF6, 0x4E, 0x75, 0x12, 0x17, 0xB7, 0x53, 0x22, 0x8A, 0x81, 0x3C, 0xBB, 0x19, 0x5D, 0x7E, 0xEF, 0x08, 0x64, 0x02, 0x28, 0x1E, 0xDC });
            RLP.Enable();

            byte[] elf_file = Resources.GetBytes(Resources.BinaryResources.RLP_test);
            RLP.LoadELF(elf_file);
            // This method initializes BSS region to zeros using the default addresses declared in the GHI RLP examples linker script
            // "__bss_start__" and "__bss_end__"
            RLP.InitializeBSSRegion(elf_file);
            //or in a customized way
            //RLP.InitializeBSSRegion(elf_file, "__bss_start__", "__bss_end__");

            RLP.Procedure FillByteArray = RLP.GetProcedure(elf_file, "FillByteArray_c");
            RLP.Procedure ArgumentTest = RLP.GetProcedure(elf_file, "ArgumentTest");
            RLP.Procedure FloatTest = RLP.GetProcedure(elf_file, "FloatTest");

            // We don't need this anymore
            elf_file = null;
            Debug.GC(true);

            byte[] myArray = new byte[1000];

            // Fill myArray with 40, by passing the array to arguments.
            int size = FillByteArray.Invoke(myArray, 40);
            if (size >= 0)
                Debug.Print(size.ToString());

            // Test several types
            uint[] uintArray = new uint[] { 1, 123456789, 32 };
            byte[] byteArray = new byte[] { 0x12, 0xFF, 0x2D };

            int error = ArgumentTest.InvokeEx(uintArray, -5, 4.7f, "Hello!", byteArray);
            Debug.Print("Error:" + error.ToString());

            // This test passes float general array to FloatTest funtion and fill it up with floating numbers
            float[] farray = new float[10];
            FloatTest.InvokeEx(farray, farray.Length, 1.23f); // the formula is index/(1+1.23f)
            foreach (float x in farray)
            {
                Debug.Print(x.ToString());
            }
        }
    }
}


And error hits on



RLP.LoadELF(elf_file);


What can be the problem? Thanks in advance.


#2

I’v found the problem. I was using project for EMX (because on fist download it was the only one in folder O_o) and .elf file was made for EMX platform. With project for USBizi everything works fine )