enum declaration errors trying to compile a CAN app using stm32f4xx_hal_can.c
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2019-04-15 3:15 PM
I'm building a CAN app with STM32CUBEMX and TrueStudio. I'm using interrupts so need to register my calback funcs. I put #define USE_HAL_CAN_REGISTER_CALLBACKS 1 at the top of main.h. The following line in my code:
HAL_CAN_RegisterCallback(&hcan1, HAL_CAN_RX_FIFO0_MSG_PENDING_CB_ID, HAL_CAN_RxFIFO0MsgPendingCallback );
is producing the error "HAL_CAN_RX_FIFO0_MSG_PENDING_CB_ID undeclared". But it is a value of the enum type HAL_CAN_CallbackIDTypeDef which is declared in stm32f4xx_hal_can.h which is included in main.h. I'm stumped.
Solved! Go to Solution.
- Labels:
-
CAN
-
STM32Cube MCU Packages
-
STM32F4 Series
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2019-04-15 4:05 PM
The normal model here is to not explicitly include that file, but rather the top level HAL include file, and enable the sub-level one via #define in the stm32blah_hal_conf.h file​
Up vote any posts that you find helpful, it shows what's working..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2019-04-15 4:05 PM
The normal model here is to not explicitly include that file, but rather the top level HAL include file, and enable the sub-level one via #define in the stm32blah_hal_conf.h file​
Up vote any posts that you find helpful, it shows what's working..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2019-04-15 5:34 PM
That worked, thanks. I was following instructions in stm32f4xx_hal_can.c which said I had to do all this register callbacks rigamarole. I took that all out and I'm at least compiling. Will test tomorrow.
