FAQ: UART Device Driver API adi_uart_SetBaudRate returns failure code

Document created by CraigG on Sep 10, 2014
Version 1Show Document
  • View in full screen mode

Question

When using the UART Device Driver, I am able to open the device and configure settings through the Driver API, but when the adi_uart_SetBaudRate() API is called, it returns an error. What causes this?

 

===================================

 

Answer

When the adi_uart_SetBaudRate() API is called it uses the System Clock and Clock Divide values to calculate the UART timing to honour the requested Baud Rate.

 

For this to work, the Power Management Service must be initialized through a call to adi_pwr_Init() prior to calling the adi_uart_SetBaudRate() function.

 

If the Power Management Service has not been initialized the driver may return an ADI_UART_FAILURE (0x1), or the specific ADI_UART_SYSCLK_FAILED (0xD - BF60x and BF70x only) value.

Attachments

    Outcomes