Problems using RTEMS GPIO

Marjorie Dugrand marjorie.dugrand at gmail.com
Mon Jun 2 08:33:04 UTC 2014


Hello all,

I am currently working on a FPGA Nexys3, I synthesized on it a processor
Leon3, above which I put an OS RTEMS.

I faced a lot of difficulties developing RTEMS applications, so I decide to
focus on
interacting with the LEDs and switches of the Nexys3, but even this I can't
seem to be able to implement. I think I understood the methods I had to
use, and designed a little test of my own :

#include <rtems.h>
#include <gpiolib.h>
#include <stdio.h>
#include <stdlib.h>

#define LED_ADR IO_L2P_CMPCLK

int main() {
    void * port;
    int val = 0;

    printf("Tentative d'ouverture du port\n");
    gpiolib_initialize();
    port = gpiolib_open(LED_ADR);
    if (port == NULL) {
        printf("ok ça marche pas\n");
        exit(-1);
    }
    printf("Ouverture réussie\n");
    printf("Tentative d'écriture dans le port\n");
    gpiolib_set(port,0,0);
    printf("Ecriture réussie\n");
    printf("Tentative de lecture du port\n");
    gpiolib_get(port, &val);
    printf("Lecture réussie\n");
    printf("valeur du port %d\n", val);
    printf("Tentative d'écriture dans le port\n");
    gpiolib_set(port,1,0);
    printf("Ecriture réussie\n");
    printf("Tentative de lecture du port\n");
    gpiolib_get(port, &val);
    printf("Lecture réussie\n");
    printf("valeur du port %d\n", val);
    printf("Tentative de fermeture du port\n");
    gpiolib_close(port);
    printf("Fermeture réussie\n");

    return 0;
}

but I spent days trying to find out the adress of the ports I would like to
open,
and searched all over the Internet (including all the available
documentation),
with no success.

I would really like it if someone were to help me.

Many thanks,

Marjorie Dugrand
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/users/attachments/20140602/115d6c02/attachment.html>


More information about the users mailing list