cancel
Showing results for 
Search instead for 
Did you mean: 

STM32WL CFO Registers

RLind.3
Associate III

Hi there,

I am using an STM32WLE4C8 with FSK and I am trying to determine the offset between the internal carrier frequency and an incoming carrier frequency. This offset will be used to calibrate my device using a high accuracy incoming preamble and sync word.

I believe I should be using the CFO registers of the radio (0x06B0 and 0x06B1), based on the function SUBGRF_GetCFO() in radio_driver.c from Semtech. However, I am getting wildly varied results from this function, even after averaging the samples. Repeated tests have resulted in sample variation of up to 10kHz.

Unfortunately, there is minimal documentation on these CFO registers. They are mentioned in RM0461 with the description "actual frequency error from normalized value". They aren't mentioned at all in the SX126x datasheet.

Has anyone successfully used the CFO registers before? Or have any ideas for getting a reliable offset reading? Due to the lack of documentation, I am not quite sure how to use them correctly.

Thanks,

Rebecca

1 ACCEPTED SOLUTION

Accepted Solutions
Louis AUDOLY
ST Employee

Hello Rebecca,

This bug has already been fix and will be available in the next release, you have to modify the function SUBGRF_GetCFO, and to replace the line :

uint32_t cf_fs = XTAL_FREQ / ( bandwidth_mant * ( 1 << ( bandwidth_exp - 1 )));

by the line :

uint32_t cf_fs = XTAL_FREQ / ( bandwidth_mant * ( 1 << ( bandwidth_exp + 1 )));

I hope my answer helped you!

When your question is answered, please close this topic by choosing Select as Best.

Regards

Louis

View solution in original post

2 REPLIES 2
Louis AUDOLY
ST Employee

Hello Rebecca,

This bug has already been fix and will be available in the next release, you have to modify the function SUBGRF_GetCFO, and to replace the line :

uint32_t cf_fs = XTAL_FREQ / ( bandwidth_mant * ( 1 << ( bandwidth_exp - 1 )));

by the line :

uint32_t cf_fs = XTAL_FREQ / ( bandwidth_mant * ( 1 << ( bandwidth_exp + 1 )));

I hope my answer helped you!

When your question is answered, please close this topic by choosing Select as Best.

Regards

Louis

Thanks Louis, this fixed my problem and I can now calibrate my device successfully! Thank you! 😊