Skip to content

[Feature] serial_v2的驱动需要更快的TC判断函数 #11462

@FlyyingPiggy2020

Description

@FlyyingPiggy2020

Describe problem solved by the proposed feature

芯片stm32g0b1rct6,主频64Mhz,MDK编译,AC6,优化登记-O1。
使用serial_v2使用阻塞发送的方式驱动rs485,de pin由软件处理。

通过rt_device_set_tx_complete注册回调函数,在这个函数里操作DE PIN。会导致操作不及时丢失起始帧,传输数据解析错误。
直接在uart_isr__HAL_UART_DISABLE_IT(&(uart->handle), UART_IT_TC);处操作DE PIN数据正常。

由于板卡外壳已经封胶,暂时没有办法用示波器查看到底差了多少。

有没有可以通过阅读代码的方式,判断两种回调方式的时钟到底差了多少。。为啥会导致这个结果。
路径一:uart_isr直接拉低
路径二:uart_isr通过rt_hw_serial_isr(serial, RT_SERIAL_EVENT_TX_DONE);里面再处理,最后进入到rt_device_set_tx_complete注册的回调函数里。

Describe your preferred solution

No response

Describe possible alternatives

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions