Open fortunerains opened 2 years ago
一般需要在open之前进行波特率配置,配置完了再open的。串口驱动开关中断是在control里面进行的,open的时候框架会根据你的flag进行开关中断操作。如果配置就提前开启中断可能会导致串口在没有open的时候就触发中断导致断言死机。
一般需要在open之前进行波特率配置,配置完了再open的。串口驱动开关中断是在control里面进行的,open的时候框架会根据你的flag进行开关中断操作。如果配置就提前开启中断可能会导致串口在没有open的时候就触发中断导致断言死机。
但是如果posix接口 通过ioctl这种操作就有点问题的。
但是如果posix接口 通过ioctl这种操作就有点问题的。
ioctl串口的这个问题4.1.1会解决
应用程序如果重新配置串口参数会调用 `static rt_err_t imxrt_configure(struct rt_serial_device serial, struct serial_configure cfg) { struct imxrt_uart *uart; lpuart_config_t config;
}`
但是调用后串口无法收到数据,需再次中断使能
LPUART_EnableInterrupts(uart->uart_base, kLPUART_RxDataRegFullInterruptEnable); NVIC_SetPriority(uart->irqn, NVIC_EncodePriority(NVIC_GetPriorityGrouping(), 4, 0)); EnableIRQ(uart->irqn);