PinMuxing / UART2

Showing 1-7 of 7 messages
PinMuxing / UART2 jstearns74 4/13/12 4:57 PM

Hello -

I have some real basic questions that hopefully someone can help me with.  I ultimately want to be able to use my BeagleBoard-XM (Rev C) to talk to a MCU using the UART2 port on the main expansion header.  I know to do this I will need to setup the PINMUX correctly.  I think I can get away setting the Mux through u-boot.

Please bare with me...  this is what I have spent today doing.

I have gone through the exercise of building the Angstrom Distribution using the setup-scripts ( and executing:

$ MACHINE=beagleboard ./ config beagleboard
$ MACHINE=beagleboard ./ update
$ MACHINE=beagleboard ./ bitbake virtual/kernel

From what I understand (which isn't much) is that this will give me the latest kernel.  After everything ran, I ended up with a directory where I believe the image is:

There are 2 files (modules-3.0.25-r118a-beagleboard.tgz & uImage-beagleboard.bin).  I am not exactly sure what to do with these files.  I was anticipating that I would end up with a MLO file, u-boot.bin, uImage, & a tarball that I would extract on the ext3 partition of the SD card.  Maybe I am not looking in the correct directories?  I see that the ./ script uses bitbake.  Do these scripts create the u-boot.bin file?  If so, can I make my pinmux changes somewhere here?

OR -  do I need to download bitbake & the u-boot source code & modify the beagle.h file there? 

I am somewhat lost on trying to understand all of the documents/pages/group posts that I have found.  It looks like there are hard, older ways to do things, but new tools have since been created to automate some of the steps.  I'm just not sure what I need to do and what has already been done for me.



Re: [beagleboard] PinMuxing / UART2 lisarden 4/14/12 12:32 AM

bitbake u-boot

14.04.2012 3:57 пользователь "jstearns74" <> написал:
-- To join:
To unsubscribe from this group, send email to:
Frequently asked questions:
Re: [beagleboard] PinMuxing / UART2 don 4/14/12 1:42 AM
On 04/14/2012 12:32 AM, Maxim Podbereznyy wrote:
> bitbake u-boot
> 14.04.2012 3:57 О©╫О©╫О©╫О©╫О©╫О©╫О©╫О©╫О©╫О©╫О©╫О©╫ "jstearns74" <
> <>> О©╫О©╫О©╫О©╫О©╫О©╫О©╫:>     <>

>     Frequently asked questions:
> -- To join:
> To unsubscribe from this group, send email to:
> Frequently asked questions:

all you built with the command you gave was the kernel so that is why
that is all you saw. As was mention for u-boot
bitbake u-boot
For an image an example would be
bitbake xfce-nm-image
bitbake systemd-gnome-image
poky and oe both have good resources

Re: [beagleboard] PinMuxing / UART2 jstearns74 4/14/12 7:53 AM

Thank you guys for your help!  I may (will) have follow on questions later, but at least you got me pointed in the right direction.

- Jeremy
Re: [beagleboard] PinMuxing / UART2 jstearns74 4/19/12 8:51 PM
Hey again,

Since last time, I was successfully able to get all the files I needed to get my beagleboard-xm Rev C to boot using the following commands:

$ MACHINE=beagleboard ./ config beagleboard
$ MACHINE=beagleboard ./ update
$ MACHINE=beagleboard ./ bitbake virtual/kernel
 -> gave me uImage.bin
$ MACHINE=beagleboard ./ bitbake u-boot
 -> gave me u-boot.img & MLO
$ MACHINE=beagleboard ./ bitbake console-image
 -> produced the Angstrom tarball

So now I want to edit the beagle.h file to setup the pinmuxing (setup the uart2_RX line).  It looks like the UART2_TX line is already setup, as well as the CTS/RTS, though I don't plan on using flow control.  I went to edit this file:

I went on the #beagle chat and asked if all I had to do was add the following line in the
#define MUX_BEAGLE_XM macro:
MUX_VAL(CP(MCBSP3_FSX),                (IEN  | PTD | DIS | M1)) /*UART2_RX*/\

I was told that the preferred method to do pinmuxing now was actually through the kernel (modify the following file):

Is that the case or does it matter?  From what I have read on and other pages I get the impression that its actually much easier to do in u-boot.  

So If it doesn't matter, then back to my original question: do I just add the one line to the MUX_BEAGLE_XM macro?

And finally, how the heck can I prove this is working?  Based on some other uart2 questions I have read, they state that you can short pins 6 & 8 on the expansion header (uart2 TX/RX if you have them mux'd correctly) and issue the following:
$ echo a > /dev/ttyS1
then see if there are any changes in the file:
$ cat /proc/tty/driver/serial

Its easy to check the TX using a scope, but not so easy to verify the RX. 

Unfortunately I get an error in the echo command!?!  What do I need to do to ensure uart2 is setup besides the pinmuxing?


Re: [beagleboard] PinMuxing / UART2 Igor Yeremin 4/19/12 10:31 PM
RX and TX pins on the expansion header are muxed as UART2 by default
right now, you can check that in /sys/kernel/debug/omap_mux:
# cat uart2_tx mcbsp3_fsx
name: uart2_tx.uart2_tx (0x48002178/0x148 = 0x0000), b aa25, t NA
signals: uart2_tx | mcbsp3_clkx | gpt11_pwm_evt | NA | gpio_146 | NA |
NA | safe_mode
name: mcbsp3_fsx.uart2_rx (0x48002172/0x142 = 0x0101), b ae5, t NA
signals: mcbsp3_fsx | uart2_rx | NA | NA | gpio_143 | hsusb3_tll_data7
| NA | safe_mode

This comes from these lines in beagle.h in u-boot:

MUX_VAL(CP(MCBSP3_FSX),         (IEN  | PTD | DIS | M1)) /*UART2_RX*/\
MUX_VAL(CP(UART2_TX),           (IDIS | PTD | DIS | M0)) /*UART2_TX*/\
and then they are not re-muxed in kernel

The OMAP UARTs are /dev/ttyO*, not ttyS*
test using:
tail -f /dev/ttyS1 &
echo a > /dev/ttyS1

> -- To join:
> To unsubscribe from this group, send email to:
> Frequently asked questions:

Re: [beagleboard] PinMuxing / UART2 jstearns74 4/20/12 9:53 AM

Thank you Igor!  This is exactly the info I needed.  I really appreciate it.