AnsweredAssumed Answered

Unable to change baud in STDIO Sys Serv

Question asked by Scotr59 on Sep 27, 2011
Latest reply on Sep 30, 2011 by mmurali

Hi,

I am working on a VDK app that uses the new System Services STDIO service.  I need to change from the default rate of 57600 to 9600, issue a command to the attached device and then switch back to the 57600 default.

 

 

Here's the code which is located in a VDK boot thread:

 

 

/* STDIO UART Device handle */
extern ADI_STDIO_DEVICE_HANDLE hSTDIOUART;
adi_dma_SetMapping(ADI_DMA_PMAP_UART2_RX, ADI_DMA_DMA18);          
adi_dma_SetMapping(ADI_DMA_PMAP_UART2_TX, ADI_DMA_DMA19);
/*
** Initialize STDIO Service
*/
Result = adi_stdio_Init(
     adi_dev_ManagerHandle,     /* Device Manager Handle */
     adi_dma_ManagerHandle,     /* DMA Manager Handle */
     adi_dcb_QueueHandle,     /* DCB Manager Handle */
     &hSTDIOUART                /* Pointer to UART STDIO Device handle */
);
/*
** Register the UART Device Type
*/
adi_stdio_RegisterUART();
     
/*
** Open the UART Device Type
*/
Result = adi_stdio_OpenDevice(
     ADI_STDIO_DEVICE_TYPE_UART, /* UART Device Type */
     2,           /* Physical Device number */
     &hSTDIOUART                     /* Pointer to the handle */
);
     
/*
** Disable character echo on the UART Device
*/
Result = adi_stdio_ControlDevice(
     hSTDIOUART,
     ADI_STDIO_COMMAND_ENABLE_CHAR_ECHO, (void *) false /* false to disable */
);
/*
** CR + LF (carriage return and line feed) is used as EOL
*/
Result = adi_stdio_ControlDevice(
     hSTDIOUART,
     ADI_STDIO_COMMAND_ENABLE_UNIX_MODE, (void *) false /* false to disable */
);
Result = adi_stdio_RedirectStream (
     hSTDIOUART,
     ADI_STDIO_STREAM_STDIN
);
Result = adi_stdio_RedirectStream (
     hSTDIOUART,
     ADI_STDIO_STREAM_STDOUT
);
/*
** Set STDIO Baud Rate to 9600
*/
Result = adi_stdio_ControlDevice(
     hSTDIOUART,
     ADI_STDIO_COMMAND_SET_UART_BAUD_RATE, (void *) 9600
);
after the command to set the baud rate STDIO is unresponsive.
Thanks for any guidance.
Scot

Outcomes