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.

AM4377: Changing debug UART

Part Number: AM4377

Dear Sir:

          We use AM4377, and SDK is ti-processor-sdk-linux-am437x-evm-04.03.00.05-Linux-x86-Install.bin

          Our custom board use UART3 for console output.

          But reference board use UART0 by default.

           How to change Console Port from UART0 to UART3 in SDK ?

  • Hello guangzhao,

    Please, refer to this very good example, to see how to change the UART port in U-Boot.

    To change the debug port in kernel.
    First enable the UART you need in kernel's device tree as per this guide, then compile and copy the new and overwrite the old device tree blob file in your board.
    Second login to your board and enable a getty service on the serial line you want to spawn a login prompt.

    am437x-evm login: root
    root@am437x-evm:~# systemctl enable serial-getty@ttySX.service
    root@am437x-evm:~# systemctl daemon-reload

    Then reboot your board and enter in U-Boot console, change the console argument in kernel's cmd line.

    => setenv console ttyOX,115200n8
    => setenv init_console 'if test $board_name = A335_ICE; then setenv console ttyO3,115200n8;else setenv console ttyOX,115200n8;fi;'
    => saveenv

    That is all.

    Best regards,
    Kemal

  • Dear Kemal:

    We want to make it in u-boot.

    we follow the thread to modify u-boot.
    it does't work.
    and the example is for am33xx, in menconfig, you can select console index,
    but in the am437x, there is no the option to select console index.

    can you help to compile u-boot to generate a MLO and u-boot.img with UART3 as console ?
    with the MLO, i can try my board first.

    Thank you very much !
  • Here in this thread you can find the steps to UART change for exact am437x platform.

  • Dear Kemal:
    In my SDK, we can't find file arch/arm/cpu/armv7/am33xx/clock_am43xx.c
    under directory arch/arm/cpu/armv7, there is no directory am33xx.
    why ?
  • Because it has moved to <Processor SDK>/board-support/u-boot-<version>/arch/arm/mach-omap2/am33xx/clock_am43xx.c

  • Dear Kemal:

    We have follow your advice to modify the u-boot.
    but it still can't work with UART3 as console.

    we don't know the root cause .
  • Check my first post for am335x platform, do the same for am437x.
  • Dear Kemal:
    We try all the post.

    It still does't work.
  • Have you change the stdout-path = &uart0; in <Processor SDK>/board-support/u-boot-<version>/arch/arm/dts/am437x-sk-evm.dts?

  • Dear Kemal:

             Yes. We have modify it to stdout-path = &uart3;

  • Hi kemal:
    When I modify the clock enable for the uart3, it will show following error. Does the uart3 don't need to wkup?

    In file included from arch/arm/mach-omap2/am33xx/clock_am43xx.c:17:0:
    arch/arm/mach-omap2/am33xx/clock_am43xx.c: In function 'setup_clocks_for_console':
    arch/arm/mach-omap2/am33xx/clock_am43xx.c:77:25: error: 'struct cm_wkuppll' has no member named 'wkup_uart4ctrl'; did you mean 'wkup_uart0ctrl'?
    clrsetbits_le32(&cmwkup->wkup_uart4ctrl,
    ^
    ./arch/arm/include/asm/io.h:78:55: note: in definition of macro '__arch_putl'
    #define __arch_putl(v,a) (*(volatile unsigned int *)(a) = (v))
    ^
    ./arch/arm/include/asm/io.h:175:35: note: in expansion of macro '__raw_writel'
    #define out_arch(type,endian,a,v) __raw_write##type(cpu_to_##endian(v),a)
    ^~~~~~~~~~~
    ./arch/arm/include/asm/io.h:179:23: note: in expansion of macro 'out_arch'
    #define out_le32(a,v) out_arch(l,le32,a,v)
    ^~~~~~~~
    ./arch/arm/include/asm/io.h:202:2: note: in expansion of macro 'out_le32'
    out_##type((addr), (in_##type(addr) & ~(clear)) | (set))
    ^~~~
    ./arch/arm/include/asm/io.h:210:43: note: in expansion of macro 'clrsetbits'
    #define clrsetbits_le32(addr, clear, set) clrsetbits(le32, addr, clear, set)
    ^~~~~~~~~~
    arch/arm/mach-omap2/am33xx/clock_am43xx.c:77:2: note: in expansion of macro 'clrsetbits_le32'
    clrsetbits_le32(&cmwkup->wkup_uart4ctrl,
    ^~~~~~~~~~~~~~~
    arch/arm/mach-omap2/am33xx/clock_am43xx.c:77:25: error: 'struct cm_wkuppll' has no member named 'wkup_uart4ctrl'; did you mean 'wkup_uart0ctrl'?
    clrsetbits_le32(&cmwkup->wkup_uart4ctrl,
    ^
    ./arch/arm/include/asm/io.h:78:61: note: in definition of macro '__arch_putl'
    #define __arch_putl(v,a) (*(volatile unsigned int *)(a) = (v))
    ^
    ./arch/arm/include/asm/io.h:175:35: note: in expansion of macro '__raw_writel'
    #define out_arch(type,endian,a,v) __raw_write##type(cpu_to_##endian(v),a)
    ^~~~~~~~~~~
    include/linux/byteorder/generic.h:89:21: note: in expansion of macro '__cpu_to_le32'
    #define cpu_to_le32 __cpu_to_le32
    ^~~~~~~~~~~~~
    ./arch/arm/include/asm/io.h:179:23: note: in expansion of macro 'out_arch'
    #define out_le32(a,v) out_arch(l,le32,a,v)
    ^~~~~~~~
    ./arch/arm/include/asm/io.h:202:2: note: in expansion of macro 'out_le32'
    out_##type((addr), (in_##type(addr) & ~(clear)) | (set))
    ^~~~
    include/linux/byteorder/generic.h:90:21: note: in expansion of macro '__le32_to_cpu'
    #define le32_to_cpu __le32_to_cpu
    ^~~~~~~~~~~~~
    ./arch/arm/include/asm/io.h:133:25: note: in expansion of macro '__arch_getl'
    #define __raw_readl(a) __arch_getl(a)
    ^~~~~~~~~~~
    ./arch/arm/include/asm/io.h:176:49: note: in expansion of macro '__raw_readl'
    #define in_arch(type,endian,a) endian##_to_cpu(__raw_read##type(a))
    ^~~~~~~~~~
    ./arch/arm/include/asm/io.h:183:20: note: in expansion of macro 'in_arch'
    #define in_le32(a) in_arch(l,le32,a)
    ^~~~~~~
    ./arch/arm/include/asm/io.h:202:22: note: in expansion of macro 'in_le32'
    out_##type((addr), (in_##type(addr) & ~(clear)) | (set))
    ^~~
    ./arch/arm/include/asm/io.h:210:43: note: in expansion of macro 'clrsetbits'
    #define clrsetbits_le32(addr, clear, set) clrsetbits(le32, addr, clear, set)
    ^~~~~~~~~~
    arch/arm/mach-omap2/am33xx/clock_am43xx.c:77:2: note: in expansion of macro 'clrsetbits_le32'
    clrsetbits_le32(&cmwkup->wkup_uart4ctrl,
    ^~~~~~~~~~~~~~~
    arch/arm/mach-omap2/am33xx/clock_am43xx.c:85:26: error: 'struct cm_wkuppll' has no member named 'wkup_uart4ctrl'; did you mean 'wkup_uart0ctrl'?
    clkctrl = readl(&cmwkup->wkup_uart4ctrl);
    ^
    ./arch/arm/include/asm/io.h:73:54: note: in definition of macro '__arch_getl'
    #define __arch_getl(a) (*(volatile unsigned int *)(a))
  • Hi kemal:
    I following the instruction about which you attached the link to config uart5. And config all the files which described, and the uart3 can not work as well. Does the rtsn and ctsn will influence the output of uart3? because I didn't config them in mux.c, only config rx and tx.
  • Hi kemal:
    How can setting the "CONFIG_SYS_EXTRA_OPTIONS="CONS_INDEX=XXXX,NAND" in the "am43xx_evm_defconfig"?
    should the parameter 'CONS_INDEX' 3 or 4?
  • Please, apply this patch to change the console from UART0 to UART3.

    cd <Processor SDK>/board-support/u-boot-<version>/
    git apply 0001-AM437x-Change-U-Boot-console-from-UART0-to-UART3.patch

  • Hi kemal:
    Thanks for your help, the only forget modify is the uart0 in the file "am437x-gp-evm-u-boot.dtsi", the MLO can boot up, but the uboot stage no anything output.

    U-Boot SPL 2017.01-00458-gccd1c34-dirty (May 03 2018 - 18:36:26)
    Trying to boot from MMC1
    SPL: Please implement spl_start_uboot() for your board
    SPL: Direct Linux boot not active!
    reading u-boot.img
    reading u-boot.img
    reading u-boot.img
    reading u-boot.img
  • Hi Kemal:
    I fixed the uboot stage, thanks for your help indeed.