Utilisation de 2 UARTs simultanément sur DSP

Electronique numérique / Circuits logiques programmables EPLD, CPLD, FPGA d'Altera ou de Xilinx VHDL, Verilog ou SystemC

Modérateur : Modérateur

Olivier

Utilisation de 2 UARTs simultanément sur DSP

Message par Olivier »

Hello,

I am working on a FleXDS evaluation board of the DSP TMSC5509A from FleXDS.
The board contains the three terminals McBSP's ports.
To communicate with Windows hyperterminal, I use the software UART minidriver
from the Texas Instrument DDK 1.20. The exemple of the Software UART provided in the DDK works well.
But, in my project, I want to use two McBSP's ports. To test both McBSP's ports I have changed
the exemple of the Software UART in the DDK.


I declare two UART handle in the file "uarttest_params.c":

Code : Tout sélectionner


UARTHW_MCBSP_Params uartMcbspParams = {
    MCBSP_PORT0,                // mcbspId      
    DMA_CHA2,                   // dmaRxId    
    DMA_CHA3,                   // dmaTxId     
    120000000,                  // mcbspClkIn  
    115200,                     // baud       
    {
            {
                    UARTHW_MCBSP_IER_MASK_DEFAULT,
                    UARTHW_MCBSP_IER_MASK_DEFAULT
            },
            {
                    UARTHW_MCBSP_IER_MASK_DEFAULT,
                    UARTHW_MCBSP_IER_MASK_DEFAULT
            }
    }
};

// This structure must be specified in the device driver's device params 
// pointer in the DSP/BIOS Configuration Tool.

UARTMD_DevParams uartDevParams = {
    UARTMD_VERSION_1,           // driver version number 
    FALSE,                      // packedChars  
    &uartMcbspParams            // uartHwParams 
};

// This structure holds the McBSP parameters and is referenced by the
// device parameters structure.
UARTHW_MCBSP_Params uartMcbspParams1 = {
    MCBSP_PORT1,                // mcbspId     
    DMA_CHA4,                   // dmaRxId     
    DMA_CHA5,                   // dmaTxId   
    120000000,                  // mcbspClkIn   
    115200,                     // baud         
    {
            {
                    UARTHW_MCBSP_IER_MASK_DEFAULT,
                    UARTHW_MCBSP_IER_MASK_DEFAULT
            },
            {
                    UARTHW_MCBSP_IER_MASK_DEFAULT,
                    UARTHW_MCBSP_IER_MASK_DEFAULT
            }
    }
};

// This structure must be specified in the device driver's device params 
// pointer in the DSP/BIOS Configuration Tool.
UARTMD_DevParams uartDevParams1 = {
    UARTMD_VERSION_1,           // driver version number
    FALSE,                     // packedChars  
    &uartMcbspParams1           //  uartHwParams 
};


I register both UARTs (I name it "uart" and "uart1") in the DSP/BIOS.

In the file "uarttest.c", I create input and output channels in the echo() task:

Code : Tout sélectionner


    GIO_Handle  inChan, outChan, inChan1, outChan1;
    Char        buf[12] = "Hello World ";
    Uns         size = 12;


    inChan = GIO_create("/uart", IOM_INPUT, NULL, NULL, NULL);
    outChan = GIO_create("/uart", IOM_OUTPUT, NULL, NULL, NULL);

    inChan1 = GIO_create("/uart1", IOM_INPUT, NULL, NULL, NULL);
    outChan1 = GIO_create("/uart1", IOM_OUTPUT, NULL, NULL, NULL);


When I run the program, inchan1 and outchan1 are NULL pointer, so the communication by the port MCBSP_PORT1 doesn't work.

Do tou have any solution to this problem?

In other words: Is-it possible to realise a multi device asynchronus communication with the McBSPs port? If yes how it can be done?


Thank you very much for your reply.


Olivier
Répondre