Skip to main content
Associate II
September 30, 2025
Question

Error in STM32U5 MDF code generation

  • September 30, 2025
  • 1 reply
  • 312 views

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.

1 reply

Technical Moderator
September 30, 2025

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.
Leon3Author
Associate II
September 30, 2025

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.

Technical Moderator
October 1, 2025

Hello @Leon3 

Thank you for your contribution!

This issue has been raised to the development team for analysis and revision of upcoming releases (Ticket 218734 This is an internal tracking number and is not accessible or usable by customers).)

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.