Quantcast

Re-muxing Overo UART2 at runtime

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re-muxing Overo UART2 at runtime

dave.billin
Has anyone been able to use devmem2 at runtime to re-mux Overo UART2 Tx/Rx to the GPIO146_PWM11/GPIO147_PWM8 signals on the 40-pin TOBI header?  I have successfully re-muxed these signals using a modified u-boot, but I'm wondering whether the same thing can be done in a shell script using devmem2 after the kernel has booted. 

So far, I've tried running the following bash script under a (2.6.39) factory console image to try and adjust the mux settings :

#!/bin/sh
# Clear the existing UART2 mapping to the BT module
devmem2 0x4800216C w 0
devmem2 0x48002170 w 0

# Map UART2 to TOBI pin signals
devmem2 0x48002178 w 0x01000000


This results in the following console output:
Memory mapped at address 0x401e0000.
Read at address  0x4800216C (0x401e016c): 0x00000000
Write at address 0x4800216C (0x401e016c): 0x00000000, readback 0x00000000
/dev/mem opened.
Memory mapped at address 0x402e2000.
Read at address  0x48002179 (0x402e2178): 0x01000000
Write at address 0x48002179 (0x402e2178): 0x00000000, readback 0x00000000
/dev/mem opened.
Memory mapped at address 0x40126000.
Read at address  0x48002178 (0x40126178): 0x00000000
Write at address 0x48002178 (0x40126178): 0x01000000, readback 0x01000000

I have an oscilloscope connected to the GPIO146_PWM11 pin on the TOBI board so that I can observe whether serial data is present.  To check whether the mux changes have been applied, I run:
echo 'hello' > /dev/ttyO1

The echo command does not appear to work, however.  The command does not return (i.e. I have to Ctrl-C out of it), and my scope shows no activity on the Tx pin.  For what it's worth, I did verify that the scope *does* show activity when my console image with a modified u-boot is used.

I can continue to use my custom image with mapping done in u-boot, but I'd love to know whether the devmem2 approach is also possible.

Best Regards,

Dave Billin

Graduate Research Assistant --MS Computer Engineering
University of Idaho
Moscow, Idaho 83844

e-mail: [hidden email]


------------------------------------------------------------------------------
The demand for IT networking professionals continues to grow, and the
demand for specialized networking skills is growing even more rapidly.
Take a complimentary Learning@Cisco Self-Assessment and learn
about Cisco certifications, training, and career opportunities.
http://p.sf.net/sfu/cisco-dev2dev
_______________________________________________
gumstix-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gumstix-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Re-muxing Overo UART2 at runtime

Jesse Lackey-2
Hello!  Wow, a question a newbie like me can actually answer!  :)  Nice
to be able to 'give back' to the list.

I have done this exact thing, with a Tobi board, and here's the shell
script.

echo "UART2 (/dev/ttyS1) config register1: 0x48002170, set to GPIO input
w/pullup"
devmem2 0x48002170 w 0x011C011C
echo
echo "UART2 (/dev/ttyS1) config register2: 0x48002178, set to UART RX
and TX"
devmem2 0x48002178 w 0x01180000
echo

I disabled bluetooth by renaming /etc/init.d/bluetooth file, but I still
get lots of bluetooth messages in dmesg.  Not sure if it is actually
disabled, but the serial works:
<http://old.nabble.com/Overo-Air-bluetooth-and-wifi-power-td28775963.html#a28907238>

It would be great to have these exact steps in the wiki or official
gumstix docs.  Wanting a 2nd serial port is not uncommon at all and it
took some effort to get it going.  It absolutely should have been
clearly documented by gumstix.

Let me know if it works or not...
J


> Has anyone been able to use devmem2 at runtime to re-mux Overo UART2
> Tx/Rx to the GPIO146_PWM11/GPIO147_PWM8 signals on the 40-pin TOBI
> header?  I have successfully re-muxed these signals using a modified
> u-boot, but I'm wondering whether the same thing can be done in a
> shell script using devmem2 after the kernel has booted.
>


