cmsis_uart_edma_transfer demo baudrate

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

cmsis_uart_edma_transfer demo baudrate

582 Views
liamjm36
Contributor II

I have been trying to setup a UART connection over DMA based on the cmsis_uart_edma_transfer project on the FRDM-K22F development board. Using the demo project I can connect via UART and echo back characters in blocks of 8 as advertised. However if I change the baud rate from anything other than 115200 then the communication falls apart and I do not receive usable data. I am also changing the baud rate on the pc to match the new baud rate. 

in the example project the baud rate is set by the following line

/* Set baudrate. */
Driver_USART1.Control(ARM_USART_MODE_ASYNCHRONOUS,BOARD_DEBUG_UART_BAUDRATE);

However changing the definition of BOARD_DEBUG_UART_BAUDRATE from 115200 to 19200,9600 etc does not seem to work. Am I missing any settings?

I was able to successfully change the baudrate in other UART demo projects such as the freertos_uart one.

 

 

Update. I can change the baudrate by modifying line 407 of fsl_uart.c

config->baudRate_Bps = 115200U;

However in my final application I'm going to need 2 seperate UARTS at 19200 and 9600 baud, so this doesn't really solve my issue. 

Labels (1)
Tags (2)
0 Kudos
2 Replies

571 Views
bobpaddock
Senior Contributor III

"However changing the definition of BOARD_DEBUG_UART_BAUDRATE from 115200 to 19200,9600 etc does not seem to work. Am I missing any settings?"

I can not speak to your specific case. 

However I have encountered #defines that never actually get used.
Just because it exists doesn't mean it is useful.

Also is USART1 in fact the DEBUG USART?
That would also explain why changing the DEBUG baud would have no effect.

"Driver_USART1.Control(...

"config->baudRate_Bps = 115200U;

However in my final application I'm going to need 2 separate UARTS at 19200 and 9600 baud, so this doesn't really solve my issue. "

Presumably there will be Driver_USART1.Control() and Driver_USART2.Control() that gets config pointing to the correct USART.

0 Kudos

565 Views
liamjm36
Contributor II

/* Set baudrate. */
Driver_USART1.Control(ARM_USART_MODE_ASYNCHRONOUS,BOARD_DEBUG_UART_BAUDRATE);

Is the line in the SDK example that if the comment is correct should set the baudrate. BOARD_DEBUG_UART_BAUDRATE is just a definition name, as far as I'm aware it is only used in this line. I wanted to change the definition just in case it was used in another file. hardcoding to 

Driver_USART1.Control(ARM_USART_MODE_ASYNCHRONOUS,9600);

etc also does not work. 

I got it working by changing the default config in the uart driver file. This is the default config used by all UARTs and should not be the correct way to configure the baudrate. 

0 Kudos