Stuff Error on CAN-FD output channel
Posted: Mon 13. Dec 2021, 09:52
Hello
I am trying to make a gateway which takes in standard CAN (non-FD) on CAN1, manipulates selected signals and then transmits them as new messages on CAN-FD on CAN2.
I have previously successfully made some gateways like this but with standard CAN on both input and output (using standard PCAN-Routers).
However, while this time I followed the same process and had the same physical setup, but I'm getting errors on the output channel.
Working with CAN-FD (and PCAN-Router FD) is what is new for me, so maybe there is something obvious that I'm missing.
Through CANalyzer, I am sending simulated standard CAN input on CAN1 and just monitoring the gateway output on CAN2.
CAN1 is probably fine since it shows no errors in the Trace and LEDs are blinking, whose code depends on: CAN_UserRead (CAN_BUS1, &RxMsg) == CAN_ERR_OK
CAN2 shows a CAN FD stuff error (see attached pictures).
Here is what I tried so far for troubleshooting:
1) Checked that the baud rates and data rates are set as expected
- on the gateway code 'can_user.c', both channels are initialized with "_80M_500K_80____4M_80_ISO"
- in CANalyzer measurement setup, both channels are set to mode 'ISO CAN FD', baud rate '500.0 kBaud', data rate '4000.0 kBaud' (same as on code, right?)
2) checked all CAN terminations
- tried with 1x120ohm resistor on each channel (my usual setup for quick bench tests) --> 'CAN FD Error' msg with some data and a stuff error
- tried with 2x120ohm resistor on each channel (the 'proper' way) ---> same output error
- tried with no resistors --> 'CAN Error' message (no FD) with NO data and stuff error
- my thoughts: maybe the difference in errors is a clue but I'm not sure what to make of it. At least I know the terminations are making SOME difference... maybe the error is elsewhere
3) flashed the GW again but with the example code: 10_CAN_FD
- same or similar error as with my code
- my thoughts: it is maybe not my code which is causing the error, but something with the setup after all... back to doubting the setup from above point (1)
Any ideas are much appreciated.
- Ricardo
I am trying to make a gateway which takes in standard CAN (non-FD) on CAN1, manipulates selected signals and then transmits them as new messages on CAN-FD on CAN2.
I have previously successfully made some gateways like this but with standard CAN on both input and output (using standard PCAN-Routers).
However, while this time I followed the same process and had the same physical setup, but I'm getting errors on the output channel.
Working with CAN-FD (and PCAN-Router FD) is what is new for me, so maybe there is something obvious that I'm missing.
Through CANalyzer, I am sending simulated standard CAN input on CAN1 and just monitoring the gateway output on CAN2.
CAN1 is probably fine since it shows no errors in the Trace and LEDs are blinking, whose code depends on: CAN_UserRead (CAN_BUS1, &RxMsg) == CAN_ERR_OK
CAN2 shows a CAN FD stuff error (see attached pictures).
Here is what I tried so far for troubleshooting:
1) Checked that the baud rates and data rates are set as expected
- on the gateway code 'can_user.c', both channels are initialized with "_80M_500K_80____4M_80_ISO"
- in CANalyzer measurement setup, both channels are set to mode 'ISO CAN FD', baud rate '500.0 kBaud', data rate '4000.0 kBaud' (same as on code, right?)
2) checked all CAN terminations
- tried with 1x120ohm resistor on each channel (my usual setup for quick bench tests) --> 'CAN FD Error' msg with some data and a stuff error
- tried with 2x120ohm resistor on each channel (the 'proper' way) ---> same output error
- tried with no resistors --> 'CAN Error' message (no FD) with NO data and stuff error
- my thoughts: maybe the difference in errors is a clue but I'm not sure what to make of it. At least I know the terminations are making SOME difference... maybe the error is elsewhere
3) flashed the GW again but with the example code: 10_CAN_FD
- same or similar error as with my code
- my thoughts: it is maybe not my code which is causing the error, but something with the setup after all... back to doubting the setup from above point (1)
Any ideas are much appreciated.
- Ricardo