Hello,
I have a question about the IMX6 uart peripheral. I am creating a 9bit uart driver from scratch to implement the 9bit MDB (Multi drop bus) protocol used in many vending machines.
At this moment (I have the driver code attached) I am able to send 9 bit data (very rudimentary) with the scope I see data transmitting. I know using a sample program the uart should receive data (including 9th bit set), but currently my driver does not generates any interrupts, although it is correctly configured in my device tree, nor does the status register change or any data in the RX FIFO.
My driver is not yet using DMA, the very basics of my driver is attached.
Does anybody have an idea why my interrupt is not working or has its own custom 9 bit uart driver?
Device tree configuration:
dts:
&uart5 {
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_uart5>;
status = "okay";
};
dtsi:
uart5: serial@021f4000 {
compatible = "ptr,imx6ul-mdb";
reg = <0x021f4000 0x4000>;
interrupts = <GIC_SPI 30 IRQ_TYPE_LEVEL_HIGH>;
clocks = <&clks IMX6UL_CLK_UART5_IPG>,
<&clks IMX6UL_CLK_UART5_SERIAL>;
clock-names = "ipg", "per";
status = "disabled";
};
Thanks in advance.
Solved! Go to Solution.
Problem solved!
To all, If you encounter this problem, working TX no working RX, check bit 2 (RXDMUXSEL) in UCR3 register. This bit should be 1.
igorpadykov The initialization sequence for the 9 bit RS485 mode in the IMX6UL reference manual (page 3162 sec. 53.13.2) does not set UCR3 and the default value for bit 2 (RXDMUXSEL) for this register is 0. Perhaps this could be changed in the documentation.
Stephan
Problem solved!
To all, If you encounter this problem, working TX no working RX, check bit 2 (RXDMUXSEL) in UCR3 register. This bit should be 1.
igorpadykov The initialization sequence for the 9 bit RS485 mode in the IMX6UL reference manual (page 3162 sec. 53.13.2) does not set UCR3 and the default value for bit 2 (RXDMUXSEL) for this register is 0. Perhaps this could be changed in the documentation.
Stephan
Hi Stephan
one can try to add to compatible = "ptr,imx6ul-mdb"; strings as in
dts example linux/arch/arm/boot/dts/imx6ul.dtsi
imx6ul.dtsi\dts\boot\arm\arch - linux-imx - i.MX Linux kernel
imx.c\serial\tty\drivers - linux-imx - i.MX Linux kernel
Best regards
igor
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
The main problem is the RX on uart5 not receiving while we see the data on the scope.
What we have done:
So, we excluded hardware failures, verified if all uart registers were setup correctly, tx works, only rx not.
Perhaps interesting to know that we only use TX and RX no cts/rts etc.
Hi Stephan
one can try with linux nxp releases located on
Best regards
igor
Igor,
Currently we use the linux-imx kernel version:
Linux version 4.9.88-1.0.0+gafb47b59fd5c (oe-user@oe-host) (gcc version 7.3.0 (GCC) )