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.

Accessing UART2 via the Chip Support Library

Other Parts Discussed in Thread: TMS320C6748, OMAP-L138

Hi,

I am working on a 6748, and try to use the UART2 port by using the CSL.

The best example I have found is in ti\pspiom\cslr\evmOMAPL138\examples\uart\src\uart_example.c

Unfortunately this is only demoing loopback, not using the port for real, so my first question is: Is there a better example around?

 

To make the code work for UART2, I assume I have to enable the port in the PINMUX, so I added the following lines to the start of device_init() in uart_example.c:

    sysRegs->KICK0R = 0x83e70b13;
    sysRegs->KICK1R = 0x95a4f1e0; /* To enable modifying pinmux */

    sysRegs->PINMUX0 = 0x44440000; /* To enable UART0, UART1 and UART2 pins */
    sysRegs->PINMUX3 = 0x22220000;
    sysRegs->PINMUX4 = 0x22220000;
                       
    sysRegs->KICK0R = 0x00000000; /* To lock pinmux again */
    sysRegs->KICK1R = 0x00000000;

After this, I tried to write out all PINMUX registers, and they are unchanged... What am I doing wrong?

Later in the code I removed setting the loopback flag, and I changed it to use UART2, and but the code does not work. I assume that its because the pinmux hasn't been set up correct.y.

Helge

  • Helge,

    I would recommend that you not lock the KICK registers.  This usually leads to headaches where another function/process unexpectedly locks out register access.  The KICK lock-out function was disabled on Silicon Revision 2.

    You should be able to access the PINMUX registers after the KICK registers have been unlocked.  As a sanity check, can you try to modify the PINMUX registers through a CCS memory window?

    -Tommy

  • Helge Rasmussen said:

    The best example I have found is in ti\pspiom\cslr\evmOMAPL138\examples\uart\src\uart_example.c

    Unfortunately this is only demoing loopback, not using the port for real, so my first question is: Is there a better example around?

    If you prefer to use PSP instead of CSL, please see examples at:

    C:\Program Files\Texas Instruments\pspdrivers_01_xx_xx\packages\ti\pspiom\examples\evm6748\uart

     There is also the BSL example:

    ...\1014014A_TMS320C6748_GEL_BSL_Files\evmc6748_v1\tests\experimenter\uart

    OR

    ...\1014013A_OMAP-L138_GEL_BSL_Files\evmomapl138_v1\tests\experimenter\uart

    Go to LogicPD's web site.

    Click on the Kit Contents tab, at the bottom of the page click at: TMS320C6748 SOM-M1 GEL, CCS Setup, & BSL Files - you will need to create an account in their website if you do not have one already and download the files.

     

  • Thanks for the references, I will have a look at them.

     

    I figured out the problem with the pinmux::

    As part of boot of my code I switched to User Mode, and the pinmux is only accessible in Supervisor Mode. When I moved the code up to before the switch, everything worked.

    I will also stop locking the pinmux.