Skip to content

Race condition in canTX() #13

Description

@spikyian

There is a race condition/timing window which can cause a frame needing to be transmitted to get stuck in the software transmit queue.
Given that the software FIFO queue is empty and a frame is currently being transmitted by the ECAN this condition is checked at line 69. Then canTX() adds the frame to the queue at line 385.
Normally the queue is checked in the TX interrupt routine at line 439 but if the previous frame finished being sent before the current frame is added to the queue then the TX ISR will do nothing and then when the current frame is added to the queue the interrupt has been missed.

Recommended solution is to temporarily disable the TX interrupt between lines 369 and 85 in canTX().

Discovered whilst testing similar code in VLCBlib_PIC.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions