Menu

#290 Getting an error while running C# application

v1.0 (example)
closed-invalid
nobody
None
5
2014-07-04
2014-07-03
Amr
No

Hi,
I am trying to use convert three jar files as follow in Linux:
- sudo ikvmc -sharedclassloader pi4j-core.jar pi4j-device.jar pi4j-gpio-extension.jar
- the convert was successful with no error and create pi4j-core.dll.
- I use the new dll in C# application as follow:
using com.pi4j.io.gpio;
using com.pi4j.wiringpi;
//using IKVM.Reflection;
using java.lang;
using System.Reflection;

namespace SPI_PI
{
class Program
{
static void Main(string[] args)
{
ikvm.runtime.Startup.addBootClassPathAssemby(Assembly.Load("pi4j-core"));
GpioController gpio = GpioFactory.getInstance();
GpioPinDigitalOutput pin = gpio.provisionDigitalOutputPin(RaspiPin.GPIO_08, "MyLED", PinState.HIGH);
pin.low();
Thread.sleep(5000);
pin.toggle();
Thread.sleep(5000);
}

}

}

  • then I try compile the application using the command sudo mcs SPI_PI.cs -r:pi4j-core.dll and no error.
  • I copy the pi4j-core.dll to /usr/lib/ikvm/ as well as the same directory of the exe application.
  • then I run the application using sudo mono SPI_PI.exe and I get the following error:
    Unhandled Exception:
    System.ExecutionEngineException: SIGILL
    at java.util.concurrent.ConcurrentHashMap..ctor (Int32 initialCapacity, Single loadFactor, Int32 concurrencyLevel) [0x00000] in <filename unknown="">:0
    at java.util.concurrent.ConcurrentHashMap..ctor () [0x00000] in <filename unknown="">:0
    at com.pi4j.io.gpio.GpioProviderBase..ctor () [0x00000] in <filename unknown="">:0
    at com.pi4j.io.gpio.RaspiGpioProvider..ctor () [0x00000] in <filename unknown="">:0
    at com.pi4j.io.gpio.GpioFactory.getDefaultProvider () [0x00000] in <filename unknown="">:0
    at com.pi4j.io.gpio.impl.GpioControllerImpl..ctor () [0x00000] in <filename unknown="">:0
    at com.pi4j.io.gpio.GpioFactory.getInstance () [0x00000] in <filename unknown="">:0
    at SPI_PI.Program.Main (System.String[] args) [0x00000] in <filename unknown="">:0
    [ERROR] FATAL UNHANDLED EXCEPTION: System.ExecutionEngineException: SIGILL
    at java.util.concurrent.ConcurrentHashMap..ctor (Int32 initialCapacity, Single loadFactor, Int32 concurrencyLevel) [0x00000] in <filename unknown="">:0
    at java.util.concurrent.ConcurrentHashMap..ctor () [0x00000] in <filename unknown="">:0
    at com.pi4j.io.gpio.GpioProviderBase..ctor () [0x00000] in <filename unknown="">:0
    at com.pi4j.io.gpio.RaspiGpioProvider..ctor () [0x00000] in <filename unknown="">:0
    at com.pi4j.io.gpio.GpioFactory.getDefaultProvider () [0x00000] in <filename unknown="">:0
    at com.pi4j.io.gpio.impl.GpioControllerImpl..ctor () [0x00000] in <filename unknown="">:0
    at com.pi4j.io.gpio.GpioFactory.getInstance () [0x00000] in <filename unknown="">:0
    at SPI_PI.Program.Main (System.String[] args) [0x00000] in <filename unknown="">:0

any suggestion.
thanks,
Amr

Discussion

  • Jeroen Frijters

    Jeroen Frijters - 2014-07-04

    This is almost not certainly not an IKVM bug.

     
  • Jeroen Frijters

    Jeroen Frijters - 2014-07-04
    • status: open --> closed-invalid
     

Log in to post a comment.