cancel
Showing results for 
Search instead for 
Did you mean: 

Error in STM32U5 MDF code generation

Leon3
Associate II

For a project based on the STM32U585 I use the MDF in a specific configuration.

  • Filter 0: receives input from SIT0
  • Filter 1 receives input from SIT3
  • Filter 3 receives input from SIT0

So three filters are used and only two serial input streams. Serial input stream 1 is not needed and I cannot configure it since the pin of this serial input is used for another function.

It appears that when for a filter a serial input is disabled, the code generation is wrong.

The configuration for filter 1 is shown below:

Leon3_0-1759241815651.png

As said, for filter 1 the serial interface is disabled since this filter is configured to receive its data from serial input stream 3, this is ok.

However, the code generated for MX_MDF1_Init does not specify the configuration setting to tell filter 1 to use stream 3. The generated code for filter 1 is shown below:

  /**
    MdfHandle1 structure initialization and HAL_MDF_Init function call
  */
  MdfHandle1.Instance = MDF1_Filter1;
  MdfHandle1.Init.CommonParam.InterleavedFilters = 1;
  MdfHandle1.Init.CommonParam.ProcClockDivider = 2;
  MdfHandle1.Init.CommonParam.OutputClock.Activation = DISABLE;
  MdfHandle1.Init.SerialInterface.Activation = DISABLE;
  if (HAL_MDF_Init(&MdfHandle1) != HAL_OK)
  {
    Error_Handler();
  }

What is missing is the following line:

	MdfHandle1.Init.FilterBistream = MDF_BITSTREAM3_RISING;

 

So the assumption made by the code generator is that if for a filter its related serial input is disabled, the code for letting it use another input (stream 3 in the code above) is not generated.

2 REPLIES 2
Souhaib MAZHOUD
ST Employee

Hello @Leon3 

I'm currently checking this issue. Could you share an ioc in order to further investigate the problem.

KR

Souhaib

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.

Hello Souhaib,

thanks for your reply. This issue comes on top of another issue I reported something like 2 years ago with the title "CubeMX generates incorrect code for the STM32U575 MDF peripheral for multiple filters using DMA"

The related ioc is attached.