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.

How to use uart5 for debug message in uboot on AM3359 platform

Other Parts Discussed in Thread: AM3359

Hi Sir :

I works on AM3359 EVM platform and use SDK 6.00.00.00.

I want to change debug messages from uart0 to uart5.

So, I modify boards.cfg and hardware.h to change uart0 to uart5.

At the beginning, I can see debug message output from uart5.

But after few times power on and off, I see the message below.

-n�t SH�r` ����҂�Jj   

Could you help me if there is other file I need to modify?

Or, could you give me some suggestion?

Best regard,

Marcus

  • Hi Markus,

    Is this the AM335X GP EVM or a custom board?

  • Hi Sir:

    Thanks for your reply!

    I use AM335x GP EVM and profile 6 to use uart5 as debug message output.

    I have configured uart5 pin mux and change uart default base address to uart5.

    And I also modify am335x_evm.h to change ttyo0 to ttyo5 for command line.

    I enable uart5 pin mux before omap_serial_init() in board-am335xevm.c.

    Now, I can see debug messages output from uart5.

    However, when load kernel, the booting speed gets slower and slower and hang up eventually.

    And there are some wrong characters show on the screen.

    Could you give me some suggestions about how to use uart5 as debug messages output?

    Best regards,

    Marcus

  • How is your pinmux for UART5 configured?

  • Hi Sir:

    I refer the link below:

    http://e2e.ti.com/support/arm/sitara_arm/f/791/t/262312.aspx

    /* Module pin mux for uart5 */
    static struct pinmux_config uart5_pin_mux[] = {
            {"lcd_data9.uart5_rxd", OMAP_MUX_MODE4 | AM33XX_SLEWCTRL_SLOW |
                                                    AM33XX_PIN_INPUT_PULLUP},
            {"lcd_data8.uart5_txd", OMAP_MUX_MODE4 | AM33XX_PULL_UP |
                                                    AM33XX_PULL_DISA |
                                                    AM33XX_SLEWCTRL_SLOW},
            {NULL, 0},
    };

    Best regards,

    Marcus

  • Hi Marcus,

    Did you know that there are U-Boot build options to select different UART ports for serial debug messages?

    These are the build options taken from <u-boot_dir>/boards.cfg file:

    am335x_evm                   arm         armv7       am335x              ti             am33xx      am335x_evm:SERIAL1,CONS_INDEX=1
    am335x_evm_uart1             arm         armv7       am335x              ti             am33xx      am335x_evm:SERIAL2,CONS_INDEX=2
    am335x_evm_uart2             arm         armv7       am335x              ti             am33xx      am335x_evm:SERIAL3,CONS_INDEX=3
    am335x_evm_uart3             arm         armv7       am335x              ti             am33xx      am335x_evm:SERIAL4,CONS_INDEX=4
    am335x_evm_uart4             arm         armv7       am335x              ti             am33xx      am335x_evm:SERIAL5,CONS_INDEX=5
    am335x_evm_uart5             arm         armv7       am335x              ti             am33xx      am335x_evm:SERIAL6,CONS_INDEX=6

    Can you try building your U-Boot using the am335x_evm_uart5 option instead of modifying the U-Boot:

    make am335x_evm_uart5

    Best regards,
    Miroslav

  • Hi Miroslav :

    I have modified this file.

    But I changes as below:

    am335x_evm:SERIAL6,CONS_INDEX=6

    And I modify hardware.h to change DEFAULT_UART_BASE to uart5.

    Then I can see debug messages output from uart5.

    But the debug messages are something wrong when loading kernel image.

     

    Best regards,

    Marcus 

  • Hi Sir :

    Is there anyone can help me or give me any suggestion about debug message outputted from uart5?

    Best regards,

    Marcus

  • As said earlier, you do not need to modify any u-boot files for uart5. Build u-boot with the command

    make am335x_evm_uart5.

    For the kernel, you have to add some code. First the pin-mux structure

    /* Module pin mux for uart5 */
    static struct pinmux_config uart5_pin_mux[] = {
    {"lcd_data9.uart5_rxd", OMAP_MUX_MODE4 | AM33XX_PIN_INPUT_PULLUP},
    {"lcd_data8.uart5_txd", OMAP_MUX_MODE4 |AM33XX_PULL_ENBL},
    {"mii1_crs.uart5_ctsn", OMAP_MUX_MODE5 | AM33XX_PIN_OUTPUT},
    {"mii1_rxerr.uart5_rtsn", OMAP_MUX_MODE5 | AM33XX_PIN_INPUT},
    {NULL, 0},
    };

    Then a function to set up the muxing

    /* setup uart5 */
    static void uart5_init(int evm_id, int profile)
    {
    setup_pin_mux(uart5_pin_mux);
    }

    Then add the setup function to your board configuration. For me, I was using a Beaglebone black so I added the entry there

    {i2c2_init, DEV_ON_BASEBOARD, PROFILE_NONE},
    {sgx_init, DEV_ON_BASEBOARD, PROFILE_NONE},
    {uart5_init, DEV_ON_BASEBOARD, PROFILE_NONE},

    There is one more small change in a driver so that uart5 can be used for a console. In drivers/tty/serial/omap-serial.c change a line of code to look like this

    static struct uart_omap_port *serial_omap_console_ports[OMAP_MAX_HSUART_PORTS];

    Back to u-boot, you might want to change the ttyO0 to ttyO5 in include/configs/am335x_evm.h

    "fdtfile=\0" \
    "console=ttyO5,115200n8\0" \
    "optargs=\0" \

    Steve K.

  • Hi Steve :

    I appreciate your reply!

    I did every step as you mentioned above, however the result is the same.

    Below are debug messages that output from uart5.

    U-Boot SPL 2013.01.01 (Apr 07 2014 - 10:59:32)
    musb-hdrc: ConfigData=0xde (UTMI-8, dyn FIFOs, bulk combine, bulk split, HB-ISO Rx, HB-ISO Tx, SoftConn)
    musb-hdrc: MHDRC RTL version 2.0
    musb-hdrc: setup fifo_mode 4
    musb-hdrc: 28/31 max ep, 16384/16384 memory
    USB Peripheral mode controller at 47401000 using PIO, IRQ 0
    musb-hdrc: ConfigData=0xde (UTMI-8, dyn FIFOs, bulk combine, bulk split, HB-ISO Rx, HB-ISO Tx, SoftConn)
    musb-hdrc: MHDRC RTL version 2.0
    musb-hdrc: setup fifo_mode 4
    musb-hdrc: 28/31 max ep, 16384/16384 memory
    USB Host mode controller at 47401800 using PIO, IRQ 0
    OMAP SD/MMC: 0
    reading u-boot.img
    reading u-boot.img


    U-Boot 2013.01.01 (Apr 07 2014 - 10:59:32)

    I2C:   ready
    DRAM:  512 MiB
    WARNING: Caches not enabled
    NAND:  No NAND device found!!!
    0 MiB
    MMC:   OMAP SD/MMC: 0, OMAP SD/MMC: 1
    *** Warning - readenv() failed, using default environment

    musb-hdrc: ConfigData=0xde (UTMI-8, dyn FIFOs, bulk combine, bulk split, HB-ISO Rx, HB-ISO Tx, SoftConn)




    t


    rpmqpzppu7`�tgx�pi[    1.656402] Waiting for root device /dev/mmcblk0p2...
    [    1.676788] mmc0: new SDHC card at address e624
    [    1.682189] mmcblk0: mmc0:e624 SD08G 7.40 GiB
    [    1.691864]  mmcblk0: p1 p2

    [    1.777008] EXT3-fs (mmcblk0p2): recovery required on readonly filesystem
    [    1.784118] EXT3-fs (mmcblk0p2): write access will be enabled during recovery
    [    2.228576] kjournald starting.  Commit interval 5 seconds
    [    2.234405] EXT3-fs (mmcblk0p2): recovery complete
    [    2.244903] EXT3-fs (mmcblk0p2): mounted filesystem with ordered data mode
    [    2.252166] VFS: Mounted root (ext3 filesystem) readonly on device 179:2.
    [    2.259643] Freeing init memory: 236K
    [    6.150451] EXT3-fs (mmcblk0p2): using internal journal
    [    7.284851] Disabling lock debugging due to kernel taint
    [    8.163330]  gadget: Mass Storage Function, version: 2009/09/11
    [    8.169525]  gadget: Number of LUNs=1
    [    8.173400]  lun0: LUN: removable file: /dev/mmcblk0p1
    [    8.178802]  gadget: Mass Storage Gadget, version: 2009/09/11
    [    8.184814]  gadget: userspace failed to provide iSerialNumber
    [    8.190917]  gadget: g_mass_storage ready
    [    8.195098] musb-hdrc musb-hdrc.0: MUSB HDRC host driver
    [    8.200714] musb-hdrc musb-hdrc.0: new USB bus registered, assigned bus number 2
    [    8.208557] usb usb2: New USB device found, idVendor=1d6b, idProduct=0002
    [    8.215667] usb usb2: New USB device strings: Mfr=3, Product=2, SerialNumber=1
    [    8.223205] usb usb2: Product: MUSB HDRC host driver
    [    8.228393] usb usb2: Manufacturer: Linux 3.2.0 musb-hcd
    [    8.233947] usb usb2: SerialNumber: musb-hdrc.0
    [    8.239196] hub 2-0:1.0: USB hub found
    [    8.243133] hub 2-0:1.0: 1 port detected

    You can see the wrong characters that are in red color.

    Since I use am335x evm, so I use profile 6 to get debug messages from uart5.

    I also check pin mux function about mii1_crs.uart5_ctsn and mii1_rxerr.uart5_rtsn, these two pins are not used when profile is 6, I think so.

    I have no idea why the system hangs up when I enable uart 5, and I will do more tests.

    If you have any suggestion, please let me know.

    Thanks a lot!

     

    Best regards,

    Marcus

  • Marcus,

    Did you make sure you changed drivers/tty/serial/omap-serial.c

    From static struct uart_omap_port *serial_omap_console_ports[4];

    To static struct uart_omap_port *serial_omap_console_ports[OMAP_MAX_HSUART_PORTS];

    Also, in your root file system you'll probably want to modify /etc/inittab and add a getty for ttyO5, something like

    O:2345:respawn:/sbin/getty 115200 ttyO5

    Steve K.

  • Hi Steve :

    I really appreciate your help!

    Now, I can see the debug messages output from UART5 and it works fine.

    However, when I type root to log in, I will be requested to enter password.

    Could you tell me why?

    When I use ttyO0, I do not need to enter password.

    Best regards,

    Marcus

  • The login code reads a file in your root file system to determine which terminals can log in as root. In your target root file system, edit /etc/securetty and add ttyO5 to the list of TI OMAP SoCs.

    Steve K.

  • Hi Steve :

    I appreciate your help!

    Now, the issue of uart5 is solved.

    Thanks a lot !

    Best regards,

    Marcus