Skip to content

CAN TxIRq callback never called -STM32G474 #14778

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

Merged
merged 1 commit into from
Jun 24, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion targets/TARGET_STM/can_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -612,7 +612,16 @@ void can_irq_set(can_t *obj, CanIrqType type, uint32_t enable)
}

if (enable) {
HAL_FDCAN_ActivateNotification(&obj->CanHandle, interrupts, 0);
/* The TXBTIE register controls the TX complete interrupt in FDCAN
* and is only used in case of TX interrupts, Hence in case of enabling the
* TX interrupts the bufferIndexes of TXBTIE are to be set */
#ifdef TARGET_STM32H7
// TXBTIE for STM32H7 is 2 bytes long
HAL_FDCAN_ActivateNotification(&obj->CanHandle, interrupts, 0xFFFF);
#else
//TXBTIE for rest supported FDCAN Platforms(STM32G0x1, STM32G4 and STM32L5) is 3 bits.
HAL_FDCAN_ActivateNotification(&obj->CanHandle, interrupts, 0x07);
#endif
} else {
HAL_FDCAN_DeactivateNotification(&obj->CanHandle, interrupts);
}
Expand Down