Skip to main content
Associate
November 12, 2023
Solved

How to correct the frequency deviation caused by replacing the oscillator of STM32WL

  • November 12, 2023
  • 2 replies
  • 7067 views

Dear ST,
Our customers have encountered some problems when using STM32WL in FSK mode. We read the document es0500-stm32wl55xx-stm32wl54xx-device-errata-stmicroelectronics.pdf. There is a suggestion to replace the 32Mhz HSE with 31.25Mhz, but we are changing it. After that, I did a CW wave test and found that the frequency shifted by about 20Mhz. How can we correct this problem? Thank you.

20231112121630.jpg

This topic has been closed for replies.
Best answer by Tesla DeLorean

I'm suspicious it means using TWO independent clocks. Where the HSE and TCXO clocks are different/independent sources, and you're not feeding the HSE back in as the TCXO source to the radio.

This should be stated clearly, if the case, the errata is opaque and ambiguous. Be CLEAR as to what the errata needs addressing.

From radio_driver.c

 

/**
 * @brief Provides the frequency of the chip running on the radio and the frequency step
 * @remark These defines are used for computing the frequency divider to set the RF frequency
 * @note XTAL_FREQ can be redefined in radio_conf.h
 */
#ifndef XTAL_FREQ
#define XTAL_FREQ ( 32000000UL )
#endif /* XTAL_FREQ */
#define SX_FREQ_TO_CHANNEL( channel, freq ) \
do \
{ \
 channel = (uint32_t) ((((uint64_t) freq)<<25)/(XTAL_FREQ) ); \
}while( 0 )

 

 

 

2 replies

STTwo-32
Technical Moderator
November 12, 2023

Hello @Weili and welcome to the ST Community.

I suggest you to follow the workaround mentionned on the ES0500 that advice you to use HSI or MSI with or without PLL as a clock source (without any modification on the HSE).

Best regards.

STTwo-32 

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
WeiliAuthor
Associate
November 12, 2023

Hello @STTwo-32 

Thank you for your quick response.

I saw a workaround in the ES0500 file, but I'm sorry, I don't quite understand it. Do I need to make changes in cubeMX? Can you instruct me where to change it?
I need to know before I resolve it with my customer.

"Workaround
Use a different clock source for the system, for example MSI or HSI with or without PLL"

 

 

 

STTwo-32
Technical Moderator
November 12, 2023

Hi @Weili 

In your .ioc file, change the clock source you are using to MSI or HSI. Than using PLL, you Can configure your system clock to the value that you want.

Take a look at the clock tree on the reference manual of your board to have more détails.

Best regards.

STTwo-32 

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
Tesla DeLorean
Tesla DeLoreanBest answer
Guru
November 12, 2023

I'm suspicious it means using TWO independent clocks. Where the HSE and TCXO clocks are different/independent sources, and you're not feeding the HSE back in as the TCXO source to the radio.

This should be stated clearly, if the case, the errata is opaque and ambiguous. Be CLEAR as to what the errata needs addressing.

From radio_driver.c

 

/**
 * @brief Provides the frequency of the chip running on the radio and the frequency step
 * @remark These defines are used for computing the frequency divider to set the RF frequency
 * @note XTAL_FREQ can be redefined in radio_conf.h
 */
#ifndef XTAL_FREQ
#define XTAL_FREQ ( 32000000UL )
#endif /* XTAL_FREQ */
#define SX_FREQ_TO_CHANNEL( channel, freq ) \
do \
{ \
 channel = (uint32_t) ((((uint64_t) freq)<<25)/(XTAL_FREQ) ); \
}while( 0 )

 

 

 

Tips, Buy me a coffee, or three.. PayPal VenmoUp vote any posts that you find helpful, it shows what's working..
WeiliAuthor
Associate
November 13, 2023

Hi Tesla.

Thanks for your reply.

Thank you for your information. Your information has successfully helped us solve this problem.

 

B.R. Weili Wang.