Is it possible for MX to set USE_HAL_ADC_REGISTER_CALLBACKS?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-04-22 5:01 PM
I need to use the ADC ISR to set a FreeRTOS semaphore. It seems that hadc1.ConvCpltCallback is the perfect feature to do this except it's not enabled unless USE_HAL_ADC_REGISTER_CALLBACKS is set. For the life of me I can't figure out how to make MX set this flag. Is it possible?
Solved! Go to Solution.
- Labels:
-
ADC
-
STM32CubeMX
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-04-23 1:18 PM
Here's an excerpt for some callback setups in MX from some of our internal project documentation.
1) USE_HAL_TIM_REGISTER_CALLBACKS
set the register callback manually in CubeMx via
Project Manager -> Advanced Settings -> Register Callbacks (far right-hand side).
There you can enable/disable register callbacks for each peripheral individually.
ref: https://community.st.com/s/question/0D50X0000ArRvt6/stmcubeide-usehalregistercallbacks-definition
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-04-22 6:25 PM
You can also use the global callbacks. Please read the ADC driver source to find names of these global callbacks (they are defined as empty "weak" functions in the HAL driver and you override them by providing your own). Or browse examples in the Cube package.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-04-22 6:48 PM
Thanks, that is a workaround. I could also place custom code in the USER CODE BEGIN ADC_IRQn sections. It is pretty annoying to go through the trouble of keeping my project up-to-date with MX, however, just to find something at the end that isn't supported by the tool.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-04-23 1:18 PM
Here's an excerpt for some callback setups in MX from some of our internal project documentation.
1) USE_HAL_TIM_REGISTER_CALLBACKS
set the register callback manually in CubeMx via
Project Manager -> Advanced Settings -> Register Callbacks (far right-hand side).
There you can enable/disable register callbacks for each peripheral individually.
ref: https://community.st.com/s/question/0D50X0000ArRvt6/stmcubeide-usehalregistercallbacks-definition
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-04-23 2:34 PM
You shouldn't compress screenshots to the lossy JPEG, but always use the lossless PNG. Not only PNG will not damage the picture, but will typically be even smaller than JPEG.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-04-26 7:00 AM
Thank you for pointing me to this!
