-
Notifications
You must be signed in to change notification settings - Fork 6.9k
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
drivers: can: stm32: can_add_rx_filter() does not respect CONFIG_CAN_MAX_FILTER #44725
Comments
Should this issue be closed by the #44688 ? |
OK.
|
@FRASTM I think the issue you stated and the original issue described by @henrikbrixandersen cannot be related as the STM32G474 has the M_CAN IP, whereas this error is in the bxCAN driver for "older" STM32 MCUs. I've just been working on the bxCAN driver for #46646, so I can have a closer look at this issue after that PR was merged. |
@martinjaeger Do you still plan to take a closer look at this? |
Thanks for the reminder. I started working on it, but it turned out to be a bit more complicated than expected, so I couldn't find a fix immediately. Having another try now :) |
In order to reproduce the bug, I started with implementing the Now Click to expand log output for CONFIG_CAN_LOG_LEVEL_DBG=y
Digging deeper into the driver implementation I realized that there is no quick fix for this bug, as it requires a rework of significant parts of the driver. I opened a separate issue #47986 to discuss possible solutions. I would appreciate your feedback. |
Describe the bug
Calling
can_add_rx_filter()
on an STM32 bxCAN driver instance does not respectCONFIG_CAN_MAX_FILTER
setting.When setting
CONFIG_CAN_MAX_FILTER=5
the driver returns-ENOSPC
when attempting to add standard, unmasked CAN-ID filter number 5. On the other hand, it seems to allow for infinite number of extended, unmasked CAN-ID filters (which clearly overflows the internal arrays of the driver).Expected behavior
The driver should accept up to the number of configured filters and should not overflow internal arrays.
Environment (please complete the following information):
Additional context
This was found during implementation of #44687.
The text was updated successfully, but these errors were encountered: