cancel
Showing results for 
Search instead for 
Did you mean: 

STM32U585QII CUbeMX 6.7.0 Error with code generation

Linas L
Senior II

Hello, Just a quick heads up regarding LL implementation of LSI.

It fails to start, while same setup generated for HAL works as it should.

Now looking in detail whats wrong in register level calls, will post my results.

ST, I hope you will find and fix this issue with LL code generation, thank you !

1 ACCEPTED SOLUTION

Accepted Solutions
KDJEM.1
ST Employee

Hello @Linas L​,

Thank you for bringing this issue to our attention.

I confirm the issue and I reported Internally.

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

  

Kaouthar

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.

View solution in original post

6 REPLIES 6
Linas L
Senior II

Find a problem while reading RM.

LL code simply tries to

  LL_RCC_LSI_Enable();
 
   /* Wait till LSI is ready */
  while(LL_RCC_LSI_IsReady() != 1)
  {
  }

Problem is, in order to access backup domain, PWR->DBPR needs to be set to 1, this will allow to set LSI bit in RCC->BDCR register.

Solution is simply:

  PWR->DBPR = 1;

That is it. please add this by default into LL configuration, since it is nice when code runs without looping in LL_RCC_LSI_IsReady().

Thank you !

Interesting.

This makes the 'U5 probably the only STM32 family where LSI is in the backup domain (with the consequence you've described).

Thanks for investigating and coming back with the result.

JW

Pavel A.
Evangelist III

This is because LL is, well... low level. This API is very fine granular and gives a lot more control to the user.

The /*beginner-proof*/ HAL driver does enable the backup domain write.

I would say, if user select LL libraries, it should reach while(1) in main and not get stuck, unless you need to enable oscillators or any other hardware dependent devices that could lock start procedure.

LL code generation is already limited, but user should not need to check each line of generated code to see if it's missing something.

If I enable IWDG, i would expect LSI already working as it should with no user intervention.

KDJEM.1
ST Employee

Hello @Linas L​,

Thank you for bringing this issue to our attention.

I confirm the issue and I reported Internally.

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

  

Kaouthar

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.

KDJEM.1
ST Employee

Hello @Linas L ,

This issue is solved in the STM32CubeMX 6.9.0 version.

Thank you for your contribution in STCommunity.

Kaouthar

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.