------------------------------------------------------------------------------
The demand for IT networking professionals continues to grow, and the
demand for specialized networking skills is growing even more rapidly.
Take a complimentary Learning@Cisco Self-Assessment and learn
about Cisco certifications, training, and career opportunities.
http://p.sf.net/sfu/cisco-dev2dev
_______________________________________________
gumstix-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gumstix-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Re-muxing Overo UART2 at runtime

dave.billin
Jesse,

Thanks for the reply.  I'll try this out first thing tomorrow.  Can you confirm that you are using the latest kernel version (2.6.39)?
I completely agree that this info should be included in the Wiki.  Perhaps I'll write something up when I've finished.

Best Regards,

Dave Billin

Graduate Research Assistant --MS Computer Engineering
University of Idaho
Moscow, Idaho 83844

e-mail: [hidden email]



> Date: Thu, 27 Oct 2011 16:01:44 -0700

> From: [hidden email]
> To: [hidden email]
> Subject: Re: [Gumstix-users] Re-muxing Overo UART2 at runtime
>
> Hello! Wow, a question a newbie like me can actually answer! :) Nice
> to be able to 'give back' to the list.
>
> I have done this exact thing, with a Tobi board, and here's the shell
> script.
>
> echo "UART2 (/dev/ttyS1) config register1: 0x48002170, set to GPIO input
> w/pullup"
> devmem2 0x48002170 w 0x011C011C
> echo
> echo "UART2 (/dev/ttyS1) config register2: 0x48002178, set to UART RX
> and TX"
> devmem2 0x48002178 w 0x01180000
> echo
>
> I disabled bluetooth by renaming /etc/init.d/bluetooth file, but I still
> get lots of bluetooth messages in dmesg. Not sure if it is actually
> disabled, but the serial works:
> <http://old.nabble.com/Overo-Air-bluetooth-and-wifi-power-td28775963.html#a28907238>
>
> It would be great to have these exact steps in the wiki or official
> gumstix docs. Wanting a 2nd serial port is not uncommon at all and it
> took some effort to get it going. It absolutely should have been
> clearly documented by gumstix.
>
> Let me know if it works or not...
> J
>
>
> > Has anyone been able to use devmem2 at runtime to re-mux Overo UART2
> > Tx/Rx to the GPIO146_PWM11/GPIO147_PWM8 signals on the 40-pin TOBI
> > header? I have successfully re-muxed these signals using a modified
> > u-boot, but I'm wondering whether the same thing can be done in a
> > shell script using devmem2 after the kernel has booted.
> >
>
>
> ------------------------------------------------------------------------------
> The demand for IT networking professionals continues to grow, and the
> demand for specialized networking skills is growing even more rapidly.
> Take a complimentary Learning@Cisco Self-Assessment and learn
> about Cisco certifications, training, and career opportunities.
> http://p.sf.net/sfu/cisco-dev2dev
> _______________________________________________
> gumstix-users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/gumstix-users

------------------------------------------------------------------------------
The demand for IT networking professionals continues to grow, and the
demand for specialized networking skills is growing even more rapidly.
Take a complimentary Learning@Cisco Self-Assessment and learn
about Cisco certifications, training, and career opportunities.
http://p.sf.net/sfu/cisco-dev2dev
_______________________________________________
gumstix-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gumstix-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Re-muxing Overo UART2 at runtime

dave.billin
I was unfortunately tied up with other tasks for the last couple of weeks, but wanted to follow up on my earlier post regarding the re-mapping of UART2 at runtime.
The commands suggested by Jesse do work using kernel version 2.6.39.

Best Regards,

Dave Billin

Graduate Research Assistant --MS Computer Engineering
University of Idaho
Moscow, Idaho 83844

e-mail: [hidden email]




From: [hidden email]
To: [hidden email]
Date: Thu, 27 Oct 2011 19:33:20 -0700
Subject: Re: [Gumstix-users] Re-muxing Overo UART2 at runtime

Jesse,

