This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Linux/AM3354: UART3 issue on Variscite board

Part Number: AM3354


Tool/software: Linux

FYI I have formatted my post in markdown and it looks best in a mono-spaced font.


I have a - Variscite VAR-SOM-AM33 SoM and dev board (VAR-AM33CustomBoard) and I'm trying to get UART3 to work with a - Sparkfun FTDI Basic Breakout - 3.3V TTL UART to USB adapter (http://sfe.io/p9873) **Summary of the puzzling part:** I am also working on a custom SoM carrier board based on this Variscite dev board and I know that UART0 works perfectly when I cut the traces and hook up my Sparkfun UART/USB. So there is clearly a difference in how UART0 is configured verses UART3. Software ======== I have used this exact FTDI USB adapter on many projects and it always works great. Here's what I've tried to enable UART3 on the dev board: TI Web-Based PinMux Configuration for AM335x (http://dev.ti.com/pinmux) -------------------------------------------- - UART3 with RXD and TXD only - UART pins - C15 is RXD, No Pull (unlike UART0 by the way) - C18 is TXD, Pull Down (just like UART0 by the way) Yocto Kernel Serial Driver Selection -------------------------------------- After wandering around the enormity of the default kernel serial 8250 stack, I eventually stumbled upon the `omap-serial.c` driver. I wanted to see if it would magically fix my problem or in the least, be less code to sift thru (being a single .c file). So I configured the kernel (make menuconfig) to disable 8250 and enable CONFIG_SERIAL_OMAP found in Device Drivers->Char Drivers->Serial Drivers. Yocto Kernel Device Tree Configuration -------------------------------------- The TI Pinmux generates this code which I add to my Yocto environment's kernel device tree: myuart3_pins_default: myuart3_pins_default { pinctrl-single,pins = < 0x160 ( PIN_INPUT | MUX_MODE1 ) /* (C15) spi0_cs1.uart3_rxd */ 0x164 ( PIN_OUTPUT_PULLDOWN | MUX_MODE1 ) /* (C18) eCAP0_in_PWM0_out.uart3_txd */ >; }; **I notice** that when editing `kernel-source/arch/arm/boot/dts/var-som-am33.dts` there is a SPI device called `spi1_pins_default` which uses the `0x164` pin, so I remove its entry too (not shown in the git diff). SPI1 isn't used by default anyway, but I was just being paranoid. Here is a `git diff` of my device tree source: diff --git a/arch/arm/boot/dts/var-som-am33.dts b/arch/arm/boot/dts/var-som-am33.dts index 0fdb4e3..05fbd0a 100644 --- a/arch/arm/boot/dts/var-som-am33.dts +++ b/arch/arm/boot/dts/var-som-am33.dts @@ -263,6 +263,13 @@ >; }; + myuart3_pins_default: myuart3_pins_default { + pinctrl-single,pins = < + 0x160 ( PIN_INPUT | MUX_MODE1 ) /* (C15) spi0_cs1.uart3_rxd */ + 0x164 ( PIN_OUTPUT_PULLDOWN | MUX_MODE1 ) /* (C18) eCAP0_in_PWM0_out.uart3_txd */ + >; + }; + @@ -533,11 +522,8 @@ }; &uart3 { - /* - pinctrl-names = "default", "sleep"; - pinctrl-0 = <&uart3_pins_default>; - pinctrl-1 = <&uart3_pins_sleep>; - */ + pinctrl-names = "default"; + pinctrl-0 = <&myuart3_pins_default>; status = "okay"; }; Finally rebuild the kernel/device tree with bitbake: yocto_varsomam33/tisdk/build $ MACHINE=varsomam33 bitbake -C compile linux-ti-variscite Verify Device Tree Settings --------------------------- Once the kernel and device tree have been built, boot them (in my case over TFTP/nfs-kernel-server) and check that our device tree settings are what we expect: root@varsomam33:~# find /sys/firmware/devicetree/ -name "*myuart*" /sys/firmware/devicetree/base/ocp/l4_wkup@44c00000/scm@210000/pinmux@800/myuart3_pins_default root@varsomam33:~# od -x /sys/firmware/devicetree/base/ocp/l4_wkup@44c00000/scm@210000/pinmux@800/myuart3_pins_default/pinctrl-single,pins 0000000 0000 6001 0000 2900 0000 6401 0000 0100 0000020 If we endian-fix the output values (my busybox od tool doesn't support "od -t x1"), we see this: PIN | VALUE --------|------- 0x0160 | 0x0029 0x0164 | 0x0001 Which verifies precisely with the defines in `include/dt-bindings/pinctrl/am33xx.h` #define PULL_DISABLE (1 << 3) #define INPUT_EN (1 << 5) #define PIN_OUTPUT_PULLDOWN 0 #define MUX_MODE1 1 Hardware ======== Connections: Carrier board | Sparkfun USB ------------------------|------------- J18 pin 9 (UART3_RXD) | TXO J18 pin 10 (UART3_TXD) | RXI J15 pin 4 (Ground) | GND Testing ======= I use a very simple 198-line serial terminal program written in C found here (github.com/.../miniterm) I have used it for years on various embedded linux and desktop linux devices. It does not use flow control as seen on line 123: newsertio.c_cflag = cooked_baud | CS8 | CLOCAL | CREAD; Next I'll open serial terminals on both my desktop linux machine with the Sparkfun device (/dev/ttyUSB1 in this case) and on the embedded side (/dev/ttyO3). I type characters into each terminal session. Notice the 'a' characters are received on the desktop when typed from the embedded session, but no characters are received on the embedded side when typed from the desktop session. Embedded Serial Terminal ------------------------ - I type three 'a' characters on the embedded terminal. - I do not receive any characters typed from the desktop terminal Output: root@varsomam33:~# ./miniterm -d/dev/ttyO3 ************ REMOTE CONSOLE: CTRL-] TO QUIT ******** Desktop Serial Terminal ----------------------- - Notice I recieve the three 'a' characters on the desktop. - I type 't' in this terminal but it does not show up on the embedded terminal. Output: # ./miniterm -d/dev/ttyUSB1 ************ REMOTE CONSOLE: CTRL-] TO QUIT ******** aaa Check UART Status ----------------- **Notice we have transmitted some characters on UART3 but have not received any** root@varsomam33:~# cat /proc/tty/driver/OMAP-SERIAL serinfo:1.0 driver revision: 0: uart:OMAP UART0 mmio:0x44E09000 irq:155 tx:3080 rx:8 RTS|CTS|DTR|DSR 1: uart:OMAP UART1 mmio:0x48022000 irq:156 tx:0 rx:0 DSR|CD|RI 2: uart:OMAP UART2 mmio:0x48024000 irq:157 tx:0 rx:0 CTS|DSR 3: uart:OMAP UART3 mmio:0x481A6000 irq:158 tx:3 rx:0 CTS|DSR 4: uart:OMAP UART4 mmio:0x481A8000 irq:159 tx:0 rx:0 CTS|DSR 5: uart:OMAP UART5 mmio:0x481AA000 irq:160 tx:0 rx:0 CTS|DSR Saleae Logic Analyzer Screenshots ================================= UART3 TX looks good between 0 and 3.3V -------------------------------------- UART3 RX only drops to 2.5V from 3.3V ------------------------------------- Concluding remarks: Truth table from my testing so far. Note that when I say it doesn't work, it exhibits the problem described above (2.5V to 3.3V swing). Board | UART | Configuration | Result ------------------------------------------------ Variscite | UART0 | RS232 DCE | WORKS Variscite | UART1 | RS232 DTE | WORKS Variscite | UART3 | TTL/UART | NO WORK (this is described in this post) Custom | UART0 | TTL/UART | WORKS Custom | UART1 | RS232 DTE | WORKS Custom | UART1 | TTL/UART | NO WORK (used same procedure described in this post) I feel like this has something to do with modem control lines (flow control) and that my configuration settings aren't being taken (as per `/proc/tty/driver/OMAP-SERIAL`) Any help is appreciated, thanks!
  • Hi,

    We cannot help on the Variscite SOM. We don't have documentation for this board. This is a third-party product and you should contact the board manufacturer for support.
  • Just so I'm understanding correctly, there should be no discussion of any TI products that aren't on official TI evaluation boards?  So for example, no discussion of BeagleBone or LeopardBoard?


    Even if the vendor is a TI partner advertised on the TI site:

    (ti.com/devnet/docs/catalog/companyfolder.tsp?actionPerformed=companyFolder&companyId=5778)

    And all their schematics and documentation are freely available on the site:

    (variscite.com/products/system-on-module-som/cortex-a8/var-som-am33-cpu-ti-am335x-am3354-am3352)

    I understand not being able to speak for Variscite themselves, but what kind of community is TI trying to support if people aren't discussion popular TI platforms?  What does this say to engineers like myself who are developing custom hardware for the TI chips?

    For what its worth, I'm posting on the TI forums because I've been trying for over a week to get into the Variscite forums to no avail.  This is making the alternatives like Freescale and Qualcomm look very appealing!


    Also for what its worth, the specific reason why UART3 is being held high is found in the dev board schematics, again freely available on the Variscite site, where UART3 is also connected to a RS-485 chip's (LTC2852) pin 1.  Luckily the board designers knew what they were doing and attached a 0 Ohm resistor (R83) on that line, so removing it frees up UART3's RX line.

    Although this should be helpful for other Variscite customers out there wanting to use UART3, this doesn't answer my real problem of why UART1 isn't working on our custom hardware, but that may possibly be a linux configuration question for another forum.

  • For the sake of completeness, I forgot on my original post to attach the screenshots of the Saleae logic analyzer.


    Here they are:

    UART3 TX looks good between 0 and 3.3V
    --------------------------------------


    UART3 RX only drops to 2.5V from 3.3V
    -------------------------------------

  • Brad,
    Yes, you are correct. We list the products that our partners have, and here is the disclaimer from TI Design Network page:

    Disclaimer:

    The information contained herein has been provided by a member of TI's Design Network. This information is provided on the TI website only as a convenience and TI is not responsible for the contents of this page or any changes or updates to the information posted on this page. Certain links provided herein permit you to leave this site and enter non-TI sites. These linked sites are not under TI's control. TI is not responsible for the contents of any linked site or any changes or updates to such sites. TI is providing these links to you only as a convenience. The inclusion of any link does not imply endorsement by TI of any linked site.

    TI's Publication of information regarding third-party products or services does not constitute an endorsement regarding the suitability of such products or services or a warranty, representation or endorsement of such products or services, either alone or in combination with any TI product or service.
  • hey Brad,
    One more detail...a friend brought this to my attention that I should have specified TI doesn’t support the board by contributing to the discussion, but the community may read the post and reply....including the Supplier. :) I hope this helps.