CANopenNode / CanOpenSTM32

CANopenNode on STM32 microcontrollers.
Other
275 stars 110 forks source link

How to enable (so that they work) interrupts on tx and rx #63

Closed Chernobrovka closed 4 months ago

Chernobrovka commented 4 months ago

void HAL_CAN_RxFifo0MsgPendingCallback(CAN_HandleTypeDef hcan); void HAL_CAN_RxFifo1MsgPendingCallback(CAN_HandleTypeDef hcan); void CO_CANinterrupt_TX(CO_CANmodule_t* CANmodule, uint32_t MailboxNumber);

How to enable these interrupts (The interrupt flags themselves are enabled in Cube MX). Callbacks don't work. (I check using another CAN open device). Thank you in advance.

HamedJafarzadeh commented 4 months ago

They are used in Driver file, have you checked those ? You can set a breakpoint there and see if it is firing correctly. If yes, then you can change and move those callbacks to match your need.

Chernobrovka commented 4 months ago

They are used in Driver file, have you checked those ? You can set a breakpoint there and see if it is firing correctly. If yes, then you can change and move those callbacks to match your need. Yes, this functions located on CO_driver_STM32.c file and I set breakpoints, but these functions are not called in the program. What could be the problem?

HamedJafarzadeh commented 4 months ago

They are Interrupt handlers and they will be called by hardware.

Hardware call the CAN Interrupt Handler and that handler calls STM32 HAL function to handle the interrupt, and HAL handler call those functions.