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.

[FAQ] 66AK2E05: UART Example project for K2E family devices

Part Number: 66AK2E05

Explain the Code, Hardware configuration, and Implementation of the UART example project in K2E family devices?

  • To run the UART example for K2E devices make sure the prerequisites are present.

    1. Install CCS (https://www.ti.com/tool/download/CCSTUDIO/9.3.0.00012),

    2. TI RTOS SDK

      1. For K2E: Install PROCESSOR-SDK-RTOS-K2E  (Version: 06_03_00_106, http://software-dl.ti.com/processor-sdk-rtos/esd/K2E/latest/index_FDS.html ),

    3. Generate the Example projects for PDK,

      1. For K2E: (https://e2e.ti.com/support/processors-group/processors/f/processors-forum/1040858/faq-66ak2e05-how-to-generate-the-ccs-pdk-examples-for-k2e?tisearch=e2e-sitesearch&keymatch=66AK2E05#).

    Now, Import the CCS project into CCS and go on

    1. To Import the project, Goto File -> Import -> "CCS projects" in "C/C++" -> Browse "Select Search-directory". make sure to uncheck the "Copy Projects into Workspace" (This is to avoid compilation errors only If TI-RTOS SDK was installed in a different location than "C:\ti\").

      1. we have the following DSP example projects

        1. UART_BasicExample_K2E_c66xDMATestProject,

        2. UART_BasicExample_K2E_c66xExampleProject,

        3. UART_BasicExample_K2E_c66xTestProject.

      2. we have the following ARM example projects

        1. UART_BasicExample_K2E_armDMATestProject,

        2. UART_BasicExample_K2E_armExampleProject,

        3. UART_BasicExample_K2E_armTestProject.

      3. Do not open ARM and DSP examples at the same time, CCS will throw the project out-of-sync error dialog.

      4. In this FAQ, "UART_BasicExample_K2E_c66xExampleProject" is explained here.

    2. For Hardware connections,

      1. we can connect through the RS232Serial cable(with 4 PIN header) received along with EVM to COM1 (mentioned in EVM) and through Mini USB connecting through J1 (Other mini USB port (J3) used by Onboard Debug Emulator).

      2. There will be two mini USB ports available for UART in the "Device Manager" section in "Windows OS" (CP2105 chipset, refer to device manager image for reference)

        1. The Port with the lowest number is the UART port.

        2. The Port with the highest number is BMC port.

      3. UART configuration used in these projects were "8N1"(Data Bit = 8, Parity = None and Stop bit = 1) and baud rate "115200".

      4. EVM should be kept in "No Boot" mode and the switch settings are shown below.

      5. Video demo

        1. DSP 

        2. ARM 

      6. Kindly refer to these board documents for detailed hardware information on the K2E EVM,

        1. EVMK2E Quick setup guide EVMK2E_QuickSetupGuide.pdf

        2. EVMK2E technical reference guide 2335.EVMK2E_Technical_Reference_Manual.pdf

        3. EVMK2E Schematics 2364.K2E_EVM_SCH_16_00175_03.pdf

    3. For Connecting K2E EVM with CCS, Kindly refer to these links.

      1. https://e2e.ti.com/support/processors-group/processors/f/processors-forum/1062598/faq-tms320c6678-how-to-load-and-run-the-gel-file-on-c6678-evm

      2. https://e2e.ti.com/support/processors-group/processors/f/processors-forum/1062584/faq-tms320c6678-how-to-create-target-configuration-and-do-test-connection-on-c6678-evm

    4. To build the project, Select the project and right-click to select "Rebuild the Project". Check for compilation errors and get the "Build finished successfully" message.  

    5. To run the project, Run the "K2E" target configuration and load the binary in the respective core. 

    6. Code explanation,

      1. Function: main ()

        //Declaration - Main thread function created as a task
        Task_Handle task;
        
        //Declaration - Error returned in the main thread will be reported to the error block
        Error_Block eb;
        
        //Initializes board UART parameters
        Board_initUART();
        
        //Initiate error block
        Error_init(&eb);
        
        //Main thread definition
        task = Task_create(uart_test, NULL, &eb);
        
        /* Start BIOS */
        BIOS_start();

      2. Function: uart_test()

        //Prints "str" in UART port
        UART_puts("str");
        
        //Stores string from UART port to "ptr" pointer up to a length of "len"
        UART_puts(ptr,len)

      3. For other UART driver definitions

        1. Driver APIs: "{TI_RTOS_K2E_INSTALLATION}/pdk_k2e_4_0_16/packages/ti/drv/uart/docs/doxygen/html/files.html"

        2. CSL APIs: "{TI_RTOS_K2E_INSTALLATION}/pdk_k2e_4_0_16/packages/ti/csl/docs/doxygen/html/group___c_s_l___u_a_r_t.html

      4. To view output use any of the Serial port terminals like "Putty", "Teraterm" or "Hercules HW".

    Thanks & regards,

    Rajarajan U