Skip to main content
MMüll.6
Associate III
July 14, 2022
Solved

Incorrect order of initialization STM32H753

  • July 14, 2022
  • 14 replies
  • 3666 views

The ADC and SPI use the DMA, but the CubeIDE initialize the DMA at last ant the SPI initialization fails. See screenshot.

CubeMX Version 6.6.1

Please fix this mistake. Attachment, the Screenshot.

The second problem: I cannot chage the "Rank" order from initialization.

The correct rank will be:

  • first "SystemClock"
  • second "GPIO"
  • third "DMA"
  • then the rest.

Other controllers like STM32G484 is the CubeMX code generation correct.

This topic has been closed for replies.
Best answer by Sara BEN HADJ YAHYA

Hello @Markus Müller​ ,

This issue is fixed in STM32CubeMX latest release.

V6.7.0 is now available under this Link.

Thanks for your contribution :smiling_face_with_smiling_eyes:

Sara.

14 replies

Peter BENSCH
ST Technical Moderator
July 14, 2022

Yes, this is a known issue and will be (hopefully) fixed soon, see e.g. here.

Does it answer your question?

Regards

/Peter

@Sara BEN HADJ YAHYA​ 

In order 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.
Pavel A.
July 14, 2022

> see e.g. here.

But the OP has 6.6.1, a newer version. Regression?

MMüll.6
MMüll.6Author
Associate III
July 15, 2022

Yes, this bus is present in V6.6.1. Please fix it.

MMüll.6
MMüll.6Author
Associate III
July 14, 2022

Yes, thank you very much.

We have temporary fix this mistake with a user code before MX initializations:

__HAL_RCC_DMA1_CLK_ENABLE();

Regards Markus

Peter BENSCH
ST Technical Moderator
July 15, 2022

This is also inexplicable to me, because I assumed that the problem had already been eliminated. But anyway, there are two ways to fix it:

  • manually inserting __HAL_RCC_DMA1_CLK_ENABLE(); as you have done before
  • moving the position of MX_DMA_Init already in CubeMX by selecting the row and moving it to the correct position with the small, easy-to-miss arrows above the table in the upper right corner

Regards

/Peter

In order 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.
MMüll.6
MMüll.6Author
Associate III
July 15, 2022

About your answer:

"moving the position of MX_DMA_Init already in CubeMX by selecting the row and moving it to the correct position"

Please mark me this "easy-to-miss arrows above the table", I cannot find it.

Attachment my CubeMX 6.6.1 View.

Regards Markus

MMüll.6
MMüll.6Author
Associate III
July 15, 2022

"because I assumed that the problem had already been eliminated"

No, the Problem is wihtin CubeMX 6.6.1 also pending. This mistakte is only fixed for a other µC.

Sara BEN HADJ YAHYA
ST Technical Moderator
July 15, 2022

Hello @Markus Müller​ ,

You can solve this issue by applying the workaround described in the following thread MX_DMA_Init order in the main.c file generated by STM32CubeMX, How to fix?

I couldn't reproduce the issue from my side, could you please help me with a detailed scenario so that I can I report it ?

Thanks,

Sara.

In order to give better visibility on the answered topics, please click on 'Best answer' on the reply which solved your issue or answered your question.
Peter BENSCH
ST Technical Moderator
July 15, 2022

If you create a project for the H753IIK, activate some peripherals first, e.g. ADC1, SPI1, SPI2, TIM1, TIM2, and then after that add a DMA channel for ADC1, for example, DMA is added to the Generated Function Calls at the bottom and cannot be moved.

If the DMA channel is inserted right at the beginning, the function call is also in the right place.

Regards

/Peter

In order 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.
Sara BEN HADJ YAHYA
ST Technical Moderator
July 15, 2022

Hello @Markus Müller​ ,

Issue confirmed from my side, it seems that the DMA init order is not set correctly in H7 devices.

Please check the workaround proposed in this thread MX_DMA_Init order in the main.c file generated by STM32CubeMX, How to fix?

I submitted an internal ticket, I will keep you posted.

Internal ticket number: 131855 (This is an internal tracking number and is not accessible or usable by customers).

If your issue is solved, please close this post by clicking the "Select as Best" button. This will help other members of the community find this response more quickly :)

Sara.

In order to give better visibility on the answered topics, please click on 'Best answer' on the reply which solved your issue or answered your question.
Sara BEN HADJ YAHYA
ST Technical Moderator
November 28, 2022

Hello @Markus Müller​ ,

This issue is fixed in STM32CubeMX latest release.

V6.7.0 is now available under this Link.

Thanks for your contribution :smiling_face_with_smiling_eyes:

Sara.

In order to give better visibility on the answered topics, please click on 'Best answer' on the reply which solved your issue or answered your question.