Problem doing loopback serial test on BeagleBone

Hi All,

I am trying to run a TTL level loopback test on /dev/ttyO1. I have a
jumper between pins 22 and 24 on P9 and then ran picocom on the port
and typed characters expecting to see them echoed.

I then did a bit more reading around and found this
article:http://www.gigamegablog.com/2012/01/22/beaglebone-coding-101-using-the-serial-and-analog-pins/

My Debian image did not have the /sys/kernel/debug/omap_mux directory
however, so I rebooted into the original Angstrom image, which does
have the directory.
I echoed the port values as described on the web page, but am still
not getting echoed characters in my minicom test.

So three questions:
- Any ideas as to why my loopback doesn't appear to work?
- /sys/kernel/debug/omap_mux is not present on my Debian image, what
is dependent on these files?
- What is the correct place to initialize lines to function as serial
ports? Should it be done in U-boot or using the
/sys/kernel/debug/omap_mux directory as described in the web document?

TY,
Fred

Hi All,

I am trying to run a TTL level loopback test on /dev/ttyO1. I have a
jumper between pins 22 and 24 on P9 and then ran picocom on the port
and typed characters expecting to see them echoed.

I then did a bit more reading around and found this
article:http://www.gigamegablog.com/2012/01/22/beaglebone-coding-101-using-the-serial-and-analog-pins/

My Debian image did not have the /sys/kernel/debug/omap_mux directory
however, so I rebooted into the original Angstrom image, which does
have the directory.
I echoed the port values as described on the web page, but am still
not getting echoed characters in my minicom test.

So three questions:
- Any ideas as to why my loopback doesn't appear to work?
- /sys/kernel/debug/omap_mux is not present on my Debian image, what
is dependent on these files?

sudo mount -t debugfs none /sys/kernel/debug

- What is the correct place to initialize lines to function as serial
ports? Should it be done in U-boot or using the
/sys/kernel/debug/omap_mux directory as described in the web document?

Regards,

I am trying to run a TTL level loopback test on /dev/ttyO1. I have a
jumper between pins 22 and 24 on P9 and then ran picocom on the port
and typed characters expecting to see them echoed.

I then did a bit more reading around and found this
article:http://www.gigamegablog.com/2012/01/22/beaglebone-coding-101-using-the-serial-and-analog-pins/

My Debian image did not have the /sys/kernel/debug/omap_mux directory
however, so I rebooted into the original Angstrom image, which does
have the directory.
I echoed the port values as described on the web page, but am still
not getting echoed characters in my minicom test.

So three questions:
- Any ideas as to why my loopback doesn't appear to work?

Pastebin of commands and diagnostics?

What settings do you have the TX and RX pins at within sysfs's
omap_mux? (cat them and include in your Pastebin)

- /sys/kernel/debug/omap_mux is not present on my Debian image, what
is dependent on these files?

Kernel or you just not mounting it, like Robert said. No dependency
upon the distribution (Debian vs Angstrom).

- What is the correct place to initialize lines to function as serial
ports? Should it be done in U-boot or using the
/sys/kernel/debug/omap_mux directory as described in the web document?

