Skip to content
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

STM32H7 : add CAN support #9354

Merged
merged 2 commits into from
Jan 24, 2019
Merged

STM32H7 : add CAN support #9354

merged 2 commits into from
Jan 24, 2019

Conversation

jeromecoutant
Copy link
Collaborator

Description

STM32H7 family is supporting now CAN FD feature.

So previous CAN implementation for other STM32 families is not compatible.

This patch is enabling CAN for NUCLEO_H743ZI

Tested manually as there is no CAN mbed-os test.

Thx

Pull request type

[ ] Fix
[ ] Refactor
[x] Target update
[ ] Functionality change
[ ] Docs update
[ ] Test update
[ ] Breaking change

@ciarmcom ciarmcom requested a review from a team January 11, 2019 13:15
@ciarmcom
Copy link
Member

@jeromecoutant, thank you for your changes.
@ARMmbed/mbed-os-maintainers please review.

TxHeader.MessageMarker = 0;

if (HAL_FDCAN_AddMessageToTxFifoQ(&obj->CanHandle, &TxHeader, msg.data) != HAL_OK) {
// printf("*** can_write error %x\n", HAL_FDCAN_GetError(&obj->CanHandle));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you remove this line?


FDCAN_RxHeaderTypeDef RxHeader = {0};
if (HAL_FDCAN_GetRxMessage(&obj->CanHandle, FDCAN_RX_FIFO0, &RxHeader, msg->data) != HAL_OK) {
error("HAL_FDCAN_GetRxMessage error\n");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should it used mbed_error?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

HAL_FDCAN_GetRxMessage should not return 0 after that HAL_FDCAN_GetRxFifoFillLevel has returned something.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am just wondering if we should use mbed_error that can contain more information rather than older error function (will print unknown error).

@SenRamakri Can you review this, we still use error in targets implementation?

}


// TODO Add other interrupts ?
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what other interrupts?

@0xc0170
Copy link
Contributor

0xc0170 commented Jan 23, 2019

CI started

@mbed-ci
Copy link

mbed-ci commented Jan 23, 2019

Test run: SUCCESS

Summary: 12 of 12 test jobs passed
Build number : 1
Build artifacts

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants