Sama5d3ek Usart1 time out when baudrate larger than 115200.

Moderator: nferre

dapump0419
Posts: 2
Joined: Fri Mar 27, 2015 10:18 am

Sama5d3ek Usart1 time out when baudrate larger than 115200.

Fri Mar 15, 2019 12:43 pm

Dear Support team

I've question about the usart1 time out.
Kit Environment:
HW : Sama5d3ek MB, sama5d36 CM.
SW : Linux 3.18 / Linux 4.9 / Linux 4.14
Buildroot Linux4SAM 6.0

I'm porting TI wl18xx's BT and need communication via uart1.
The communication can support baudrate as 3M. So far can communication successful as 115200 only.
I've tried 3.18/4.9/4.14 and the fail rate was good in 3.18 , but still have 5% will failed.
And I need uart1 run on 3M but never sucess.
I saw the notify below in dts file:
usart1: serial@f0020000 {
dmas = <0>, <0>; /* Do not use DMA for usart1 */
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_usart1>;// &pinctrl_usart1_rts_cts>;
status = "okay";
};
It means can't run on 3M if cannot use DMA?
And I found the uart1 may not stable while communication , because sometimes communication was good sometimes not.
Target is run on 3M hopefully , but at least 460800. Because the period of communication was taking too long as 115200.
Please help to provide some suggest about this issue , thanks!
blue_z
Location: USA
Posts: 1830
Joined: Thu Apr 19, 2007 10:15 pm

Re: Sama5d3ek Usart1 time out when baudrate larger than 115200.

Fri Mar 15, 2019 11:27 pm

dapump0419 wrote: Dear Support team
No, that's at another web site, e.g. www.microchip.com/technical-support.
The AT91 website is fundamentally community oriented.

dapump0419 wrote: I've question about the usart1 time out.
...
I'm porting TI wl18xx's BT and need communication via uart1.
...
And I need uart1 run on 3M but never sucess.
...
usart1: serial@f0020000 {
...
And I found the uart1 may not stable while communication ,
What do you mean by "time out"?
What messages are displayed to indicate that "time out"s are occurring?
Expressions such as "5% will failed", "never sucess", "not stable while communication", "sometimes not", and "the period of communication was taking too long" are your conclusions rather than meaningful descriptions of symptoms.

Are you asking about USART1 or UART1?

dapump0419 wrote: Please help to provide some suggest about this issue , thanks!
You're not clear as to what "this issue" regarding a "time out" is.

The comment in the Device Tree is due to the limitation of only 8 active DMA channels available per DMA controller, even though the DMA controller has 16 interfaces.
The default Device Trees for the SAMA5D3x-EK boards use the eight DMA channels of DMAC0 for peripherals other than USART1.
FYI USART1 and UART1 use different DMA controllers.
If you deallocate some DMA channels used by other peripheral(s) on that same DMA controller, then you should be able to assign/use DMA with U[S]ART1.


Regards
dapump0419
Posts: 2
Joined: Fri Mar 27, 2015 10:18 am

Re: Sama5d3ek Usart1 time out when baudrate larger than 115200.

Mon Mar 18, 2019 8:04 am

Hi

Thanks for the reply and sorry not providing clear information about time about issue.
The complete log for time out after command "hciattach -s 115200 /dev/ttyS5 texas [baudrate] [flow control]"as below.
#Combination of [baudrate] [flow control] : 115200/noflow , 460800/noflow , 921600/noflow.
Bluetooth: hci0 command 0x1003 tx timeout
Bluetooth: hci0 command 0x1001 tx timeout
Bluetooth: Unknown HCI packet type 00
Bluetooth: Unknown HCI packet type 00
Bluetooth: Unknown HCI packet type 78
Bluetooth: Unknown HCI packet type 00
Bluetooth: hci0 command 0x1009 tx timeout
Initialization timed out.

I've used uart0 today and can run on 115200 only , but not success every time.
Basically , my case use usart1. Need to run as 3M, 460800/921600 at least.
My understanding : 3M need DMA configuration? 460800/921600 don't ? am I right?
Which linux version suggest in my case(EK)?
I've saw the git log about fix u(s)art in 4.9 and 4.14 , but the result was not good than 3.18.

Pleas let me know if not clear.
Thanks a lot!
blue_z
Location: USA
Posts: 1830
Joined: Thu Apr 19, 2007 10:15 pm

Re: Sama5d3ek Usart1 time out when baudrate larger than 115200.

Tue Mar 19, 2019 11:07 pm

dapump0419 wrote: The complete log for time out after command "hciattach -s 115200 /dev/ttyS5 texas [baudrate] [flow control]"as below.
No, that is not "complete" because there is no context, i.e. what happens prior to these messages?

Looks like you're asking XY questions regarding DMA (for which I've already provided a solution).
A "tx timeout" is a rather unusual condition, and a Google search turns up a possible solution.
See this q&a.
Some RPi users also report "timeout" problems when trying to use baudrates greater than 115200.
You may have to debug the Bluetooth code to determine exactly what (USART) operations cause a "tx timeout".

Regards

Return to “SAMA5-based”

Who is online

Users browsing this forum: Google [Bot] and 1 guest