{bp-19721} arch/arm: Fix FlexCAN config initializers clobbering rx_pin instead of enable_high - #19828
Merged
Merged
Conversation
The `rx_pin` configuration when `CONFIG_S32K1XX_FLEXCAN2` is defined is overwritten if `PIN_CAN2_ENABLE` is defined, breaking the flexcan config for S32K1 MCU. Additionally, the `.enable_high` configuration points to a non-defined constant/macro (looks like a legacy from the first driver definition). Based on regularly maintained drivers (such as s32k3), this was changed to `CAN2_ENABLE_OUT` Signed-off-by: Javier Alonso <javieralonso@geotab.com>
The `rx_pin` configuration when `CONFIG_KINETIS_FLEXCAN2` is defined is overwritten if `PIN_CAN2_ENABLE` is defined, breaking the flexcan config for Kinetis MCU. Additionally, the `.enable_high` configuration points to a non-defined constant/macro (looks like a legacy from the first driver definition). Based on regularly maintained drivers (such as s32k3), this was changed to `CAN2_ENABLE_OUT` Signed-off-by: Javier Alonso <javieralonso@geotab.com>
The `rx_pin` configuration when `CONFIG_S32K3XX_FLEXCAN2` is defined is overwritten if `PIN_CAN2_ENABLE` is defined, breaking the flexcan config for S32K3 MCU. Signed-off-by: Javier Alonso <javieralonso@geotab.com>
jerpelea
requested review from
acassis,
cederom,
linguini1 and
xiaoxiang781216
August 13, 2026 10:58
jerpelea
requested review from
btashton,
davids5 and
gustavonihei
as code owners
August 13, 2026 10:58
linguini1
approved these changes
Aug 13, 2026
linguini1
approved these changes
Aug 13, 2026
Contributor
Author
|
do not restart Ci until #19814 is merged |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The FlexCAN per-controller config initializers in three ARM drivers contain a
copy-paste defect: inside the CAN2 (and, on S32K3XX, CAN3) blocks a second
.rx_pin designator appears where .enable_high was intended. C designated
initializers let a later designator for the same member silently override an
earlier one, so .rx_pin = PIN_CANx_RX is discarded and .enable_high is
never assigned at all, falling back to 0 from static zero-initialization.
Impact
RELEASE
Testing
CI