cancel
Showing results for 
Search instead for 
Did you mean: 

How to override AGC and use manual attenuation values?

mkx
Associate II

I want to disable the AGC and use supply manual attenuation values.
Disabling the AGC is pretty straight forward, I just set the AGC_EN bit in AGC0CTRL to zero.
This works fine, but the gain/attenuation is fixed at the reset value and I'd like to use a custom value.

To set manual attenuation values, I suppose I need to write them to the AGC_ANA_ENG register.

However, i noticed something weird: This AGC_ANA_ENG register is not present in the driver files. Its not mentioned anywhere and in the MRSUBG register definitions it is listed as "Reserved". The "Description of STM32WL3 HAL and LL drivers" pdf (UM3438) even lists a couple of LL-functions to modify it, such as LL_MRSubG_SetAgcForceGains, but they exist nowhere in the driver files.

Why is this register not mentioned in the official driver files and why dont the LL-methods exist?

1 ACCEPTED SOLUTION

Accepted Solutions
Imen.D
ST Employee

Hello @mkx ,

The API is located in: Drivers\STM32WL3x_HAL_Driver\Inc\stm32wl3x_ll_mrsubg.h as LL_MRSUBG_SetAgcForceGains. 

 

When your question is answered, please close this topic by clicking "Accept as Solution".
Thanks
Imen

View solution in original post

4 REPLIES 4
Imen.D
ST Employee

Hello @mkx ,

The API is located in: Drivers\STM32WL3x_HAL_Driver\Inc\stm32wl3x_ll_mrsubg.h as LL_MRSUBG_SetAgcForceGains. 

 

When your question is answered, please close this topic by clicking "Accept as Solution".
Thanks
Imen
mkx
Associate II

Maybe I'm missing something here, but stm32wl3x_ll_mrsubg.h does not seem to contain LL_MRSUBG_SetAgcForceGains.

https://github.com/STMicroelectronics/stm32wl3x-hal-driver/blob/main/Inc/stm32wl3x_ll_mrsubg.h

I'm using the stm32wl3x-hal-driver repo on github, release 1.3.0. It does not contain LL_MRSUBG_SetAgcForceGains.

Imen.D
ST Employee

Hi @mkx ,

The API LL_MRSUBG_SetAgcForceGains is included in stm32wl3x_ll_mrsubg.h and is available on the ST web page starting from release 1.4.0STM32CubeWL3 | Product - STMicroelectronics

When your question is answered, please close this topic by clicking "Accept as Solution".
Thanks
Imen
mkx
Associate II

Alright, looks like I was just using an outdated version then, thanks!

I wasn't aware you also offer the drivers directly on st.com and - somewhat confusingly - a newer version than in the github repos.