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.

AM3358: UART_open issue

Part Number: AM3358
Other Parts Discussed in Thread: SYSBIOS, CCSTUDIO

Void taskFxn(UArg a0, UArg a1)

{

UART_init();

UART_Params uartParams;

UART_Params_init(&uartParams);

UART_Handle uartHandle = UART_open(2, &uartParams); -->can't open

}

/*

* ======== main ========

*/

Int main()

{

Task_Handle task;

Error_Block eb;

Task_Params taskParams;

Uart_appC7xPreInit();

if (Board_initUART() == false)

{

System_printf("\nBoard_initUART failed!\n");

return(0);

}

Error_init(&eb);

/* Initialize the task params */

Task_Params_init(&taskParams);

/* Set the task priority higher than the default priority (1) */

taskParams.priority = 2;

taskParams.stackSize = 0x4000;

task = Task_create(taskFxn, &taskParams, &eb);

if (task == NULL) {

BIOS_exit(0);

}

BIOS_start(); /* does not return */

return(0);

}

I use instance as 2. Is there limit on instance for UART_open to work? Thanks

  • Logical peripheral number for the UART indexed into the UART_config table. How to know what instance is indexed into the UART_config table?

  • Anping,

    Do you use AM335x TI PSDK RTOS? If yes, which version?

    Do you use AM335x TI board (evmAM335x, skAM335x, bbbAM335x, icev2AM335x) or AM335x custom board?

    Prior using UART_open() you need to call functions like Board_init(boardCfg), UART_socSetInitCfg etc. Check below user guide for details:

    http://software-dl.ti.com/processor-sdk-rtos/esd/docs/latest/rtos/index_device_drv.html#apis

    ...
    Board_init(boardCfg);
    ...
    UART_socGetInitCfg(UART_INSTANCE, &uart_cfg);
    ...
    UART_socSetInitCfg(UART_INSTANCE, &uart_cfg);
    ...
    UART_Params_init(&params);
    ...
    handle = UART_open(UART_INSTANCE, &params);

    Regards,
    Pavel

  • Hi Pavel

          I use pdk_am335x_1_0_16 and beaglebone black. Where can I find the UART_config table? 2 seem not to be Logical peripheral number for the UART indexed into the UART_config table. Thanks

        

  • Anping,

    Anping Chen said:
    Where can I find the UART_config table?

    The UART_soc.c file binds driver with hardware attributes on the board through UART_config structure. This structure must be provided to UART driver. It must be initialized before the UART_init() function is called and cannot be changed afterwards. For details about individual fields of this structure, see the Doxygen help by opening PDK_INSTALL_DIR/packages/ti/drv/uart/docs/doxygen/htm/lindex.html.

    {PDK}/packages/ti/drv/uart/UART.h

    {PDK}/packages/ti/drv/uart/soc/am335x/UART_soc.c

    /* UART configuration structure */
    UART_config_list UART_config = {

    /* we have 6 UARTs here, from UART0 to UART5 */

    }

  • Part Number: AM3358

    why does UART_open return NULL? Here is my code(BOARD_UART_INSTANCE=0)

    Void taskFxn(UArg a0, UArg a1)

    {

    System_printf("enter taskFxn()\n");

    UART_HwAttrs uart_cfg;

    /* Get the default UART init configurations */

    UART_socGetInitCfg(BOARD_UART_INSTANCE, &uart_cfg);

    uart_cfg.edmaHandle = NULL;

    uart_cfg.dmaMode = FALSE;

    uart_cfg.loopback = FALSE;

    /* Set the DMA enabled UART init configurations */

    UART_socSetInitCfg(BOARD_UART_INSTANCE, &uart_cfg);

    UART_Params uartParams;

    UART_Params_init(&uartParams);

    uartParams.parityType = UART_PAR_NONE;

    UART_Handle uart = UART_open(BOARD_UART_INSTANCE, &uartParams);

    if (uart == NULL)

    {

    UART_printf("\nUART_open() fail!\n");

    }

    System_printf("exit taskFxn()\n");

    System_flush(); /* force SysMin output to console */

    }

    /*

    * ======== main ========

    */

    Int main()

    {

    System_printf("enter main()\n");

    Board_initCfg boardCfg = BOARD_INIT_PINMUX_CONFIG |

    BOARD_INIT_MODULE_CLOCK |

    BOARD_INIT_DDR |

    BOARD_INIT_PLL |

    BOARD_INIT_UART_STDIO;

    Board_STATUS boardStatus = Board_init(boardCfg);

    if (boardStatus != BOARD_SOK)

    {

    return (0);

    }

    Error_Block eb;

    Error_init(&eb);

    /* Initialize the task params */

    Task_Params taskParams;

    Task_Params_init(&taskParams);

    /* Set the task priority higher than the default priority (1) */

    taskParams.priority = 2;

    taskParams.stackSize = 4*1024;

    Task_Handle task = Task_create(taskFxn, &taskParams, &eb);

    if (task == NULL)

    {

    System_printf("Task_create() failed!\n");

    BIOS_exit(0);

    }

    start_app(); /* does not return */

    return(0);

    }

  • Anping,

    Anping Chen said:
    why does UART_open return NULL?

    Do you have this code from some example/test inside PDK or this is your own code?

    I will suggest you to align your code (as much as you can) to below files:

    pdk_am335x_1_0_16/packages/ti/drv/uart/test/src/main_uart_test.c

    pdk_am335x_1_0_16/packages/ti/drv/uart/test/am335x/armv7/bios/am335x_app_bbbam335x.cfg

    pdk_am335x_1_0_16/packages/ti/drv/uart/test/am335x/armv7/bios/UART_BasicExample_bbbAM335x_armTestProject.txt


    Do you have any errors/warnings during building your out file?

    You are using UART_printf right after UART_open(), which seems not correct. After UART_open(), you should use UART_read() and UART_write(). This is explained in the UART user guide:

    http://software-dl.ti.com/processor-sdk-rtos/esd/docs/latest/rtos/index_device_drv.html#apis

    Check also if you include UART header files in your main C file.

    /* UART Header files */
    #include <ti/drv/uart/UART.h>
    #include <ti/drv/uart/UART_stdio.h>

    Also before uart_open() function, you should check and verify you have the correct value in register CM_WKUP_UART0_CLKCTRL

    Regards,
    Pavel

  • Hi Pavel

        How to check and verify you have the correct value in register CM_WKUP_UART0_CLKCTRL? I put the code

    UART_HwAttrs uart_cfg;

    /* Get the default UART init configurations */

    UART_socGetInitCfg(uartTestInstance, &uart_cfg);

    uart_cfg.edmaHandle = NULL;

    uart_cfg.dmaMode = FALSE;

    uart_cfg.loopback = FALSE;

    /* Set the DMA enabled UART init configurations */

    UART_socSetInitCfg(uartTestInstance, &uart_cfg);

    UART_Params uartParams;

    UART_Params_init(&uartParams);

    uartParams.parityType = UART_PAR_NONE;

    UART_Handle uart = UART_open(uartTestInstance, &uartParams);

    if (uart == NULL)

    {

    UART_printf("\nBAE_UART_open() fail!\n");

    }

    after UART_init(); in function Void taskFxn(UArg a0, UArg a1) in your example project UART_BasicExample_bbbAM335x_armTestProject. UART_open(uartTestInstance, &uartParams) does't return NULL. but If I add same the code after UART_init(); in function Void taskFxn(UArg a0, UArg a1) in my project,  UART_open(uartTestInstance, &uartParams) return NULL. My main is same as one in UART_BasicExample_bbbAM335x_armTestProject. UART_printf just show error. I have no clue about what might affect UART_open? Thanks

  • Hi Pavel

          My project has one warnings about PRCMModuleEnable during building your out file. Your example project has this warning also. The same code have difference result. In your Board_initUART() there is UART_getTestInstNum(&uartTestInstance, &boardAM570x); For AM335x uartTestInstance = UART_INSTANCE;  Then code use uartTestInstance later. Here is

    #define UART_INSTANCE   (BOARD_UART_INSTANCE).

    My project use BOARD_UART_INSTANCE directly. Please help me. Thanks

  • Here is my project include file

    #include <xdc/std.h>

    #include <xdc/runtime/Memory.h>

    #include <xdc/runtime/Types.h>

    #include <xdc/runtime/System.h>

    #include <xdc/runtime/Error.h>

    #include <xdc/runtime/Timestamp.h>

    #include <ti/sysbios/BIOS.h>

    #include <ti/sysbios/knl/Clock.h>

    #include <ti/sysbios/knl/Task.h>

    #include <ti/sysbios/knl/Semaphore.h>

    #include <ti/sysbios/knl/Mailbox.h>

    #include <ti/sysbios/hal/Hwi.h>

    #include <ti/sysbios/hal/Timer.h>

    #include <ti/sysbios/heaps/HeapMem.h>

     

    /* Board Header files */

    #include <ti/board/board.h>

    #include <ti/starterware/include/prcm.h>

    /* CSL Header files */

    #include <ti/csl/csl_chip.h>

    #include <ti/csl/csl_clec.h>

    #include <ti/csl/soc.h>

    #include <ti/csl/csl_uart.h>

    #if defined(SOC_AM335x)

    #include <ti/csl/src/ip/uart/V1/uart.h>

    #endif

    /* OSAL Header files */

    #include <ti/osal/osal.h>

    /* UART Header files */

    #include <ti/drv/uart/UART.h>

    #include <ti/drv/uart/UART_stdio.h>

    #include <ti/drv/uart/src/v1/UART_v1.h>

    #if defined(SOC_AM335x)

    #include <ti/drv/uart/src/v2/UART_v2.h>

    #endif

    #include <ti/drv/uart/src/UART_osal.h>

    #include <ti/drv/uart/soc/UART_soc.h>

    /* SPI Header files */

    #include <ti/drv/spi/soc/SPI_soc.h>

    #include <ti/drv/spi/src/SPI_osal.h>

    #include <ti/drv/spi/SPI.h>

    #ifdef UART_DMA_ENABLE

    #include <ti/osal/CacheP.h>

    /* EDMA3 Header files */

    #include <ti/sdo/edma3/drv/edma3_drv.h>

    #include <ti/sdo/edma3/rm/edma3_rm.h>

    #include <ti/sdo/edma3/rm/sample/bios6_edma3_rm_sample.h>

    #endif

    #ifdef SPI_DMA_ENABLE

    #include <ti/osal/CacheP.h>

    /* EDMA3 Header files */

    #include <ti/sdo/edma3/drv/edma3_drv.h>

    #include <ti/sdo/edma3/rm/edma3_rm.h>

    #include <ti/sdo/edma3/rm/sample/bios6_edma3_rm_sample.h>

    #endif

    My project will use both SPI and UART.

  • Anping Chen said:
    How to check and verify you have the correct value in register CM_WKUP_UART0_CLKCTRL?

    You need to put break point just before UART_open() function invocation and check CM_WKUP_UART0_CLKCTRL register in CCStudio Registers window (View -> Registers). You can also check the value from Memory Browser windows (View -> Memory Browser), where you need to type the register address (i.e. 0x44E004B4) and you will see the value.

    Check also what value you have in other UART PRCM registers:

    CM_PER_UART1_CLKCTRL
    CM_PER_UART2_CLKCTRL
    CM_PER_UART3_CLKCTRL
    CM_PER_UART4_CLKCTRL
    CM_PER_UART5_CLKCTRL


    Anping Chen said:
    after UART_init(); in function Void taskFxn(UArg a0, UArg a1) in your example project UART_BasicExample_bbbAM335x_armTestProject. UART_open(uartTestInstance, &uartParams) does't return NULL.

    When you run this ready default test on bbbAM335x board (which is successful) check also what values you have in UART PRCM registers and compare with your custom test (which fails at UART_open).

    CM_WKUP_UART0_CLKCTRL
    CM_PER_UART1_CLKCTRL
    CM_PER_UART2_CLKCTRL
    CM_PER_UART3_CLKCTRL
    CM_PER_UART4_CLKCTRL
    CM_PER_UART5_CLKCTRL


    Also in ready default test we have cfg file (am335x_app_bbbam335x.cfg), where we setup stack size, heap size, MMU setup. Make sure you have the same (or at least similar) in your custom test.

    Regards,
    Pavel

  • My project

    CM_WKUP_UART0_CLKCTRL

    Reserved1     0

    IDLEST          00-Func

    Reserved       0

    MODULEMODE   10-ENABLE

    CM_PER_UART1_CLKCTRL

    Reserved1     0

    IDLEST          00-Func

    Reserved       0

    MODULEMODE   10-ENABLE


    CM_PER_UART2_CLKCTRL

    Reserved1     0

    IDLEST          11-Disable

    Reserved       0

    MODULEMODE   00-DISABLED


    CM_PER_UART3_CLKCTRL

    Reserved1     0

    IDLEST          11-Disable

    Reserved       0

    MODULEMODE   00-DISABLED


    CM_PER_UART4_CLKCTRL

    Reserved1     0

    IDLEST          11-Disable

    Reserved       0

    MODULEMODE   00-DISABLED


    CM_PER_UART5_CLKCTRL

    Reserved1     0

    IDLEST          11-Disable

    Reserved       0

    MODULEMODE   00-DISABLED

    your project

    CM_WKUP_UART0_CLKCTRL

    Reserved1     0

    IDLEST          00-Func

    Reserved       0

    MODULEMODE   10-ENABLE

    CM_PER_UART1_CLKCTRL

    Reserved1     0

    IDLEST          00-Func

    Reserved       0

    MODULEMODE   10-ENABLE


    CM_PER_UART2_CLKCTRL

    Reserved1     0

    IDLEST          11-Disable

    Reserved       0

    MODULEMODE   00-DISABLED


    CM_PER_UART3_CLKCTRL

    Reserved1     0

    IDLEST          11-Disable

    Reserved       0

    MODULEMODE   00-DISABLED


    CM_PER_UART4_CLKCTRL

    Reserved1     0

    IDLEST          11-Disable

    Reserved       0

    MODULEMODE   00-DISABLED


    CM_PER_UART5_CLKCTRL

    Reserved1     0

    IDLEST          11-Disable

    Reserved       0

    MODULEMODE   00-DISABLED

  • your project has UART_soc.c. Do I need this file in my project? If yes, where does this file locate? Thanks

  • I found UART_soc.c in C:\ti\pdk_am335x_1_0_16\packages\ti\drv\uart\soc\am335x. I put UART_soc.c in my project. UART_open still return NULL. even if instance is 0.

  • Here is warning in my project

    ../main.c:113:5: warning: implicit declaration of function 'PRCMModuleEnable'; did you mean 'Hwi_Module_name'? [-Wimplicit-function-declaration]

    PRCMModuleEnable(42U, uartTestInstance + 1U, 0U);

    ^~~~~~~~~~~~~~~~

    Hwi_Module_name

    Thanks

  • your project and my project has same uartTestInstance, uarg_cfg and uartParams. Your project UART_open doesn't return NULL while my project UART_open return NULL! I saw

    fxnTablePtr Memory map prevented reading 0x00000000,

    object Memory map prevented reading 0x00000004 

    hwAttrs Memory map prevented reading 0x00000008

    under *(uart). Please help me! Thanks

  • This is for your example project. Next three are for my project. It seem to be memory issue. How to fix it? by .cfg file? Thanks

  • my uart_cfg baseAddr is 0 while your uart_cfg baseAddr is 1155567616. I put UART_soc in my project. It should be SOC_UART_0_REGS. 

  • Hi Pavel

         Do you have the solution for "UART_open return NULL" issue? It seem to be memory issue. How to fix? by .cfg file? Thanks

  • before executing

    UART_socSetInitCfg(uartTestInstance, &uart_cfg);

    uart_cfg.baseAddr = 1155567616

    after executing

    UART_socSetInitCfg(uartTestInstance, &uart_cfg);

    uart_cfg.baseAddr = 0.

    why? Thanks

  • Part Number: AM3358

    I post "UART_open return NULL" question and provide related info to Pavel several days ago. But I don't hear from him. I like to know what should I do to solve the issue. Please give me update what is going on. I am struggling on it for one week. Thanks

  • Anping Chen said:
    your project has UART_soc.c. Do I need this file in my project? If yes, where does this file locate? Thanks

    Anping,

    Yes, you need UART_soc.c file in your project.

    I have just tested UART_BasicExample_skAM335x_armTestProject on my skAM335x board, and it works fine, UART_open() return OK. I am using UART0 (uart instance number is 0) as this is my UART console. You should have the same for bbbAM335x board.

    In my project (UART_BasicExample_skAM335x_armTestProject) I have these files:

    PDK_INSTALL_PATH/ti/drv/uart/soc/am335x/UART_soc.c

    PDK_INSTALL_PATH/ti/drv/uart/test/src/main_uart_test.c

    PDK_INSTALL_PATH/ti/drv/uart/test/am335x/armv7/bios/am335x_app_skam335x.cfg


    In main_uart_test.c, we use UART_soc.c through including its header file:

    /* UART Header files */
    #include <ti/drv/uart/UART.h>
    #include <ti/drv/uart/UART_stdio.h>
    #include <ti/drv/uart/src/UART_osal.h>
    #include <ti/drv/uart/soc/UART_soc.h>

    #include "UART_board.h"

    I would suggest you to explore the flow for skAM335x board and apply the same on your custom application.

    main_uart_test.c

    line 2436 main() -> Board_initUART() -> Task_create() -> taskFxn() -> UART_init() -> UART_test_print_test_desc() -> UART_initConfig() -> UART_Params_init() -> UART_open()

    I will check your other questions and come back to you.

    Regards,
    Pavel

  • Anping Chen said:

    before executing

    UART_socSetInitCfg(uartTestInstance, &uart_cfg);

    uart_cfg.baseAddr = 1155567616

    after executing

    UART_socSetInitCfg(uartTestInstance, &uart_cfg);

    uart_cfg.baseAddr = 0.

    This seems to be error.

    In skAM335x main_uart_test.c we have

    Void taskFxn(UArg a0, UArg a1)

    {

    UART_init();

    UART_test_print_test_desc(&Uart_tests[i]);

    }

    void UART_test_print_test_desc(UART_Tests *test)
    {
        UART_Handle uart = NULL;
        UART_Params uartParams;

    /* UART SoC init configuration */
        UART_initConfig(false);

    * Initialize the default configuration params. */
        UART_Params_init(&uartParams);
        uartParams.parityType = uartParity;
        uart = UART_open(uartTestInstance, &uartParams);

    }

    /*
     *  ======== UART init config ========
     */
    static void UART_initConfig(bool dmaMode)
    {
        UART_HwAttrs uart_cfg;

        /* Get the default UART init configurations */
        UART_socGetInitCfg(uartTestInstance, &uart_cfg);  ---> here we use UART_soc.c file, we initialize UART0 parameters, *cfg baseAddr is set up to 0x44E09000 (decimal 1155567616) SOC_UART_0_REGS

    /* Set the DMA enabled UART init configurations */
        UART_socSetInitCfg(uartTestInstance, &uart_cfg);  --> here we set the prior initialized parameters
    }

     

    Please align to this code and if you still observe the same error (baseAddr set to 0x0 instead of SOC_UART_0_REGS), attach your latest code here in the forum thread.


    Regards,
    Pavel

  • Hi Pavel

        In fact I have UART_open return NULL for pdk_am335x_1_0_15's UART_BasicExample_bbbAM335x_armTestProject. In particular

    function UART_test_print_test_desc

    /* UART SoC init configuration */

    UART_initConfig(false);

    /* Initialize the default configuration params. */

    UART_Params_init(&uartParams);

    uartParams.parityType = uartParity;

    uart = UART_open(uartTestInstance, &uartParams);->UART_open return NULL with uartTestInstance = 0. But If I set uartTestInstance = 1, uart != NULL.

    your guy let me to try pdk_am335x_1_0_16's UART_BasicExample_bbbAM335x_armTestProject. The Issue has gone! But I still don't know what cause UART_open return NULL. This is basic API. I hope you can help me to solve it. Thanks

  • Anping Chen said:
    In fact I have UART_open return NULL for pdk_am335x_1_0_15's UART_BasicExample_bbbAM335x_armTestProject

    Anping Chen said:
    ry pdk_am335x_1_0_16's UART_BasicExample_bbbAM335x_armTestProject. The Issue has gone!

    We indeed has some fix for UART_BasicExample_TestProject in PDK 1.0.16, so it is recommended to switch to this latest PDK version. Please refer to below document:

    pdk_am335x_1_0_16/packages/ti/drv/uart/docs/ReleaseNotes_UART_LLD.pdf

    Resolved Incident Reports (IR)

    Release 1.0.0.16:


    Anping Chen said:
    But I still don't know what cause UART_open return NULL. This is basic API. I hope you can help me to solve it.

    Yes, UART_open() is basic API, and you do not need to change it. But prior UART_open() execution, you need to initialize the UART controller through successful execution of UART_socSetInitCfg(uartTestInstance, &uart_cfg);, which is not valid for your PDK 1.0.15 case, as baseAddr is 0x0, instead of 0x44E09000.

    Prior using UART_open() you need to call functions like UART_socGetInitCfg() and UART_socSetInitCfg(), and make sure these have set the correct and expected values, which is not true for your PDK 1.0.15 usecase.

    Regards,
    Pavel

     

  • Hi Pavel

         In fact I follow what you said. It doesn't solve the issue. I provide PDK 1.0.15 example project in order for you to figure out why UART_open return NULL. I have already used  PDK 1.0.16. If you can use 1.0.15 example project UART_BasicExample_bbbAM335x_armTestProject to repeat "UART_open return NULL" issue, you should know how to fix it. I need to fix  "UART_open return NULL" issue before we can put the order and use AM335x.  Thanks

  • Anping,

    Anping Chen said:
    In fact I follow what you said. It doesn't solve the issue.

    What exactly you have followed?

    Anping Chen said:
    I provide PDK 1.0.15 example project in order for you to figure out why UART_open return NULL.

    Anping Chen said:
    If you can use 1.0.15 example project UART_BasicExample_bbbAM335x_armTestProject to repeat "UART_open return NULL" issue, you should know how to fix it.

    I think we have figured out why. Your UART0 base address is wrong, it is 0x0, but should be 0x44E09000. Do you need from me to run this UART test on my side with PDK 1.0.15?

    Anping Chen said:
    I have already used  PDK 1.0.16

    Anping Chen said:
    I need to fix  "UART_open return NULL" issue before we can put the order and use AM335x.  Thanks

    Do you mean you still have this issue (Uart_open return NULL, UART0 base addr is 0x0) with PSDK 1.0.16?

    Regards,
    Pavel

  • Hi Pavel

        Yes. I need you to run this UART test on your side with PDK 1.0.15 to repeat "UART_open return NULL" issue. Yes. I still have  "UART_open return NULL" issue! My test AM335x project stop at this issue!. Thanks

  • Anping,

    Anping Chen said:
    Yes. I need you to run this UART test on your side with PDK 1.0.15 to repeat "UART_open return NULL" issue.

    OK, I will test this UART test project on PDK 1.0.15 with CCS9.0.1. It will take some time for me to switch to this older SW package (RTOS, PDK, CCS, etc).

    Anping Chen said:
    Yes. I still have  "UART_open return NULL" issue!

    With PDK 1.0.16 also?

    Regards,
    Pavel

  • Hi Pavel

        I still  have  "UART_open return NULL" issue With PDK 1.0.16. It might relate to C:\ti\pdk_am335x_1_0_15 example project UART_BasicExample_bbbAM335x_armTestProject's "UART_open return NULL" issue. Thanks

  • Anping Chen said:
    I still  have  "UART_open return NULL" issue With PDK 1.0.16.

    Then I don't think I should test with PDK 1.0.15.

    Anping Chen said:
    It might relate to C:\ti\pdk_am335x_1_0_15 example project UART_BasicExample_bbbAM335x_armTestProject's "UART_open return NULL" issue.

    I can not understand this.


    What I can suggest you at this point:

     - Try the default PDK 1.0.16 UART_BasicExample_bbbAM335x_armTestProject on your bbbAM335x board and check how UART_open() behave

    - Align your code to PDK 1.0.16 UART_BasicExample_bbbAM335x_armTestProject


    Regards,
    Pavel

  • Hi Pavel

         I test PDK 1.0.16 UART_BasicExample_bbbAM335x_armTestProject on your bbbAM335x board and UART_open() doesn't return NULL.

    I align my code to PDK 1.0.16 UART_BasicExample_bbbAM335x_armTestProject and UART_open() return NULL.

    Our company policy don't allow me to share my code. I know PDK 1.0.15 UART_BasicExample_bbbAM335x_armTestProject UART_open() return NULL on your bbbAM335x board. I hope you can tell me how to do let PDK 1.0.15 UART_BasicExample_bbbAM335x_armTestProject UART_open() doesn't return NULL. Thanks

        

  • Anping,

    I am not aware of the exact patch that fix the issue in PDK 1.0.16. I will notify our UART experts and hope they can provide more details. They will post here in this e2e thread.

    Regards,
    Pavel

  • Hi Pavel

        We are your big customer. We might put 10000+ AM335x order later. Before that I must write test project to test all functions we need to use on my BeagleBone Black. UART_open is very basic API. I must know how to make it work. SPI_open works fine. DMA mode works with help of your person. I appreciate your help. I provided the info, like registers, to you before. But I didn't get your reply. In my BeagleBone Black UART0 and UART1 are enable, UART2, UART3, UART4 and UART5 are disable. How to enable other UART? How to use pinMux tool to configure my board?I watch the pinMux tool video on your site several time. I am still not comfortable to use pinMux tool. Is there more details pinMux tool tutorial? It is better to have the example how to design the board by using pinMux tool. Thanks

  • Hi Pavel

         I found after

    UART_socSetInitCfg(BOARD_UART_INSTANCE, &uart_cfg);

    uart_cfg.baseAddr is 1155567616

    when it execute

    UART_Params_init(&uartParams);

    it affect uart_cfg and uart_cfg become 0 in my project. In your example project

    to execute UART_Params_init(&uartParams) has no impact on uart_cfg. Where does UART_Params_init define? So I can locate it when I step into it. Thanks

  • Hi Pavel

     Any update? Where does UART_open define? So I can locate it when I step into it. Thanks

  • Anping,

    There is a lot of back-and-forth between you and Pavel on this thread. I'd like to quickly summarize the open questions I think I've seen. Please let me know if any question is missing from the summary.

    1. In my BeagleBone Black UART0 and UART1 are enable, UART2, UART3, UART4 and UART5 are disable. How to enable other UART?
    2. How to use pinMux tool to configure my board? Is there more details pinMux tool tutorial?
    3. Where does UART_Params_init define? So I can locate it when I step into it.
    4. I use instance as 2. Is there limit on instance for UART_open to work?
    5. Where does UART_open define? So I can locate it when I step into it.

    For questions #1 & #2: please see this documentation:

    For question #3: The UART_Params_init() function is defined in <PDK>\packages\ti\drv\uart\src\UART_drv.c:

    $ cd /r/pdk_am335x_1_0_16/packages/ti/drv/uart
    $ grep -rI -n -i --regexp="UART_Params_init" --include "*.c"
    src/UART_drv.c:141: * ======== UART_Params_init ========
    src/UART_drv.c:143:void UART_Params_init(UART_Params *params)

    For question #4: The number of supported UART instances is located in <PDK>\packages\ti\drv\uart\soc\am335x\UART_soc.c. Please see the code below from this file. The instance number provided to the UART_open() API is from 0 to CSL_UART_PER_CNT-1.

    #define CSL_UART_PER_CNT  (6U)

    For question #5: For AM335x, the UART_open() function is defined in src\v1\UART_v1.c. Please see <PDK>\packages\ti\drv\uart\soc\UART_soc.h to understand the V0 and V1 mapping for particular SoCs.

    $ grep -rI -n -i --regexp="UART\_open" --include "*.c"
    src/v1/UART_v1.c:713: * ======== UART_open_v1 ========
    src/v1/UART_v1.c:715:static UART_Handle UART_open_v1(UART_Handle handle, const UART_Params *params)

    For questions #3 & #5: If you want to step into the UART LLD library in debug mode, you can build the library as follows:

    > cd <PDK>\pdk_am335x_1_0_16\packages
    > pdksetupenv
    gmake uart_lib LIMIT_SOCS="am335x" LIMIT_BOARDS="bbbAM335x" LIMIT_CORES="a8host" BUILD_PROFILE="debug"

    Next, update the application .cfg file to use the debug library like this:  

    /* Load the uart package */
    var UartPackage = xdc.loadPackage('ti.drv.uart');
    UartPackage.Settings.enableProfiling = true;
    UartPackage.Settings.libProfile= "debug";

    UART module settings are contained in <PDK>\packages\ti\drv\uart\Settings.xdc. To change back to using the release library, simply remove this line or replace "debug" with "release".

    Regards,
    Frank

  • Hi Frank

         Thank you for your reply. I like to know what is right procedure to include UART_soc.c? What I do is right click project->Add Files...->select UART_soc.c. I choose copy not link. I don't know how to execute UART_Params_init will affect uart_cfg's baseAddr. They are completely unrelated! Thanks

  • Hi Frank

    in C:\ti\pdk_am335x_1_0_15\packages\MyExampleProjects\UART_BasicExample_bbbAM335x_armTestProject for some reason the UART is open already with the base addr.

    /* Check if the UART is open already with the base addr. */

    if(object->isOpen == true) {

    UART_osalHardwareIntRestore(key);

    UART_drv_log1("UART:(0x%x) already in use.", hwAttrs->baseAddr);

    handle = NULL;

    }

    Thanks

  •  Hi Frank

          line 769 UARTIntDisable(hwAttrs->baseAddr,UART_INT_RHR_CTI | UART_INT_THR | UART_INT_LINE_STAT);crash!

    Do you know why? Thanks

  • Hi Frank

         I make a little bit progress!  To execute UART_Params_init has no impact on uart_cfg's baseAddr after using modified your example project cfg file. My project has same problem as C:\ti\pdk_am335x_1_0_15\packages\MyExampleProjects\UART_BasicExample_bbbAM335x_armTestProject has!

    the UART is open already with the base addr. although it is first time to use UART_open. pdk_am335x_1_0_16 same name example project has no problem!  How do you fix it? How about UART_printf?

    (void)UART_osalPendLock(uart_stdio.sem, SemaphoreP_WAIT_FOREVER); crash!

    Thanks.

  • Aping,

    You've opened two new threads on this topic, so I'm closing this thread. I'll respond on those other threads.

    Regards,
    Frank

  • Hi Frank

         I stun at these two issues for a while. It is more and more clear which line cause the issue. Thank you for your help.