-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Conversation
@jeromecoutant, thank you for your changes. |
8eed91d
to
f4db13b
Compare
targets/TARGET_STM/can_api.c
Outdated
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)); |
There was a problem hiding this comment.
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?
targets/TARGET_STM/can_api.c
Outdated
|
||
FDCAN_RxHeaderTypeDef RxHeader = {0}; | ||
if (HAL_FDCAN_GetRxMessage(&obj->CanHandle, FDCAN_RX_FIFO0, &RxHeader, msg->data) != HAL_OK) { | ||
error("HAL_FDCAN_GetRxMessage error\n"); |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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?
targets/TARGET_STM/can_api.c
Outdated
} | ||
|
||
|
||
// TODO Add other interrupts ? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what other interrupts?
f4db13b
to
d0cdc34
Compare
CI started |
Test run: SUCCESSSummary: 12 of 12 test jobs passed |
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