Skip to content

lib/stm32: stm32wba: radio temperature calibration activation #283

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

rjayles
Copy link

@rjayles rjayles commented Jun 6, 2025

This work on the lib/stm32 allows to activate/deactivate the calibration of the radio based on the temperature sensor.
It can be activated/deactivated by a Zephyr config

@erwango erwango requested review from asm5878, HoZHel and benothmn-st June 9, 2025 15:21
Comment on lines 379 to 383
#define USE_TEMPERATURE_BASED_RADIO_CALIBRATION (0)
#ifdef CONFIG_BT_STM32WBA_USE_TEMPERATURE_BASED_RADIO_CALIBRATION
#define USE_TEMPERATURE_BASED_RADIO_CALIBRATION (1)
#else
#define USE_TEMPERATURE_BASED_RADIO_CALIBRATION (0)
#endif /*CONFIG_BT_STM32_USE_TEMPERATURE_BASED_RADIO_CALIBRATION*/
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see 2 issues here:

  • CONFIG_BT_STM32WBA_USE_TEMPERATURE_BASED_RADIO_CALIBRATION is not defined
  • All code imported from Cube should not depend from Zephyr.

One suggestion would be to modify Cube code this way:

#ifndef USE_TEMPERATURE_BASED_RADIO_CALIBRATION
#define USE_TEMPERATURE_BASED_RADIO_CALIBRATION (0)
#endif

Then, define USE_TEMPERATURE_BASED_RADIO_CALIBRATION the way it is done for HSE_VALUE below:

if(CONFIG_CLOCK_STM32_HSE_CLOCK)
zephyr_compile_definitions( -DHSE_VALUE=${CONFIG_CLOCK_STM32_HSE_CLOCK} )
endif()

Ideally, this way, change could be integrated in Cube library so we don't have to maintain this as a Zephyr fix.

Finally, don't forget to document the fix in related README file.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your comment, this way of working has been integrated and pushed

rjayles added 2 commits June 11, 2025 09:56
Add the possibility to change the activation of the temperature
calibration of the radio directly from a Kconfig

Signed-off-by: Romain Jayles <romain.jayles@st.com>
The temperature calibration is now activable, its activation needs
to be integrated in the library.

Signed-off-by: Romain Jayles <romain.jayles@st.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants