GPIOPin.getValue() runs into Exceptions for an input pin

Peter Saitz peter.saitz at savien.at
Fri Oct 23 19:53:00 UTC 2015


Hi

As I have mentioned in my last mail (October 21, 2015), I have ported 
OpenJDK Digital I/O to an embedded board with a Freescale i.MX6 Quad 
processor, running Ubunto Linux, built dio.jar and libdio.s on the board.

When I configure a GPIO pin for output, *GPIOPin.getValue()* crashes 
with the following appearance:

    From: src/share/linux/native/com/oracle/dio/gpio/gpio.c, line 819
    Error values from value GPIO pin 124 file was readed: 50 54
    From: src/share/linux/native/com/oracle/dio/gpio/gpio.c, line 819
    Error values from value GPIO pin 124 file was readed: 50 54

    java.io.IOException
             at com.oracle.dio.gpio.impl.GPIOPinImpl.readPin0(Native Method)
             at
    com.oracle.dio.gpio.impl.GPIOPinImpl.getValue(GPIOPinImpl.java:118)
             .....
    ===== Uncaught exception catched =====
    java.nio.BufferUnderflowException
             at java.nio.Buffer.nextGetIndex(Buffer.java:500)
             at
    java.nio.ByteBufferAsIntBufferB.get(ByteBufferAsIntBufferB.java:111)
             at
    com.oracle.dio.impl.EventQueueManager.handleEvent(EventQueueManager.java:98)
             at com.oracle.dio.impl.EventQueue.dispatch(EventQueue.java:161)
             at
    com.oracle.dio.impl.EventQueue.access$500(EventQueue.java:38)
             at
    com.oracle.dio.impl.EventQueue$EventDispatchThread.run(EventQueue.java:116)
             at java.lang.Thread.run(Thread.java:745)


Note: It's not a copy/paste problem, the first 2 lines from gpio.c came 
realy 2 times.

Here the relevant code from my sources:

    GPIOPinConfig pinConfig = new GPIOPinConfig.Builder()
             .setControllerNumber(0)
             .setPinNumber(124)
             .setDirection(GPIOPinConfig.DIR_INPUT_ONLY)
             .setTrigger(GPIOPinConfig.TRIGGER_BOTH_EDGES)
             .setDriveMode(GPIOPinConfig.MODE_INPUT_PULL_DOWN)
             .setInitValue(true)
             .build();
    GPIOPin pin = (GPIOPin)DeviceManager.open(GPIOPin.class, pinConfig);

    ...... in another method ......
    boolean value = pin.getValue();


Who can help or fix this bug?

Note:
I'm using the latest release from http://hg.openjdk.java.net/dio/dev

With kind regards
Peter Saitz

-- 
_________________________

Peter Saitz
Software Developer

Savien Technologies GmbH.
Bierhäuselberggasse 31
A-1140 Wien

mailto: peter.saitz at savien.at
phone: +43 699 19650224



More information about the dio-dev mailing list