E100 - Interface between OMAP3 and FPGA

Dear all,

I need to send data from the OMAP3 to the Spartan3an FPGA. As I
understand ,from the wiki and presentations, there are two ways to
communicate namely; using setting_reg and GPIO. The second way seems
easier so I’ll try it first.

I intend to set or clear the free GPIOS on the Spartan FPGA such as
over_gpio_22. I added the following code to the example
tx_waveforms.cpp.

static struct gpio gpio_test = { 22, GPIOF_OUT_INIT_LOW, 

“OVERO_GPIO_22” };
gpio_set_value(22,1);
//set gpio22 which is connected to pin IO_L30N_0

I tried to compile then I got the error that can’t find GPIO.h.

My question: did I use the correct high level function or I used a
“lower level” that is used to implement the function?

Regards,
S. Yassin

On 04/28/2012 08:07 AM, Sameh Y. wrote:

I tried to compile then I got the error that can’t find GPIO.h.

My question: did I use the correct high level function or I used a “lower level”
that is used to implement the function?

This is the easiest way to toggle gpio’s from userspace.

http://wiki.gumstix.org/index.php?title=GPIO#Accessing_GPIO.27s_from_userland

Also:

http://elinux.org/GPIO

The kernel on the e100 already supports the sysfs entries for gpio’s.
(UHD uses it)

Philip

Hello Dear ,

I used the first link to use overo GPIOs on the E100 to communicate with
the SPARTN3AN FPGA.

I’m doing the following:
1- I chose an empty GPIO input to the FPGA (for example overo_gpio22).
2- I modified the FPGA image so that debug_led1 = over_gpio220
3- I’ll set and clear overo GPIO using the bash shell as I read in the
first link that u recommended.

The problem:
Although the following gpios are free on the FPGA.There are other gpios
valid on the overo. Srictly speaking

The free GPIOs on the overo
$ root@usrp-e1xx:/sys/class/gpio# ls

exportgpio16 gpio168 gpiochip128 gpiochip192 gpiochip64 unexport
gpio15gpio164 gpiochip0 gpiochip160 gpiochip32 gpiochip96

The free gpios at the FPGA found at u1e.v
input overo_gpio0, input overo_gpio14, input overo_gpio21, input
overo_gpio22, // Misc GPIO

input overo_gpio23, input overo_gpio64, input overo_gpio127, // Misc
GPIO
input overo_gpio176, input overo_gpio163, input overo_gpio170, // Misc
GPIO

Is that normal of I did something wrong at the kernel at the overo?

Regards,
S. Yassin
HW Engineer
DLECS


From: Philip B. [email protected]
To: Sameh Y. [email protected]
Cc: “[email protected][email protected]
Sent: Saturday, April 28, 2012 2:18 PM
Subject: Re: [Discuss-gnuradio] E100 - Interface between OMAP3 and FPGA

On 04/28/2012 08:07 AM, Sameh Y. wrote:

I tried to compile then I got the error that can’t find GPIO.h.

My question: did I use the correct high level function or I used a “lower level”
that is used to implement the function?

This is the easiest way to toggle gpio’s from userspace.

http://wiki.gumstix.org/index.php?title=GPIO#Accessing_GPIO.27s_from_userland

Also:

http://elinux.org/GPIO

The kernel on the e100 already supports the sysfs entries for gpio’s.
(UHD uses it)

Philip

Dear P. Balister,
I found that tutorial which explains very well how to create a GPIO
folder and set its direction
http://www.avrfreaks.net/wiki/index.php/Documentation:Linux/GPIO#gpio-sysfs

I searched for the misc GPIOs to make sure they are free and I’m pretty
sure that over_gpio0 and overo_gpio170 are free. the are not used at all
inside the code. I connected them to debug led0 and debug_led1 and used
echo 1> /sys/class/gpio/gpio0/value after setting the direction but
nothing at all, the two debug leds are off.

Another question, what is the difference between gpio0 and gpiochip0
found at /sys/class/gpio

Regards,
S. Yassin
HW Engineer
DLECS


From: Philip B. [email protected]
To: Sameh Y. [email protected]
Cc: GNURADIO [email protected]
Sent: Wednesday, May 2, 2012 1:33 PM
Subject: Re: [Discuss-gnuradio] E100 - Interface between OMAP3 and FPGA

On 05/01/2012 04:28 AM, Sameh Y. wrote:

Although the following gpios are free on the FPGA. There are other gpios valid
on the overo. Srictly speaking

The free GPIOs on the overo
$ root@usrp-e1xx:/sys/class/gpio# ls

exportgpio16 gpio168 gpiochip128 gpiochip192 gpiochip64 unexport
gpio15gpio164 gpiochip0 gpiochip160 gpiochip32 gpiochip96

It looks like you are running an older version of uhd, which suggests an
older kernel version. The older driver claimed a few extra gpio’s for
testing purposes.

I see:

root@usrp-e1xx:~# ls /sys/class/gpio/
export gpio16@ gpio173@ gpiochip128@ gpiochip32@ unexport
gpio114@ gpio164@ gpio175@ gpiochip160@ gpiochip64@
gpio15@ gpio168@ gpiochip0@ gpiochip192@ gpiochip96@

