<div dir="ltr">Hi All,<br><br>I am currently working on a FPGA Nexys3, I synthesized on it a processor Leon3, above which I put an OS RTEMS.<br>
<br>
I faced a lot of difficulties developing RTEMS applications, so I<br>
decided to focus on interacting with the LEDs and switches of the<br>
Nexys3, but even this I can't seem to be able to implement. I think I<br>
understood the methods I had to use, and designed a little test of my<br>
own :<br><br>
#include <rtems.h><br>
#include <gpiolib.h><br>
#include <stdio.h><br>
#include <stdlib.h><br>
<br>
#define LED_ADR IO_L2P_CMPCLK<br>
<br>
int main() {<br>
void * port;<br>
int val = 0;<br>
<br>
printf("Attempting to open the port\n");<br>
gpiolib_initialize();<br>
port = gpiolib_open(LED_ADR);<br>
if (port == NULL) {<br>
printf("ok not working\n");<br>
exit(-1);<br>
}<br>
printf("Opening succeded\n");<br>
printf("Attempting to write in the port\n");<br>
gpiolib_set(port,0,0);<br>
printf("Writing succeeded\n");<br>
printf("Attempting to read the port\n");<br>
gpiolib_get(port, &val);<br>
printf("Reading succeeded\n");<br>
<br>
printf("value : %d\n, val);<br>
<br>
printf("Attempting to close the port\n");<br>
gpiolib_close(port);<br>
printf("Port closed\n");<br>
<br>
return 0;<br>
}<br>
<br>
but I spent days trying to find out the adress of the ports I would<br>
like to open,<br>
and searched all over the Internet (including all the available<br>
documentation),<br>
with no success.<br>
<br> I would really like it if someone could help me.<br>
<br>
Many thanks,<br>
<br>
Marjorie Dugrand</div>