Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Interrupt based reads hang with high throughput writes #28

Open
alexbernardino opened this issue Nov 6, 2019 · 1 comment
Open

Interrupt based reads hang with high throughput writes #28

alexbernardino opened this issue Nov 6, 2019 · 1 comment

Comments

@alexbernardino
Copy link

If the delay in the loop of the example CAN_write is removed, the proposed interrupt based solution hangs after a few messages. Even a delay of 1 millisecond is not enough to prevent this behaviour. The polling based solution works in any case.

@alexbernardino alexbernardino changed the title Interrupt interrupt based reads hang in high throughput writes Interrupt based reads hang with high throughput writes Nov 6, 2019
@AndreaInverardi
Copy link

AndreaInverardi commented Aug 27, 2022

I've encountered the same problem, basically I invoke in the loop a function to check the controller state:

` uint8_t u8ErrorFlag = mcp2515.getErrorFlags();

if(u8ErrorFlag & MCP2515::EFLG_RX1OVR){
  Serial.println("CanShield error RX1OVR: receive buffer 1 overflow");
}

if(u8ErrorFlag & MCP2515::EFLG_RX0OVR){
  Serial.println("CanShield error RX0OVR: receive buffer 0 overflow");
}

if(u8ErrorFlag & MCP2515::EFLG_TXBO){
  Serial.println("CanShield error TXBO: bus off");
}

if(u8ErrorFlag & MCP2515::EFLG_TXEP){
  Serial.println("CanShield error TXEP: transmit error-passive");
}
    
if(u8ErrorFlag & MCP2515::EFLG_RXEP){
  Serial.println("CanShield error RXEP: receive error-passive");
}

if(u8ErrorFlag & MCP2515::EFLG_TXWAR){
  Serial.println("CanShield error TXWAR: transmit error warning");
}

if(u8ErrorFlag & MCP2515::EFLG_RXWAR){
  Serial.println("CanShield error RXWAR: receive error warning ");
}

if(u8ErrorFlag & MCP2515::EFLG_EWARN){
  Serial.println("CanShield error EWARN: error warning ");
}

`

In case of high throughput it result in rx buffer 0 overflow, then I reset the controller. It's a workaround, but it works. Anyone with a better solution?

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

No branches or pull requests

2 participants