Hi
@henrique.tx meant latest 2.8.7, not 2.8.6.
What is your CAN message rate and CPU usage when you observe overrun?
Please verify UART DMA is enabled.
VF61 is capable to handle full 1Mbps bus of extended ID messages, ~9k+ msgs/s along with RS232, USB and Ethernet comms.
This certainly shouldn’t matter. It is for whole net/core, not just for CAN. Default 176kB setting seems big enough for big rate of tiny struct canmsg’s, though perhaps it is flooded with some extra data, I don’t know.
That’s quite default way to handle every receive stream for most of apps. If you meant using no threads and select() instead, then you shouldn’t wonder about poor performance. You need to use blocking calls and thus unavoidable dedicated receive thread.
Using several executables for CAN is another bad idea. Instead of wasting CPU power on frequent task switches for single app, it will loose more CPU time for several apps. Instead you may send less but perhaps bigger messages from some message dispatcher to other apps using some kind of IPC.
These lines in flexcan driver seem never changing.
/* 8 for RX fifo and 2 error handling */
#define FLEXCAN_NAPI_WEIGHT (8 + 2)
If one NAPI iteration wouldn’t be interruptible, then this setting would be OK for 8 messages long Rx FIFO. I think NAPI indeed is interruptible and on heavy load may lead to unnecessary task switches.
/* handle RX-FIFO */
reg_iflag1 = flexcan_read(®s->iflag1);
while (reg_iflag1 & FLEXCAN_IFLAG_RX_FIFO_AVAILABLE &&
work_done < quota) {
// what if task is switched here? Delayed continue
// due to high CPU %
// may lead to RX FIFO (nearly) full again, but quota
// too small to read FIFO without reschedule
work_done += flexcan_read_frame(dev);
reg_iflag1 = flexcan_read(®s->iflag1);
}
I haven’t try to increase that setting myself, a fresh idea, I’ll try it later.
Edit: FlexCAN driver in more fresh kernels defines FLEXCAN_QUIRK_USE_RX_MAILBOX
for vf610 and many other families, so uses dedicated MB’s instead of FIFO and isn’t using FLEXCAN_NAPI_WEIGHT setting on vf610. FlexCAN FIFO is quite short, “up to 6 frames” instead of 8 claimed by driver, but still you may try double or triple that setting in your old kernel from BSP 2.8.x.
Regarding of what VF61 is capable, I meant using more fresh kernel with above mentioned quirk. For curiosity I may retest it against kernel from BSP 2.8.x, but not now.
Regards
Edward