Skip to content

Conversation

@Robert-Moba
Copy link

Fixed 2 bugs in the i210 driver causing all powerlink communication to stop.

Bug1:
The timer interrupt has 3 possible causes in the Powerlink driver (See i210 datasheet, chapter 8.16.1):

  • SYSTIM Warp around, this will happen every second.
  • Target Time 0 Trigger, during cyclic communication used to start the new cycle.
  • Target Time 1 Trigger, during cyclic communication used to start the new cycle.
    When ‘SYSTIM Warp around’ would occur at the same time as ‘Target Time 0/1 Trigger’, only ‘SYSTIM Warp around’ would be handled. The function would return, without handling the start of cycle. Without handling the start of cycle, all powerlink communication would stop.
    This is fixed by ignoring the SYSTIM Warp around flag. Note that only disabling the SYSTIM interrupt would not fix the issue, because the flag would still be set.

Bug2:
Another error found was caused by 2 interrupt handlers reading and clearing the same registers.
This register is called EDRV_INTR_READ_REG in the driver, and IRC in the datasheet (See i210 datasheet, chapter 8.8.9). A read is performed on this register in the function: edrvTimerInterrupt and the function: edrvIrqHandler. Since this register is ‘Clear on read’, both interrupt functions being called at the same time causes problems.
To solve this error, the ‘SYSTIM Warp around’ interrupt is disabled in the function: edrv_startTimer. Since this interrupt is unused, it can be safely disabled.
The timer interrupt giving the start of cycle, and RX/TX interrupts should never happen at the same time in a Powerlink network. This interrupts don't need to be fixed.

…tion to stop

Bug1:
The timer interrupt has 3 possible causes in the Powerlink driver (See i210 datasheet, chapter 8.16.1):
*	SYSTIM Warp around, this will happen every second.
*	Target Time 0 Trigger, during cyclic communication used to start the new cycle.
*	Target Time 1 Trigger, during cyclic communication used to start the new cycle.
When ‘SYSTIM Warp around’ would occur at the same time as ‘Target Time 0/1 Trigger’, only ‘SYSTIM Warp around’ would be handled. The function would return, without handling the start of cycle. Without handling the start of cycle, all powerlink communication would stop.
This is fixed by ignoring the SYSTIM Warp around flag. Note that only disabling the SYSTIM interrupt would not fix the issue, because the flag would still be set.

Bug2:
Another error found was caused by 2 interrupt handlers reading and clearing the same registers.
This register is called EDRV_INTR_READ_REG in the driver, and IRC in the datasheet (See i210 datasheet, chapter 8.8.9). A read is performed on this register in the function: edrvTimerInterrupt and the function: edrvIrqHandler. Since this register is ‘Clear on read’, both interrupt functions being called at the same time causes problems.
To solve this error, the ‘SYSTIM Warp around’ interrupt is disabled in the function: edrv_startTimer. Since this interrupt is unused, it can be safely disabled.
The timer interrupt giving the start of cycle, and RX/TX interrupts should never happen at the same time in a Powerlink network. This interrupts don't need to be fixed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant