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.

OMAPL-138 UART Problem

Other Parts Discussed in Thread: OMAPL138, DA8XX

Hi,

I am using OMAPL-138 LCDK.I want to use UART1 for my application.I made needed hardware modifications to enable UART1:

Remove R205,R208

Short R206,R209.

I am programming with Linux OS.I still cannot communicate over UART1 while I am communication with UART2.There are lots of posts about this to change pin mux etc. So, should I make further changes pin mux or etc? Because I am already using Linux OS. Can you help me on this, what can the problem be?

Thanks,

Serhat Ağırbaş

  • Hi Serhat ,
    Yes, you have to change the pinmux for UART1 peripheral.
    Did you enable RTS and CTS pins too ?
    Did you cross check the register settings after Linux boot through "devmem2" command ?
    PINMUX0 and PINMUX4 register.

    Ex:
    devmem2 0x01C14120
    devmem2 0x01C14130

    Can you please provide the output for the above commands ?
  • Hi,

    Firstly,thanks for your reply.Output of commands;

    root@omapl138-lcdk:~# devmem2 0x01C14120
    /dev/mem opened.
    Memory mapped at address 0x40245000.
    Read at address 0x01C14120 (0x40245120): 0x41111111
    root@omapl138-lcdk:~# devmem2 0x01C14130
    /dev/mem opened.
    Memory mapped at address 0x40383000.
    Read at address 0x01C14130 (0x40383130): 0x00222288

    *Why I should set some registers while I am already using Linux OS? Does nor or should not the OS should change these registers already while I command to open UART1?

    *Is there any document which tells about these?Because I searched but could not find necessary documents?

    *I have no idea about PINMUX registers,how they can be set can you help me on this and documentation?

    Thanks for your help,

    Serhat Ağırbaş

  • Hi Serhat,

    *Is there any document which tells about these?Because I searched but could not find necessary documents?

    *I have no idea about PINMUX registers,how they can be set can you help me on this and documentation?

    I asked you to do this because I want ensure that you have done necessary pinmux settings for UART1.

    Actually we have pinmux registers to select the peripheral through PINMUX registers since the same pin is used for different peripherals that will be controlled through PIMUX registers, For ex, the UART1 is muxed with SPI,SATA and GPIO, you can select the peripheral as you wish.

    Extensive use of pin multiplexing is used to accommodate the large number of peripheral functions in the

    smallest possible package. On the device, pin multiplexing can be controlled on a pin by pin basis.

    Please refer to the OMAPL138 TRM (technical reference manual)

    Please read chapter 11.5.10 and also read 11.5.10.5 for UART1.

    root@omapl138-lcdk:~# devmem2 0x01C14120
    /dev/mem opened.
    Memory mapped at address 0x40245000.
    Read at address 0x01C14120 (0x40245120): 0x41111111
    root@omapl138-lcdk:~# devmem2 0x01C14130
    /dev/mem opened.
    Memory mapped at address 0x40383000.
    Read at address 0x01C14130 (0x40383130): 0x00222288

    Here you can see that UART1 is not selected and it is in trisate.

    You would get the value 0x22222288 in PINMUX4 (0x01C14130) register.

    *Why I should set some registers while I am already using Linux OS? Does nor or should not the OS should change these registers already while I command to open UART1?

    You have to do UART PINMUX code in board file.

  • Hi,

    Thanks for your reply.I am new at embedded world and TI products.There are a few points that I did not get.

    1)If I were using SYS/BIOS with CCS it is OK I should fill lots of registers and etc. but now how can I set some registers while I am using Linux OS?

    2)I created my own bootable SD Card with ti-sdk-omapl138-lcdk-01.00.00/filesystem from the link;

    software-dl.ti.com/.../index_FDS.html

    and then when I boot my LCDK there is no such a directory like arch,arm or board.c . So,how can I change PINMUX registers etc.?

    Thanks,

    Serhat Ağırbaş
  • Hi Serhat,
    You won't find files like arch,arm or board.c in LCDK board instead it will be given in Linux source code.

    You have to download the source from either this
    software-dl.ti.com/dsps/dsps_public_sw/c6000/web/omapl138_lcdk_sdk/latest/exports//ti-sdk-omapl138-lcdk-01.00.00.bz2

    or the following latest SDK.

    software-dl.ti.com/sdoemb/sdoemb_public_sw/mcsdk/latest1/exports/mcsdk_1_01_00_02_setupwin32.exe

    After installing the above link, you would get linux source code from the following location.
    C:\ti\mcsdk_1_01_00_02\board-support\linux-3.3-psp03.22.00.06.sdk
    LCDK Linux board file:
    C:\ti\mcsdk_1_01_00_02\board-support\linux-3.3-psp03.22.00.06.sdk\arch\arm\mach-davinci\board-omapl138-lcdk.c

    Try to comment it out the following line and check that PINMUX4 register via devmem2
    __raw_writel(0, IO_ADDRESS(DA8XX_UART1_BASE) + 0x30);
    TO
    // __raw_writel(0, IO_ADDRESS(DA8XX_UART1_BASE) + 0x30);
  • Hi,

    Thanks for your reply.Let me steps done until now;

    - I created a botable SD Card with below link and /filesystem/omapl138-lcdk-fs.tar.gz in it.

    software-dl.ti.com/dsps/dsps_public_sw/c6000/web/omapl138_lcdk_sdk/latest/exports//ti-sdk-omapl138-lcdk-01.00.00.bz2

    -Then I am creating a simple C Code in my linux host machine and compiling it as told in the below document;

    downloads.ti.com/.../OMAP-L138_LCDK_Linux_SDK_Getting_Started_Guide.pdf

    My code is like ;

    #include <stdio.h>
    #include "rs232.h"

    int main()
    {
    char mode[]={'8','N','1',0};
    char str[6];

    strcpy(str, "Test\n\r");


    if(RS232_OpenComport(0, 115200, mode))
    {
    printf("Cannot open comport0\n\r");
    return 0;
    }
    else
    {
    printf("Comport0 Open!\n\r");
    }
    if(RS232_OpenComport(1, 115200, mode))
    {
    printf("Cannot open comport1\n\r");
    return 0;
    }
    else
    {
    printf("Comport1 Open!\n\r");
    }
    while(1)
    {
    RS232_cputs(0, str);
    if(RS232_SendByte(0, 0x2B))
    {
    printf("ErrorPort0!\n\r");
    }

    RS232_cputs(1, str);
    if(RS232_SendByte(1, 0x2B))
    {
    printf("ErrorPort1!\n\r");
    }
    //RS232_CloseComport(1);

    //RS232_cputs(2, str);
    //RS232_CloseComport(2);

    printf("Sent!\n\r");


    usleep(300000);

    }


    return 0;
    }

    So, how can I use C:\ti\mcsdk_1_01_00_02\board-support\linux-3.3-psp03.22.00.06.sdk\arch\arm\mach-davinci\board-omapl138-lcdk.c as you told?

    Thanks,

    Serhat Ağırbaş
  • Hi,

    Do you have any suggestions for my previous post?

    Thanks,

    Serhat Ağırbaş

  • Have you done the following ?

    Try to comment it out the following line and check that PINMUX4 register via devmem2

    arch\arm\mach-davinci\board-omapl138-lcdk.c

    __raw_writel(0, IO_ADDRESS(DA8XX_UART1_BASE) + 0x30);
    TO
    // __raw_writel(0, IO_ADDRESS(DA8XX_UART1_BASE) + 0x30);
  • Hi,

    I found those lines commented out.But my problem is how can I import new Linux kernel to LCDK?

    Thanks,

    Serhat Ağırbaş
  • Hi,

    Can you help me on this? I commented out;

    arch\arm\mach-davinci\board-omapl138-lcdk.c

    __raw_writel(0, IO_ADDRESS(DA8XX_UART1_BASE) + 0x30);
    TO
    // __raw_writel(0, IO_ADDRESS(DA8XX_UART1_BASE) + 0x30);

    but how can I cmpile and install this new Linux kernel to LCDK?

    Thanks,

    Serhat Ağırbaş
  • Hi Sehrat,

    So, how can I use C:\ti\mcsdk_1_01_00_02\board-support\linux-3.3-psp03.22.00.06.sdk\arch\arm\mach-davinci\board-omapl138-lcdk.c as you told?


    As this is a board specific file for LCDK Board , it contains on-board peripherals initialization code.
    You can make changes to this file in order to configure different peripherals, and can cross-compile kernel and changes will be reflected.


    I found those lines commented out.But my problem is how can I import new Linux kernel to LCDK?

    What do you mean by new Linux Kernel ?
    Are you trying to use latest kernel version which is not part of TI provided sdk .
    Can you please elaborate your issue.
  • Hi Arvind,

    Thanks for your reply.I downloaded and setup latest sdk to my host computer.

    I changed(commented out) needed lines in;

    C:\ti\mcsdk_1_01_00_02\board-support\linux-3.3-psp03.22.00.06.sdk\arch\arm\mach-davinci/board-omapl138-lcdk.c .

    After this ponit what should I do to import these changes to my LCDK?

    Thanks,

    Serhat Ağırbaş
  • Hi Serhat,
    You need Linux host machine to rebuild the kernel.
    Else install the virtual box in windows and install Linux there then try to build the kernel.
  • Hi,

    I am testing with LCDK and its SD Card.So why host machine?

    Thanks,

    Serhat Ağırbaş

  • I mean to say that you should need Linux PC for rebuilding the kernel.
    Do you want to rebuild the kernel for UART change ?
  • Hi,

    I changed

    __raw_writel(0, IO_ADDRESS(DA8XX_UART1_BASE) + 0x30);  to

    //__raw_writel(0, IO_ADDRESS(DA8XX_UART1_BASE) + 0x30);   in arc/arm/mach-davinci/board-omapl138-lcdk.c .

    Then I cross compiled it in my host machine with commands;

    host $ ARCH=arm CROSS_COMPILE=arm-arago-linux-gnueabi- make distclean 
    host $ ARCH=arm CROSS_COMPILE=arm-arago-linux-gnueabi- make da850_lcdk_defconfig
    host $ ARCH=arm CROSS_COMPILE=arm-arago-linux-gnueabi- make uImage

    I copied uImage file to 1st partition of SD Card.When I send below commands i am getting below responses;

    devmem2 0x01C14120 - Read at address  0x01C14120 (0xb6fb3120): 0x28111111
    devmem2 0x01C14130 - Read at address  0x01C14130 (0xb6f45130): 0x00228888

    As I checked from pinmux utility I still could not activate UART1.What can be the problem,can you help me on this?

    Thanks,

    Serhat Ağırbaş
  • Hi Serhat,
    I will try this and let me update.
  • Hi Titus,

    Thanks, I will be waiting your update.

  • Hi,

    Do you have any updates?

    Thanks for your help,

    Serhat

  • Hi Serhat,

    Sorry for the delayed response on this.

    Now I'm able to do pinuxing for UART1 peripheral.

    I have done the following changes in board file.

    board-omapl138-lcdk.c

    Put  the following line in outside of "static __init void omapl138_lcdk_init(void)" function.

    static const short omapl138_lcdk_uart1_pin_mux[] __initconst = {

    DA850_UART1_RXD,

    DA850_UART1_TXD,

    -1

    };

    Add the following line in "static __init void omapl138_lcdk_init(void)" function.

    davinci_cfg_reg_list(omapl138_lcdk_uart1_pin_mux);

    Log:

    root@omapl138-lcdk:/# devmem2 0x01C14130

    /dev/mem opened.

    Memory mapped at address 0xb6f58000.

    Read at address  0x01C14130 (0xb6f58130): 0x22228888

    root@omapl138-lcdk:/#

    root@omapl138-lcdk:/

    Please let me know if any issues.

  • Hi,

    Thanks for help.I also tried it worked for PINMUX; I read 0x2222888. But still I cant get any response from UART1.I also made needed hardware changes like;

    Remove R205,R208

    Short R206,R209.

    I also checked LCDK's J15 connector's 17th pin, there is not any response.

    Is there anything more to do to be able to use UART1?

    Thanks,

    Serhat Ağırbaş

  • Hi Serhat ,
    How you are testing the UART1 ?
    You can send some character to UART1 from UART2.

    Ex:
    root@omapl138-target# echo "Testing" > /dev/ttyS1

    In parallel probe the UART1 TX/RX pins through DSO (scope)

    I will also try to enable UART1 in hw and let me update you tomorrow.
  • Hi Titus,

    I also tested as you described;

    root@omapl138-target# echo "Testing" > /dev/ttyS1

    In parallel probe the UART1 TX/RX pins through DSO (scope)


    But I didn't observe any signals.

    Thanks,

    Serhat Ağırbaş

  • Hi,

    Do you have any updates for the issue?

    Thanks,

    Serhat Ağırbaş

  • Dear Serhat,
    I'm working with hw team for this.
    Thanks for your patience.
  • Hi Titus,

    Do you have any updates?Because it has been long time and we can't use LCDK as needed.

    Thanks,

    Serhat Ağırbaş

  • Hi Titus,

    As far as I can tell I am experiencing the same issue on the LCDK. I have also made the necessary HW changes (remove R205,R208 and shorted R206,R209) and updated the pin muxing in omapl138_lcdk_init(). I am testing the output of J15 pin 19 and see no data on the pin. When I use the basic loop back PDK StaterWare example (modified to use UART1 and no AFE and auto-loopback) I can see data on the pin.

    I had previously posted this issue in another thread: e2e.ti.com/.../1688681

    Thank you for your continued support on this issue.

  • Serhat,

    Check out the following post, it solved my issue: e2e.ti.com/.../1692325
  • Dear MattS,
    Thanks for sharing the solution with other community members.
  • Dear Titus,

    My purpose is not using UART1 is console.I just want to enable UART0 and UART1.Do you have any updates? It has beenb long time since you replied as you will update.

    Thanks,

    Serhat Ağırbaş

  • Dear Serhat,
    As MattS mentioned, you have to enable the UART0 and UART1 support in u-boot first to use from kernel.

    Please refer to the following TI E2E post.

    e2e.ti.com/.../1692325