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.

configure UART2 in 811x

Hi im new in this,

How do i configure UART2 for my board, i need to be able to transmit.

Sorry if i cant provide a lot of information, im using ti-ezsdk_c6a811x-evm_5_05_01_09

Seems like uart0 is working by default, but cant fiind the files in the U Boot.

In my system also have a radio_pll_pinmux.ko, i tried to initialize like this in J5 init

#define CM_ALWON_UART_2_CLKCTRL     (PRCM_BASE_ADDR + 0x1558)

//UART PIN CONTROL
ptr=REMAP(PINCNTL(61));//uart2TDX
WR_MEM_32(ptr, 0x00000080);

ptr=REMAP(PINCNTL(59));//uart2RDX
WR_MEM_32(ptr, 0x00000080);

ptr=REMAP(CM_ALWON_UART_2_CLKCTRL);
WR_MEM_32(ptr,0x2);
while(RD_MEM_32(ptr)!=0x2);

Please let me know which files i'll should be checking or pint any information related, thanks

  • Hi Alfred,

    See if the below wiki will be in help:

    processors.wiki.ti.com/.../TI81xx_PSP_Porting_Guide

    BR
    Pavel
  • Hi Pavel Botev, thanks a lot for you quick response, this help me a lot.
    However this is not working at all, i applied the changes to board-ti811xevm.c

    the new changes are:

    TI814X_MUX(VOUT1_R_CR8, OMAP_MUX_MODE7), //UART5

    TI814X_MUX(VOUT1_R_CR9, OMAP_MUX_MODE7), //UART5

    TI814X_MUX(VOUT1_B_CB_C7, OMAP_MUX_MODE5), /* Set up pin as TXD */
    TI814X_MUX(VOUT1_B_CB_C6, OMAP_MUX_MODE5), /* Set up pin as RXD */

    TI814X_MUX(VOUT1_G_Y_YC4, OMAP_MUX_MODE5), //UART2 RXD
    TI814X_MUX(VOUT1_G_Y_YC5, OMAP_MUX_MODE5), //UART2 tx
    { .reg_offset = OMAP_MUX_TERMINATOR },

    for UART 5, 3 and 2

    ut still in console i cant transmit to the uart2-3 or 5, am i making any mistake? or missing something? The tutorial was straight foward, but maybe i overlook something

    there were some old changes from someone

    TI814X_MUX(VIN0_CLK0, OMAP_MUX_MODE7), //GP2_2
    TI814X_MUX(VIN0_HSYNC0, OMAP_MUX_MODE7), //GP2_3
    TI814X_MUX(VIN0_VSYNC0, OMAP_MUX_MODE7), //GP2_4
    TI814X_MUX(MMC2_DAT3, OMAP_MUX_MODE7), //GP2_5
    TI814X_MUX(MMC2_DAT2, OMAP_MUX_MODE7), //GP2_6
    //TI814X_MUX(GPMC_A16, OMAP_MUX_MODE7), //GP2_5
    //TI814X_MUX(GPMC_A17, OMAP_MUX_MODE7), //GP2_6
    TI814X_MUX(VIN0_D2, OMAP_MUX_MODE7), //GP2_7
    TI814X_MUX(VIN0_D3, OMAP_MUX_MODE7), //GP2_8
    TI814X_MUX(VIN0_D4, OMAP_MUX_MODE7), //GP2_9
    TI814X_MUX(VIN0_D5, OMAP_MUX_MODE7), //GP2_10
    TI814X_MUX(VIN0_D6, OMAP_MUX_MODE7), //GP2_11
    TI814X_MUX(VIN0_D7, OMAP_MUX_MODE7), //GP2_12
    TI814X_MUX(VIN0_D8, OMAP_MUX_MODE7), //GP2_13
    TI814X_MUX(VIN0_D9, OMAP_MUX_MODE7), //GP2_14
    TI814X_MUX(VIN0_D10, OMAP_MUX_MODE7), //GP2_15
    TI814X_MUX(VIN0_D11, OMAP_MUX_MODE7), //GP2_16
    TI814X_MUX(VIN0_D12, OMAP_MUX_MODE7), //GP2_17
    TI814X_MUX(VIN0_D13, OMAP_MUX_MODE7), //GP2_18
    TI814X_MUX(VIN0_D14, OMAP_MUX_MODE7), //GP2_19
    TI814X_MUX(VIN0_D15, OMAP_MUX_MODE7), //GP2_20 };
    TI814X_MUX(GPMC_A20, OMAP_MUX_MODE7), //GP1_15

    TI814X_MUX(GPMC_A21, OMAP_MUX_MODE7), //GP1_16

    TI814X_MUX(GPMC_A22, OMAP_MUX_MODE7), //GP1_17

    TI814X_MUX(GPMC_A23, OMAP_MUX_MODE7), //GP1_18

    could they be the issue? is there another thing that i need to configure?

    Thanks a lot in Advance

  • hey Pavel,
    Seems that the document is to change the console port, which is not exactly what i want, i want to enable the UART ports (any of them) and leave UART0. i want to be able to do this:

    echo 'testing' >> /dev/ttyO2

    And expect information transmitted to the post designed by it, this will be so i can communicate with other devices, could you point out an information source where explains the how i can do that, in which files?

    Thanks a lot and sorry to bother
  • Hi Alfred,

    UART0 (/dev/ttyO0) is used for console by default. From what I understand, you need to keep UART0 for console and enable UART2 (/dev/ttyO2) for other process? Do you need UART2 in u-boot or only in linux kernel? What is the output of the below command?

    evm:~# ls /dev/ttyO*

    BR
    Pavel
  • The latest EZSDK for 811x/J5Eco device is ti-ezsdk_c6a811x-evm_5_05_01_10, it comes with PSP 4.07.00.02:

    ti-ezsdk_c6a811x-evm_5_05_01_10/board-support/linux-2.6.37-psp04.07.00.02

    In this latest version, UART2 is enabled by default in u-boot and linux kernel.

    BR
    Pavel
  • Thanks a lot Pavel, let me check that information or download the lastest EZSDK, and ill get back to you with my results
  • By chance do you have the download link? seems not very obvious for me were is the package, sorry for the troubles
  • Alfred,

    This EZSDK is not free for download, but requires NDA and is available only in TI internal site through local TI FAE.

    Regards,
    Pavel
  • so, where i can see it to buy it?
  • OK we already have that, i will get back to you when we pull the latest version, thanks Pavel
  • Hey Pavel,

    We have now the most recent EZSDK eezsdk_c6a811x-evm_5_05_01_10, but UART2 wasn't transmitting anything at all, do i need to set anything else?

    We ran:
    evm:~# ls /dev/ttyO*

    and displayed /dev/ttyO0 /dev/ttyO1 /dev/ttyO2 /dev/ttyO3 /dev/ttyO4 /dev/ttyO5 /dev/ttyO6

    We noticed that the UART0 (that is working) sits normally high while UART 2 (that is not working) sits normally at (1 volt)

    Please advice
  • Pavel,
    By interrupting the Uboot process we wrote memory registers directly.
    We have been able to gain some insight as to what is going on and maybe you can assist from here.
    We were successfully able to get UART1 working correctly. Unfortunately our hardware is using UART2.

    UART1 settings
    UART1
    mw 0x48140BF8 0x20
    mw 0x48140BFC 0x20
    mw 0x48181554 0x02


    UART2 Settings
    mw 0x481408E8 0x20
    mw 0x481408F0 0x20
    mw 0x48181558 0x02

    When setting UART1 Tx pin after typing the command we were able to see the Tx line go high.
    This is not the case when setting UART2 Tx.
  • Alfred,

    Alfred Espinosa said:
    We ran:
    evm:~# ls /dev/ttyO*

    and displayed /dev/ttyO0 /dev/ttyO1 /dev/ttyO2 /dev/ttyO3 /dev/ttyO4 /dev/ttyO5 /dev/ttyO6

    This means you have UARTs 0 to 6 enable in the kernel.

    Alfred Espinosa said:
    We noticed that the UART0 (that is working) sits normally high while UART 2 (that is not working) sits normally at (1 volt)

    You should compare the registers settings between working UART0 (which is configured for console, thus able to transmit/receive) and non working UART2 (which is enabled but not configured). You can read/write registers from user space with devmem2 command, the base addr of UART0 is 0x48020000 and UART2 is 0x48024000. See also DM811x TRM, chapter 23 UART. Make sure also the UART2 pins are set correctly.

    BR
    Pavel

  • Alfred Espinosa said:
    UART2 Settings
    mw 0x481408E8 0x20

    This is not correct. For selecting UART2_RXD on pin AH13 (PINCNTL59/0x481408E8) you should set the value of 0x08 (not 0x20).

    Alfred Espinosa said:
    mw 0x481408F0 0x20

    This is not correct. For selecting UART2_TXD on pin AG14 (PINCNTL61/0x481408F0) you should set the value of 0x08 (not 0x20).

    BR
    Pavel

  • Hey Pavel,

    we found out a unused conector on EVK board labeled MLB,.
    MLB connector is conencted to the UART2 TX and It is overriding the values loaded for the pinmux
    how can we unload the MLB module from the kernel, do you know a way how to unload it?

    thanks
  • Alfred,

    Please see the below wiki page for how to set the pinmux in the linux kernel:

    processors.wiki.ti.com/.../TI811X_PSP_User_Guide

    BR
    Pavel
  • see the below 2 files:

    ti-ezsdk_c6a811x-evm_5_05_01_10/board-support/linux-2.6.37-psp04.07.00.02/arch/arm/mach-omap2/mux814x.c

    ti-ezsdk_c6a811x-evm_5_05_01_10/board-support/linux-2.6.37-psp04.07.00.02/arch/arm/mach-omap2/board-ti811xevm.c

    _TI814X_MUXENTRY(MLB_SIG, 0,

    "mlb_sig", NULL, NULL, "uart2_rxd_mux1", NULL, NULL,

    NULL, "gpio0_29", NULL, NULL, NULL, NULL),

    _TI814X_MUXENTRY(MLB_CLK, 0,

    "mlb_clk", NULL, NULL, "uart2_txd_mux1", NULL, NULL,

    NULL, "gpio0_31", NULL, NULL, NULL, NULL),

    You should set mlb_sig.uart2_rxd_mux1 and mlb_clk.uart2_txd_mux1

    Note that the below code might override your mlb_clk.uart2_txd_mux1 setting:

    omap_mux_init_signal("mlb_clk.gpio0_31", TI814X_PULL_DIS | (1 << 18));

    BR
    Pavel

  • hey Pavel,

    Understood, let me try that, thanks a lot. ill try then to init those mux entry

  • Thanks a lot Pavel
    Actually our only issue was:
    omap_mux_init_signal("mlb_clk.gpio0_31", TI814X_PULL_DIS | (1 << 18));

    in ti-ezsdk_c6a811x-evm_5_05_01_10/board-support/linux-2.6.37-psp04.07.00.02/arch/arm/mach-omap2/board-ti811xevm.c

    this was overwritting the UART2 settings we made, that's what we were looking for

    Thanks again Pavel