Thanks for the reply.  I'll try this out first thing tomorrow.  Can you confirm that you are using the latest kernel version (2.6.39)?
I completely agree that this info should be included in the Wiki.  Perhaps I'll write something up when I've finished.

Best Regards,

Dave Billin

Graduate Research Assistant --MS Computer Engineering
University of Idaho
Moscow, Idaho 83844

e-mail: [hidden email]



> Date: Thu, 27 Oct 2011 16:01:44 -0700

> From: [hidden email]
> To: [hidden email]
> Subject: Re: [Gumstix-users] Re-muxing Overo UART2 at runtime
>
> Hello! Wow, a question a newbie like me can actually answer! :) Nice
> to be able to 'give back' to the list.
>
> I have done this exact thing, with a Tobi board, and here's the shell
> script.
>
> echo "UART2 (/dev/ttyS1) config register1: 0x48002170, set to GPIO input
> w/pullup"
> devmem2 0x48002170 w 0x011C011C
> echo
> echo "UART2 (/dev/ttyS1) config register2: 0x48002178, set to UART RX
> and TX"
> devmem2 0x48002178 w 0x01180000
> echo
>
> I disabled bluetooth by renaming /etc/init.d/bluetooth file, but I still
> get lots of bluetooth messages in dmesg. Not sure if it is actually
> disabled, but the serial works:
> <http://old.nabble.com/Overo-Air-bluetooth-and-wifi-power-td28775963.html#a28907238>
>
> It would be great to have these exact steps in the wiki or official
> gumstix docs. Wanting a 2nd serial port is not uncommon at all and it
> took some effort to get it going. It absolutely should have been
> clearly documented by gumstix.
>
> Let me know if it works or not...
> J
>
>
> > Has anyone been able to use devmem2 at runtime to re-mux Overo UART2
> > Tx/Rx to the GPIO146_PWM11/GPIO147_PWM8 signals on the 40-pin TOBI
> > header? I have successfully re-muxed these signals using a modified
> > u-boot, but I'm wondering whether the same thing can be done in a
> > shell script using devmem2 after the kernel has booted.
> >
>
>
> ------------------------------------------------------------------------------
> The demand for IT networking professionals continues to grow, and the
> demand for specialized networking skills is growing even more rapidly.
> Take a complimentary Learning@Cisco Self-Assessment and learn
> about Cisco certifications, training, and career opportunities.
> http://p.sf.net/sfu/cisco-dev2dev
> _______________________________________________
> gumstix-users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/gumstix-users

------------------------------------------------------------------------------ The demand for IT networking professionals continues to grow, and the demand for specialized networking skills is growing even more rapidly. Take a complimentary Learning@Cisco Self-Assessment and learn about Cisco certifications, training, and career opportunities. http://p.sf.net/sfu/cisco-dev2dev
_______________________________________________ gumstix-users mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/gumstix-users

------------------------------------------------------------------------------
RSA(R) Conference 2012
Save $700 by Nov 18
Register now
http://p.sf.net/sfu/rsa-sfdev2dev1
_______________________________________________
gumstix-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gumstix-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Re-muxing Overo UART2 at runtime

cPhillips
In reply to this post by Jesse Lackey-2
Hey Jesse, your fix mostly worked for me as well so I thank you for that. However, the hardware setup I have requires the TX and RX pins to be flipped which should be easier (if possible) to do in software rather than hardware since I have a daughter board already built that converts to RS-232. Would you know how to do this as I'm a total Linux noob and can't figure it out on my own?
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Re-muxing Overo UART2 at runtime

cPhillips
I just wanted to follow up and say that I went ahead and cut the traces on my daughter board and soldered some wires in to switch UART2 RX and TX lines. For anyone that is interested, this fix Jesse posted works perfectly on the Overo-FE 2.6.39.

cPhillips wrote
Hey Jesse, your fix mostly worked for me as well so I thank you for that. However, the hardware setup I have requires the TX and RX pins to be flipped which should be easier (if possible) to do in software rather than hardware since I have a daughter board already built that converts to RS-232. Would you know how to do this as I'm a total Linux noob and can't figure it out on my own?
Loading...