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.

AM4379: RTOS UART drivers

Part Number: AM4379
Other Parts Discussed in Thread: SYSBIOS

We are currently working on a new PROFINET enabled product and initially we have started development with the AM437x IDK.

We will be using TI-RTOS (SYSBIOS).

I have a question regarding choosing the correct driver API(s) supplied from TI.
Looking at the installed PDK (c:\ti\pdk_am437x_1_0_6) I have several options for selecting e.g. a UART driver.

I could be using

* starterware/dal: c:\ti\pdk_am437x_1_0_6\packages\ti\starterware\dal\uart_v1.c

* drv: c:\ti\pdk_am437x_1_0_6\packages\ti\drv\uart\*

* csl: c:\ti\pdk_am437x_1_0_6\packages\ti\csl\src\ip\uart\V1\*

Could anyone tell me what is the best/intended practice, which should I select?

Many thanks,

Mads

  • The RTOS team have been notified. They will respond here.
  • Hi,

    The latest P-SDK is 4.1 release with pdk_am437x_1_0_8, you may try with the latest to capture all new features and fixes.

    For UART if you want to use SYSBIOS, the Wiki is : processors.wiki.ti.com/.../Processor_SDK_RTOS_UART. We recommend starting from here (packages\ti\drv\uart), there are UART test examples.
    - packages\ti\drv\uart\ is the UART driver folder
    - packages\ti\csl\src\ip\uart\V1, this is CSL layer code, the UART driver calls into those CSL functions, but from UART driver API point of view, it is transparent to the user.
    - \ti\starterware\dal\uart_v1.c: this is from the starterware package, the starterware is no-OS.

    Regards, Eric
  • Thank you Eric for the quick reply, I will have a look at it.

    The reason for currently staying with pdk 1.0.6, was that I could not get pdk 1.0.7 to work with TI's PRU-ICSS-PROFINET-SLAVE industrial sw release (v1.00.01).

    Now I have a full source Molex Profinet stack running on target, so I will have a look at release PDK 1.0.8 (P-SDK 4.01).

  • Hi Eric,

    So now I use the UART_nnn() functions for initialising UART1 of my AM437x IDK.

    I keep getting an exception when opening UART1 (UART_open).

    But if I before initialization call
    PRCMModuleEnable(CHIPDB_MOD_ID_UART, 1U, 0U);

    UART seems to open just fine, well at least I do NOT get an exception. I have been looking at the UART driver examples and test and have a couple of questions.

    1. I used the PRCMModuleEnable() function call which is part of starterware, so now I am mixing the usage of starterware (no OS) and UART function calls from the drv layer. Is there any best practices here?

    2. Instead of using PRCMModuleEnable() should this have been done with some board initialisation stuff e.g. Board API?

    I am still trying to get my head around this - but I am getting there.

    Regards,
    Mads
  • Hi,

    In the P-SDK RTOS, there are many driver examples under \ti\pdk_am437x_1_0_6\packages\ti\drv. They all use UART to print out to the console to indicating the test results.

    You can use at the beginning of the main():

    boardCfg = BOARD_INIT_PINMUX_CONFIG |
    BOARD_INIT_MODULE_CLOCK |
    BOARD_INIT_UART_STDIO;

    boardStatus = Board_init(boardCfg);

    The BOARD_INIT_MODULE_CLOCK flag enables the PRCM domain of UART. See the pdk_am437x_1_0_6\packages\ti\board\src\idkAM437x\idkAM437x.c if you want to trace the details.

    You can run any UART example to understand how the UART is initialized.

    Regards, Eric
  • Hi Eric,

    Thank you for your quick reply.

    I already have this:
    boardCfg = BOARD_INIT_PINMUX_CONFIG |
    BOARD_INIT_MODULE_CLOCK |
    BOARD_INIT_UART_STDIO;
    boardStatus = Board_init(boardCfg);

    The Board_init() seems to call Board_moduleClockInit() which only activates UART0.
    /* UART */
    status = PRCMModuleEnable(CHIPDB_MOD_ID_UART, 0U, 0U);

    1. Since I for my test already uses UART0 for printf and I wish to use UART1 for some external communication, am I then correct in assuming I need to call:
    PRCMModuleEnable(CHIPDB_MOD_ID_UART, 1U, 0U);

    To enable UART1 (and also change pin mux cfg).

    2. If I do not call PRCMModuleEnable(CHIPDB_MOD_ID_UART, 1U, 0U) I get an exception. This is also correct behaviour?

    Regards,
    Mads
  • Hi,

    By default it enables uart0, yes, you need to enable UART1 by PRCMModuleEnable(CHIPDB_MOD_ID_UART, 1U, 0U); and also need do the PINMUX to use it.

    Regards, Eric