imx93evk Zephyr RS485

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

imx93evk Zephyr RS485

216 次查看
zefox
Contributor II

Hi,

 

I have been working on this issue for 2 days now and I am not progressing anymore. I am trying to use OSDP in Zephyr through the control_panel example. I have provided my files in the zip I attached below. 

My wiring is as follows:

zefox_0-1759916096527.png

 

 


I have checked that the GPIO17 is indeed multiplexed correctly. This is correct.
I have tried using pull-down resistors (10K) on the DE&/RE pin. Didn't do anything.
I have tried sending test data directly using the serial driver in Zephyr. Didn't work.

I can tell it is sending correctly because my reader is correctly receiving a message. But the DE pin always stays high. This means it won't receive anything. Which is exactly what I am observing. 

I have had this issue with the STmicroelectronics UART driver as well where the hardware-controlled DE pin had the same issue. 

How do i fix this issue

标记 (4)
0 项奖励
回复
1 回复

169 次查看
zefox
Contributor II

i was able to fix this issue by implementing the following:

static void rs485_enable_runtime(void)
{
    const struct device *dev = DEVICE_DT_GET(DT_NODELABEL(lpuart3));
    struct uart_config cfg;

    if (!device_is_ready(dev)) {
        printk("lpuart3 not ready\n");
        return;
    }

    if (uart_config_get(dev, &cfg) == 0) {
        cfg.flow_ctrl = UART_CFG_FLOW_CTRL_RS485;  // RS-485 via DE/RTS
        if (uart_configure(dev, &cfg) != 0) {
            printk("uart_configure RS-485 failed\n");
        }
    }
}

 

The issue was caused by a bit not being set correctly in the A55 core's register. This, to me, points to an issue in the driver. 

 

标记 (2)
0 项奖励
回复