Raspberry Pi CAN blocks are designed to work with MCP2515 based CAN shields. For PiCAN2 shield however, the interrupt GPIO Pin is not saved correctly in the code from the model's Configuration Parameters. As a result, the interrupts triggered by the CAN shield are ignored.
To work around the issue, follow below steps:
1. Execute the following command at the MATLAB Command Prompt:
2. Update the file “MW_MCP2515_CAN.h” in the above directory with the following changes at line no 33. Replace
#define INTERRUPT_PIN 12
#define INTERRUPT_PIN (MW_CAN_INTERRUPTPIN)
3. Restart MATLAB.