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.

CCS/PROCESSOR-SDK-AM437X: UART DMA in TI-RTOS

Part Number: PROCESSOR-SDK-AM437X
Other Parts Discussed in Thread: TEST, SYSBIOS

Tool/software: Code Composer Studio

I researched the source code of the TI RTOS Uart driver, and found that the UART_DMA_ENABLE is invalid. if I want to use the DMA Rx/Tx for Uart driver, where I should set the compilation options, and how to compile the code?

  • Hi zhangbin,

    Please see this E2E thread on a similar topic: e2e.ti.com/.../850434.

    Looking through the UART LLD directory in PRSDK 6.1.0.8, I see DMA mode is only supported for UART_BasicExample_dma_evmAM437x_armTestProject.

    $ cd /r/pdk_am437x_1_0_16/packages/ti/drv/uart

    $ grep -rI -n -i --regexp="useDma" --include "*.cfg" | grep am43 
    test/am437x/armv7/bios/am437x_app_dma_evmam437x.cfg:173:UartPackage.Settings.useDma = "true";

    $ grep -rI -n -i --regexp="am437x_app_dma_evmam437x.cfg" --include "*.txt"
    test/am437x/armv7/bios/UART_BasicExample_dma_evmAM437x_armTestProject.txt:7:-ccs.linkFile "PDK_INSTALL_PATH/ti/drv/uart/test/am437x/armv7/bios/am437x_app_dma_evmam437x.cfg"

    To see what changes are required for DMA mode, compare these files:

    1. am437x_app_evmam437x.cfg (CPU mode) vs. am437x_app_dma_evmam437x.cfg (DMA mode): SYSBIOS configuration files
    2. UART_BasicExample_evmAM437x_armTestProject.txt (CPU mode) vs. UART_BasicExample_dma_evmAM437x_armTestProject.txt (DMA mode): project files used create CCS projects using pdkProjectCreate script.

    To create a DMA-mode project for another platform (e.g. idkAM437x):

    1. Create a new DMA-mode .cfg file & project .txt file, e.g. am437x_app_idkam437x.cfg & UART_BasicExample_dma_idkAM437x_armTestProject.txt.
    2. Copy changes discovered in above file comparisons to newly created files. Note some changes will not be exactly the same and will required additional modification for the new platform e.g. the compiler pre-defined symbol -DevmAM437x vs. -DidkAM437x.

    Please let me know if this answers your question.

    Regards,
    Frank

  • Hi Frank,

    I think that only changing .cfg cannot get the  DMA enabled, because that the UART API with a compiler switch UART_DMA_ENABLE off is complied independently by gmake.

    I am now using pdk_am437x_1_0_10. 

    and I had notice that the last new SDK : pdk_am437x_1_0_16 have a completely different implementation of the underlying driver. 

    Do I need to migrate the code to this latest version?

  • zhangbin,

    I would use the pdkProjectCreate script to create the CCS test/example projects for AM473x UART LLD. This is described here: software-dl.ti.com/.../index_overview.html

    You need to change the .txt file the pdkProjectCreate script uses to generate the CCS project file, e.g. compare UART_BasicExample_evmAM437x_armTestProject.txt (CPU mode) vs. UART_BasicExample_dma_evmAM437x_armTestProject.txt (DMA mode).

    I've attached an .html file showing the differences between these two files. Notice "-DUART_DMA_ENABLE" is included in the pre-defined symbols for the DMA mode project.

    Regards,
    Frank

    Report.html
    <html><head>
    <META http-equiv="Content-Type" content="text/html; charset=windows-1252">
    <style>
    /* Default heading font (outside of tables) */
    body { font-family: sans-serif; font-size: 11pt; }
    
    td { vertical-align: top; padding-left: 4px; padding-right: 4px; }
    
    /* File Difference Report styles - Color */
    table.fc { border-top: 1px solid Black; border-left: 1px solid Black; width: 100%; font-family: monospace; font-size: 10pt; }
    
    tr.secBegin td { border-left: none; border-top: none; border-right: 1px solid Black; }
    tr.secMiddle td { border-left: none; border-top: none; border-right: 1px solid Black; }
    tr.secEnd td { border-left: none; border-top: none; border-bottom: 1px solid Black; border-right: 1px solid Black; }
    tr.secAll td { border-left: none; border-top: none; border-bottom: 1px solid Black; border-right: 1px solid Black; }
    tr.secSubEnd td { border-left: none; border-top: none; border-bottom: 1px solid Gray; border-right: 1px solid Black; }
    tr.secSubAll td { border-left: none; border-top: none; border-bottom: 1px solid Gray; border-right: 1px solid Black; }
    tr.secGap td { font-size: 4px; border-left: none; border-top: none; border-bottom: 1px solid Black; border-right: 1px solid Black; }
    
    td.LineNum { text-align: right; }
    td.LineRange { font-family: sans-serif; }
    td.SubLineRange { font-family: sans-serif; border-bottom: none; }
    
    td.AlignLeft { text-align: left; }
    td.AlignRight { text-align: right; }
    td.AlignCenter { text-align: center; }
    td.Caption { text-align: left; background-color: #E7E7E7; padding-top: 8px; }
    
    td.Normal { }
    td.HasSimilar { background-color: #F0F0FF; }
    td.HasMismatch { background-color: #FFF0F0; }
    td.HasOrphan { background-color: #FFF0F0; }
    td.Added { background-color: #FFF0F0; }
    td.Deleted { background-color: #FFF0F0; text-decoration: line-through; }
    td.UAdded { background-color: #F0F0FF; }
    td.UDeleted { background-color: #F0F0FF; text-decoration: line-through; }
    
    .ttSigDiff { color: #FF0000; }
    .ttInsigDiff { color: #0000FF; }
    .ttAdded { color: #FF0000; }
    .ttDeleted { text-decoration: line-through; }
    
    /* Directory Comparison Report styles - Color */
    table.dc { border-top: 1px solid Black; border-left: 1px solid Black; width: 100%; font-family: sans-serif; font-size: 10pt; }
    
    table.dc tr.secBegin td { border-bottom: 1px solid Silver; }
    table.dc tr.secMiddle td { border-bottom: 1px solid Silver; }
    
    .ttNewer { color: #FF0000; }
    .ttOlder { color: #808080; }
    .ttOrphan { color: #0000FF; }
    .ttGhosted { color: #008080; }
    </style>
    </head><body>
    FILE COMPARISON<br />
    Produced: 11/15/2019 10:17:47 AM<br />
    &nbsp; &nbsp;
    <br />
    Mode:&nbsp; All Lines &nbsp;
    <br />
    &nbsp; &nbsp;
    <br />
    Left file: C:\ti_am437x_06_00_00_07\pdk_am437x_1_0_15\packages\ti\drv\uart\test\am437x\armv7\bios\UART_BasicExample_evmAM437x_armTestProject.txt &nbsp;
    <br />
    Right file: C:\ti_am437x_06_00_00_07\pdk_am437x_1_0_15\packages\ti\drv\uart\test\am437x\armv7\bios\UART_BasicExample_dma_evmAM437x_armTestProject.txt &nbsp;
    <br />
    <table class="fc" cellspacing="0" cellpadding="0">
    <tr class="secBegin">
    <td class="LineNum">&nbsp;</td>
    <td class="HasOrphan">&nbsp;</td>
    <td class="AlignCenter">-+</td>
    <td class="LineNum">1</td>
    <td class="HasOrphan"><span class="ttSigDiff">-ccs.linkFile &quot;PDK_INSTALL_PATH/ti/drv/uart/soc/am437x/sample_am437x_arm_int_reg.c&quot;</span></td>
    </tr>
    <tr class="secMiddle">
    <td class="LineNum">&nbsp;</td>
    <td class="HasOrphan">&nbsp;</td>
    <td class="AlignCenter">&nbsp;</td>
    <td class="LineNum">2</td>
    <td class="HasOrphan"><span class="ttSigDiff">-ccs.linkFile &quot;PDK_INSTALL_PATH/ti/drv/uart/soc/am437x/sample_am437x_cfg.c&quot;</span></td>
    </tr>
    <tr class="secMiddle">
    <td class="LineNum">&nbsp;</td>
    <td class="HasOrphan">&nbsp;</td>
    <td class="AlignCenter">&nbsp;</td>
    <td class="LineNum">3</td>
    <td class="HasOrphan"><span class="ttSigDiff">-ccs.linkFile &quot;PDK_INSTALL_PATH/ti/drv/uart/soc/am437x/sample_arm_cs.c&quot;</span></td>
    </tr>
    <tr class="secEnd">
    <td class="LineNum">&nbsp;</td>
    <td class="HasOrphan">&nbsp;</td>
    <td class="AlignCenter">&nbsp;</td>
    <td class="LineNum">4</td>
    <td class="HasOrphan"><span class="ttSigDiff">-ccs.linkFile &quot;PDK_INSTALL_PATH/ti/drv/uart/soc/am437x/sample_arm_init.c&quot;</span></td>
    </tr>
    <tr class="secBegin">
    <td class="LineNum">1</td>
    <td class="Normal">-ccs.linkFile &quot;PDK_INSTALL_PATH/ti/drv/uart/soc/am437x/UART_soc.c&quot;</td>
    <td class="AlignCenter">=</td>
    <td class="LineNum">5</td>
    <td class="Normal">-ccs.linkFile &quot;PDK_INSTALL_PATH/ti/drv/uart/soc/am437x/UART_soc.c&quot;</td>
    </tr>
    <tr class="secEnd">
    <td class="LineNum">2</td>
    <td class="Normal">-ccs.linkFile &quot;PDK_INSTALL_PATH/ti/drv/uart/test/src/main_uart_test.c&quot;</td>
    <td class="AlignCenter">&nbsp;</td>
    <td class="LineNum">6</td>
    <td class="Normal">-ccs.linkFile &quot;PDK_INSTALL_PATH/ti/drv/uart/test/src/main_uart_test.c&quot;</td>
    </tr>
    <tr class="secBegin">
    <td class="LineNum">3</td>
    <td class="HasMismatch">-ccs.linkFile &quot;PDK_INSTALL_PATH/ti/drv/uart/test/am437x/armv7/bios/am437x_app_evmam437x.cfg&quot;</td>
    <td class="AlignCenter">&lt;&gt;</td>
    <td class="LineNum">7</td>
    <td class="HasMismatch">-ccs.linkFile &quot;PDK_INSTALL_PATH/ti/drv/uart/test/am437x/armv7/bios/am437x_app_<span class="ttSigDiff">dma_</span>evmam437x.cfg&quot;</td>
    </tr>
    <tr class="secEnd">
    <td class="LineNum">4</td>
    <td class="HasMismatch">-ccs.setCompilerOptions &quot;-c -mcpu=cortex-a9 -mtune=cortex-a9 -march=armv7-a -marm -mfloat-abi=hard&nbsp -DSOC_AM437X -DevmAM437x -DBUILDCFG_MOD_UART -g -gstrict-dwarf -gdwarf-3 -finstrument-functions -Wall -MMD -MP -I${PDK_INSTALL_PATH}/ti/drv/uart &quot;&nbsp; -rtsc.enableRtsc</td>
    <td class="AlignCenter">&nbsp;</td>
    <td class="LineNum">8</td>
    <td class="HasMismatch">-ccs.setCompilerOptions &quot;-c -mcpu=cortex-a9 -mtune=cortex-a9 -march=armv7-a -marm -mfloat-abi=hard <span class="ttSigDiff">-DUART_V1</span> -DSOC_AM437X -DevmAM437x -DBUILDCFG_MOD_UART<span class="ttSigDiff"> -DUART_DMA_ENABLE</span> -g -gstrict-dwarf -gdwarf-3 -finstrument-functions -Wall -MMD -MP -I${PDK_INSTALL_PATH}/ti/drv/uart<span class="ttSigDiff"> -I${PDK_INSTALL_PATH} -I${EDMA3LLD_BIOS6_INSTALLDIR}/packages</span> &quot;&nbsp; -rtsc.enableRtsc</td>
    </tr>
    <tr class="secBegin">
    <td class="LineNum">5</td>
    <td class="Normal">-ccs.setLinkerOptions &quot; -lgcc -lrdimon -lm -lnosys -nostartfiles -static -Wl,--gc-sections &quot;</td>
    <td class="AlignCenter">=</td>
    <td class="LineNum">9</td>
    <td class="Normal">-ccs.setLinkerOptions &quot; -lgcc -lrdimon -lm -lnosys -nostartfiles -static -Wl,--gc-sections &quot;</td>
    </tr>
    <tr class="secEnd">
    <td class="LineNum">6</td>
    <td class="Normal">&nbsp;</td>
    <td class="AlignCenter">&nbsp;</td>
    <td class="LineNum">10</td>
    <td class="Normal">&nbsp;</td>
    </tr>
    </table>
    </body></html>
    

     

  • Hi Frank,

    I will update my sdk to 06.01.00.08, and try this.

    thank you very much.