CAN2 RX fix#9
Draft
LelsersLasers wants to merge 3 commits intomainfrom
Draft
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Enables and initializes CAN1 so that CAN2 (bxCAN “slave” instance on STM32F4) can reliably receive messages by ensuring the master CAN peripheral is also brought up.
Changes:
- Added CAN1 MSP init/deinit handling and reference-counted CAN1 clock enabling alongside CAN2.
- Added CAN1 handle, init function, and startup sequence in
main.cprior to starting CAN2. - Updated CubeMX
.iocto enable CAN1 peripheral and assign PD0/PD1 for CAN1.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
AutonomousDistroBoard/Core/Src/stm32f4xx_hal_msp.c |
Adds CAN1 MSP init/deinit (GPIO + clock refcount) so CAN1 can be enabled alongside CAN2. |
AutonomousDistroBoard/Core/Src/main.c |
Introduces hcan1, initializes/starts CAN1 before CAN2. |
AutonomousDistroBoard/AutonomousDistroBoard.ioc |
Enables CAN1 in CubeMX config and assigns CAN1 pins. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
And not touching any of the params
e48bcbc to
c8bfa5c
Compare
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.
CAN2 is a slave of CAN1, so RX has to be "routed through" CAN1. Solution: even though we don't use CAN1, enable it and start it.