背景 启动283后,打印的出错信息为 - <font size="2" style="font-weight: normal;">mxs-auart mxs-auart.0: Unhandled status 500400</font>
复制代码解决 mxs-auart.c中 注释以下程序 - if (plat->dir_set) {
- while(!((__raw_readl(s->port.membase + HW_UARTAPP_STAT) &
- BM_UARTAPP_STAT_TXFE)) ); //wait for the fifo is empty
- while((__raw_readl(s->port.membase + HW_UARTAPP_STAT) & BM_UARTAPP_STAT_BUSY));
- plat->dir_set(s->port.line,0);//1 output 0 input
- }
复制代码
可以用 #if 0 #endif 串口与RS485的程序是一样的,但是RS485没有用自动换向,有个方向GPIO, 这里不再等换向,串口可以使用。 延伸 485自动换向用起来很方便,而且可以少用一个GPIO,节省资源,程序也好写。
复用初始化一定要仔细核对。
|