cancel
Showing results for 
Search instead for 
Did you mean: 

Are STM32G4 FMAC X and Y buffers cleared by HAL_FMAC_FilterStop ?

siungsuestone
Associate II

Code Order :1、HAL_FMAC_FilterPreload_DMA。

2、HAL_FMAC_FilterStart。

3、HAL_FMAC_FilterStop。

4、HAL_FMAC_FilterStart。

5  HAL_FMAC_AppendFilterData

    i want ask ,does Fmac X and Y buff will clean when step3: HAL_FMAC_FilterStop function excute ?  

1 REPLY 1
Saket_Om
ST Employee

Hello @siungsuestone 

At FilterStop, the internal X1 and Y FMAC buffers are not cleared.

However, their respective internal write and read pointers are reset to the X1_BASE and Y_BASE addresses.

When you restart the filter, the new data are computed using possibly outdated X & Y values (for an IIR filter).

If you want to keep the filter context and continue filtering with new data, do not stop the filter; just append a new data buffer by calling HAL_FMAC_AppendFilterData.

Otherwise, if for any reason, you must stop the filter, then restart it with the previous context by preloading the latest X & Y values.

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.
Saket_Om