Note the extra gpio’s exposed to user space. These are used by uhd for
signaling and configuring the clock generator.

Philip

On 05/02/2012 08:16 AM, Sameh Y. wrote:

Dear P. Balister,
I found that tutorial which explains very well how to create a GPIO folder and
set its direction
http://www.avrfreaks.net/wiki/index.php/Documentation:Linux/GPIO#gpio-sysfs

I searched for the misc GPIOs to make sure they are free and I’m pretty sure
that over_gpio0 and overo_gpio170 are free. the are not used at all inside the
code. I connected them to debug led0 and debug_led1 and used echo 1>
/sys/class/gpio/gpio0/value after setting the direction but nothing at all, the
two debug leds are off.

What version of the e100 image are you using. Can you start by making
sure you are using the latest?

http://code.ettus.com/redmine/ettus/projects/usrpe1xx/wiki/FAQ#How-do-I-create-re-create-E1xx-SD-Card-Images

I think earler images will not have access to gpio0 due to some pinmux
stuff in u-boot. I need to double check 170 pinmuxing also. there should
be some free gpios in the 20’s with the current image.

Another question, what is the difference between gpio0 and gpiochip0 found at
/sys/class/gpio

I think the gpiochip entries represent the various banks of gpios.

Philip

On 05/01/2012 04:28 AM, Sameh Y. wrote:

Although the following gpios are free on the FPGA. There are other gpios valid
on the overo. Srictly speaking

The free GPIOs on the overo
$ root@usrp-e1xx:/sys/class/gpio# ls

exportgpio16 gpio168 gpiochip128 gpiochip192 gpiochip64 unexport
gpio15gpio164 gpiochip0 gpiochip160 gpiochip32 gpiochip96

It looks like you are running an older version of uhd, which suggests an
older kernel version. The older driver claimed a few extra gpio’s for
testing purposes.

I see:

root@usrp-e1xx:~# ls /sys/class/gpio/
export gpio16@ gpio173@ gpiochip128@ gpiochip32@ unexport
gpio114@ gpio164@ gpio175@ gpiochip160@ gpiochip64@
gpio15@ gpio168@ gpiochip0@ gpiochip192@ gpiochip96@

Note the extra gpio’s exposed to user space. These are used by uhd for
signaling and configuring the clock generator.

Philip

Hello dear,

I followed the instruction and updated my sd card image. Now, inside
/sys/class/gpio

$root@usrp-e1xx:/sys/class/gpio# ls
export gpio16@ gpio173@ gpiochip128@ gpiochip32@ unexport
gpio114@ gpio164@ gpio175@ gpiochip160@ gpiochip64@
gpio15@ gpio168@ gpiochip0@ gpiochip192@ gpiochip96@

They changed from last version as us said. However, none of these are
connected to the FPGA.
Should I try
$ echo 22 > /sys/class/gpio/export
$ echo “high” > /sys/class/gpio/gpio72/direction

or it is meaningless to create gpio “driver” in this way.

Regards,
S. Yassin
HW Engineer
DLECS


From: Philip B. [email protected]
To: Sameh Y. [email protected]
Sent: Thursday, May 3, 2012 1:30 PM
Subject: Re: Making sure of uboot version

On 05/03/2012 07:14 AM, Sameh Y. wrote:

Hello Dear,

I’ve monitored the automatic boot and I think that is the latest version

U-Boot 2011.06-00575-g6b73deb (Sep 07 2011 - 07:26:10)

It is not. You need to make an sd card with the e1xx-003 image on it.

See the link in the earlier email for instructions how to do this.

Philip

Hello Dear,

I’ve monitored the automatic boot and I think that is the latest version

U-Boot 2011.06-00575-g6b73deb (Sep 07 2011 - 07:26:10)

I also checked uname -a

3.0.0.

Regards,
S. Yassin
HW Engineer
DLECS


From: Philip B. [email protected]
To: Sameh Y. [email protected]
Cc: GNURADIO [email protected]
Sent: Wednesday, May 2, 2012 3:02 PM
Subject: Re: Using Sysfs to set a GPIO in Overo

On 05/02/2012 08:16 AM, Sameh Y. wrote:

Dear P. Balister,
I found that tutorial which explains very well how to create a GPIO folder and
set its direction
http://www.avrfreaks.net/wiki/index.php/Documentation:Linux/GPIO#gpio-sysfs

I searched for the misc GPIOs to make sure they are free and I’m pretty sure
that over_gpio0 and overo_gpio170 are free. the are not used at all inside the
code. I connected them to debug led0 and debug_led1 and used echo 1>
/sys/class/gpio/gpio0/value after setting the direction but nothing at all, the
two debug leds are off.

What version of the e100 image are you using. Can you start by making
sure you are using the latest?

http://code.ettus.com/redmine/ettus/projects/usrpe1xx/wiki/FAQ#How-do-I-create-re-create-E1xx-SD-Card-Images

I think earler images will not have access to gpio0 due to some pinmux
stuff in u-boot. I need to double check 170 pinmuxing also. there should
be some free gpios in the 20’s with the current image.

Another question, what is the difference between gpio0 and gpiochip0 found at
/sys/class/gpio

I think the gpiochip entries represent the various banks of gpios.

Philip