diff --git a/components/drivers/serial/serial_v2.c b/components/drivers/serial/serial_v2.c index d0d0f6f722..b1e5002d0c 100644 --- a/components/drivers/serial/serial_v2.c +++ b/components/drivers/serial/serial_v2.c @@ -897,6 +897,7 @@ static rt_err_t rt_serial_init(struct rt_device *dev) RT_ASSERT(dev != RT_NULL); serial = (struct rt_serial_device *)dev; + RT_ASSERT(serial->ops->transmit != RT_NULL); /* initialize rx/tx */ serial->serial_rx = RT_NULL;