Either the board-file in the kernel sources, u-boot (if you're sure the
board-file won't override them), or via sysfs. Any should work.

If you want u-boot to do it and you want your boot info to come out on
UART1, 'make am335x_evm_uart1_config' is worth using in anything past
2013.01-rc1.

-Andrew

Fred,

Please use the reply-all feature to ensure mails go to both the sender
you are replying to and to the beagle list.

Fred,

Please use the reply-all feature to ensure mails go to both the sender
you are replying to and to the beagle list.

> Thanks for the detailed feedback, a pastebin of the steps I took are
> at:
>
> http://pastebin.com/sDNdLXtk
>
> I expected to see echoed characters in the terminal program but
> didn't see anything. I have a hardware jumper on my BeagleBone
> between pins 22 and 24 of P9.

Mine are like this and it works for me:

root@localhost:/sys/kernel/debug/omap_mux# cat uart1_txd
name: uart1_txd.uart1_txd (0x44e10984/0x984 = 0x0058), b NA, t NA
mode: OMAP_MUX_MODE0 | AM33XX_SLEWCTRL_SLOW
signals: uart1_txd | mmc2_sdwp | NA | i2c1_scl | NA |
pr1_uart0_txd_mux1 | NA | gpio0_15

root@localhost:/sys/kernel/debug/omap_mux# cat uart1_rxd
name: uart1_rxd.uart1_rxd (0x44e10980/0x980 = 0x0070), b NA, t NA
mode: OMAP_MUX_MODE0 | AM33XX_PIN_INPUT_PULLUP | AM33XX_SLEWCTRL_SLOW
signals: uart1_rxd | mmc1_sdwp | NA | i2c1_sda | NA |
pr1_uart0_rxd_mux1 | NA | gpio0_14

Try those settings.

Thank you, got it working now :slight_smile:
Three more follow up questions:

- why does only uart 0 and 1 appear under the omap_mux directory? I
need to get all 6 serial ports working
- where is the board-file located you mentioned earlier?
- how does the pinmux tool interact with all this configuration?

>
>>
>> > Thanks for the detailed feedback, a pastebin of the steps I took
>> > are at:
>> >
>> > http://pastebin.com/sDNdLXtk
>> >
>> > I expected to see echoed characters in the terminal program but
>> > didn't see anything. I have a hardware jumper on my BeagleBone
>> > between pins 22 and 24 of P9.
>
> Mine are like this and it works for me:
>
> root@localhost:/sys/kernel/debug/omap_mux# cat uart1_txd
> name: uart1_txd.uart1_txd (0x44e10984/0x984 = 0x0058), b NA, t NA
> mode: OMAP_MUX_MODE0 | AM33XX_SLEWCTRL_SLOW
> signals: uart1_txd | mmc2_sdwp | NA | i2c1_scl | NA |
> pr1_uart0_txd_mux1 | NA | gpio0_15
>
> root@localhost:/sys/kernel/debug/omap_mux# cat uart1_rxd
> name: uart1_rxd.uart1_rxd (0x44e10980/0x980 = 0x0070), b NA, t NA
> mode: OMAP_MUX_MODE0 | AM33XX_PIN_INPUT_PULLUP |
> AM33XX_SLEWCTRL_SLOW signals: uart1_rxd | mmc1_sdwp | NA | i2c1_sda
> > NA | pr1_uart0_rxd_mux1 | NA | gpio0_14
>
> Try those settings.
>
Thank you, got it working now :slight_smile:
Three more follow up questions:

- why does only uart 0 and 1 appear under the omap_mux directory? I
need to get all 6 serial ports working

The names in that directory should coorespond with the MODE0 names in
the am335x data sheet. Thus the 2 part naming, for example
uart1_rxd.uart1_rxd (first part is mode 0 name, second part is current
mode name).

- where is the board-file located you mentioned earlier?

Kernel sources arch/arm/mach-omap2/board-am335xevm.c

- how does the pinmux tool interact with all this configuration?

Pinmux tool? Which one? The horrible TI Windows tool?
Maybe you'll find [1] more useful?

[1]:https://github.com/bradfa/beaglebone_pinmux_tables

-Andrew

>
>>
>> > Thanks for the detailed feedback, a pastebin of the steps I took
>> > are at:
>> >
>> > http://pastebin.com/sDNdLXtk
>> >
>> > I expected to see echoed characters in the terminal program but
>> > didn't see anything. I have a hardware jumper on my BeagleBone
>> > between pins 22 and 24 of P9.
>
> Mine are like this and it works for me:
>
> root@localhost:/sys/kernel/debug/omap_mux# cat uart1_txd
> name: uart1_txd.uart1_txd (0x44e10984/0x984 = 0x0058), b NA, t NA
> mode: OMAP_MUX_MODE0 | AM33XX_SLEWCTRL_SLOW
> signals: uart1_txd | mmc2_sdwp | NA | i2c1_scl | NA |
> pr1_uart0_txd_mux1 | NA | gpio0_15
>
> root@localhost:/sys/kernel/debug/omap_mux# cat uart1_rxd
> name: uart1_rxd.uart1_rxd (0x44e10980/0x980 = 0x0070), b NA, t NA
> mode: OMAP_MUX_MODE0 | AM33XX_PIN_INPUT_PULLUP |
> AM33XX_SLEWCTRL_SLOW signals: uart1_rxd | mmc1_sdwp | NA | i2c1_sda
> > NA | pr1_uart0_rxd_mux1 | NA | gpio0_14
>
> Try those settings.
>
Thank you, got it working now :slight_smile:
Three more follow up questions:

- why does only uart 0 and 1 appear under the omap_mux directory? I
need to get all 6 serial ports working

The names in that directory should coorespond with the MODE0 names in
the am335x data sheet. Thus the 2 part naming, for example
uart1_rxd.uart1_rxd (first part is mode 0 name, second part is current
mode name).

- where is the board-file located you mentioned earlier?

Kernel sources arch/arm/mach-omap2/board-am335xevm.c

So if I add entries to that .c file for the remaining UARTs then they
are populated in /sys/kernel/debug/omap_mux.
Can the config. for the pins be done in either board-am335xevm.c or by
writing to the files in /sys/kernel/debug/omap_mux?

- how does the pinmux tool interact with all this configuration?

Pinmux tool? Which one? The horrible TI Windows tool?
Maybe you'll find [1] more useful?

Yes was talking about the Windows tool. Thanks for the link. I think
the tool can auto generate code, does that code get pasted into the
board-am335xevm.c file?

[1]:https://github.com/bradfa/beaglebone_pinmux_tables

-Andrew

Thank you, very useful.

>
>> >
>> >>
>> >> > Thanks for the detailed feedback, a pastebin of the steps I
>> >> > took are at:
>> >> >
>> >> > http://pastebin.com/sDNdLXtk
>> >> >
>> >> > I expected to see echoed characters in the terminal program
>> >> > but didn't see anything. I have a hardware jumper on my
>> >> > BeagleBone between pins 22 and 24 of P9.
>> >
>> > Mine are like this and it works for me:
>> >
>> > root@localhost:/sys/kernel/debug/omap_mux# cat uart1_txd
>> > name: uart1_txd.uart1_txd (0x44e10984/0x984 = 0x0058), b NA, t NA
>> > mode: OMAP_MUX_MODE0 | AM33XX_SLEWCTRL_SLOW
>> > signals: uart1_txd | mmc2_sdwp | NA | i2c1_scl | NA |
>> > pr1_uart0_txd_mux1 | NA | gpio0_15
>> >
>> > root@localhost:/sys/kernel/debug/omap_mux# cat uart1_rxd
>> > name: uart1_rxd.uart1_rxd (0x44e10980/0x980 = 0x0070), b NA, t NA
>> > mode: OMAP_MUX_MODE0 | AM33XX_PIN_INPUT_PULLUP |
>> > AM33XX_SLEWCTRL_SLOW signals: uart1_rxd | mmc1_sdwp | NA |
>> > i2c1_sda | NA | pr1_uart0_rxd_mux1 | NA | gpio0_14
>> >
>> > Try those settings.
>> >
>> Thank you, got it working now :slight_smile:
>> Three more follow up questions:
>>
>> - why does only uart 0 and 1 appear under the omap_mux directory?
>> I need to get all 6 serial ports working
>
> The names in that directory should coorespond with the MODE0 names
> in the am335x data sheet. Thus the 2 part naming, for example
> uart1_rxd.uart1_rxd (first part is mode 0 name, second part is
> current mode name).
>
>> - where is the board-file located you mentioned earlier?
>
> Kernel sources arch/arm/mach-omap2/board-am335xevm.c
>
So if I add entries to that .c file for the remaining UARTs then they
are populated in /sys/kernel/debug/omap_mux.
Can the config. for the pins be done in either board-am335xevm.c or by
writing to the files in /sys/kernel/debug/omap_mux?

Look how UART3 is setup (in the psp release kernel) for the am335x evm
board. Do something like that to enable UART1 then make sure your pin
mux setup function gets called when running on a bone.

The "files" in sysfs for omap_mux are always all there. The names
don't change depending on what you configure in the board-file. Just
what each one is configured to do changes (which you see if you 'cat'
it). The names of the files are always the MODE0 name.

>> - how does the pinmux tool interact with all this configuration?
>
> Pinmux tool? Which one? The horrible TI Windows tool?
> Maybe you'll find [1] more useful?
>
Yes was talking about the Windows tool. Thanks for the link. I think
the tool can auto generate code, does that code get pasted into the
board-am335xevm.c file?

I have no idea how to use the Windows tool other than it makes pretty
colors. Sorry. Ask your local TI rep.

-Andrew