Using STM32IDE, is there any way to enter preprocessor defines, as currently when regenerating code from the 'Device Configuration Tool', any defines entered manually for the project appear to be deleted?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-01-16 9:55 AM
I'm thinking in particular about defines to influence the HAL library code e.g. USE_HAL_TIM_REGISTER_CALLBACKS.
Adding user defines in MX just puts them in main.h and they are not seen by the library code.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-06-30 4:19 AM
There is an hacky ingenious but convoluted suggestion on how to set those defines here: https://community.st.com/s/question/0D50X0000ArRvt6/stmcubeide-usehalregistercallbacks-definition
It seems that CubeMX does not officially support enabling the USE_HAL_*_REGISTER_CALLBACKS options. Can anyone confirm this?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-06-30 4:30 AM
As HAL files are supposedly read-only and version volatile, I would look for a compiler option. Most decent SW tools provide in project settings the possibility to add global compiler options. This would probably be the way to activate/deactivate REGISTER_CALLBACKS (which to me seems defeating the interrupt routines to be snappy as it causes a switch/case execution). The other way (probably not allowed) would be to have a global user.h file included to all files (including ST source files) which enables same mechanism without being toolchain dependent. (the CMAKE way?)
