cancel
Showing results for 
Search instead for 
Did you mean: 

STM32CubeIDE/MX bug STM32H753 problems with clock configuration and HAL initialization

Osto
Senior

Hi,

I have an IOC project attached which produce total garbage.

This project was oroginal made to use HSE 8MHz quartz and LSE 32.768KHz quartz. The I changed to use HSI and LSI an there was clock errors which I couldnt se what it is. I made the mistake to use clock resolver (most useless function in Cube) then I had total garbage (the attachment).

1.) When I select HSI or CSI as clock source, I get error that I have to use HSE as clock even when HSE is disabled??????

2.) When I select whatever, divide by x to get 4MHz, Multilpy with 100 then devide by 2, I get a sysclk of 201.5. The calculator calculates wrong. Where comes the 1.5MHz extra????

3.) The I tried to select HSI as source and wanted to adjust dividers and multipliers to get 400MHz sysclk but its not possible to do thst because it changes all the time the values what I never asked for it.

4.) When I produce the project. The result will not work at all because in the TIM7 ISR there is empty and there is no call to clockl ISR function. The system hangs after HAL initilization becaus only the TIM7 ISR is called and because of missing of the call to ISR function, nothing else will happen except the ISR call. System is dead. It was also happened that there was no TIM7 ISR generated at all.

Generally the function resolve clock issues is the most useless function in cube and I never had a useable result after using this funtion.

How can I get this IOC runnung? I was a huge job to make it and when I have to start from scartch, it costs me a lot of time.

best regards,

Osto

7 REPLIES 7
TDK
Guru

Definitely something weird happening with that IOC. I had the same issue with clock values changing without request, and some things became unselectable.

> 2.) When I select whatever, divide by x to get 4MHz, Multilpy with 100 then devide by 2, I get a sysclk of 201.5. The calculator calculates wrong. Where comes the 1.5MHz extra????

The extra 1.5MHz comes from the fractional value, which is not zero.

0693W00000AOMkOQAX.png

If you feel a post has answered your question, please click "Accept as Solution".
Osto
Senior

Is there no ST staff to solve the problem?

Hello @Osto​ ,

Please excuse the somewhat late reply and thank you for having reported.

You're right STM32CubeMX may not be able sometimes to resolve automatically Clock Issues. Also, the warning messages may not be clear enough. But we are trying constantly to improve our software tools. Thank you for your contribution.

Actually, backing to the attached .ioc file I've noticed some configuration problem that I'll detail hereafter:

  • In Pinout configuration view > RCC > RCC Configuration Panel > Parameter Settings > Power Parameters > Power Regulator Voltage Scale, the Power Regulator Voltage Scale value is set to 2. Hence, backing to STM32H753xI Data Sheet DS12117 Rev 7 the AHB maximum clock frequency fHCLK should not exceed the 150MHz:

0693W00000APqV6QAL.jpg 

  • When selecting CSI as the PLL source , an error message is displayed: "PLL Mux should have HSE as input". In fact this error is due to activation of USB_OTG_FS.

Backing to same Data Sheet mentioned above > 3.41 Universal serial bus on-the-go high-speed (OTG_HS):

"USB OTG controllers require a dedicated 48 MHz clock that is generated by a PLL connected to the HSE oscillator".

0693W00000APqR0QAL.jpg 

  • Concerning the clock frequency calculation (when fracnx is set to value other than 0) , please refer RM0433 to "RCC PLLx Fractional Divider Register".

I've tried to do some changes in your attached .ioc in order to resolve manually the clock issues:

- I've set the franc1, franc3 to 0.

- I've set the VOS to 1 to match the fHCLK =200MHz.

- I've changed the PLL Source Mux to HSE (after selecting Crystal/Ceramic Resonator for HSE) and set HPRE set to /2, DIVQ1 to /4 and DIVQ3 to /5 accordingly.

You'll find it attached below.

I hope this clarifies a bit the situation.

Please do not hesitate to raise any problem/feedback.

Khouloud.

Hello @Osto​,

I wonder if my reply answers your questions.  If this this case, please click on the Select as Best button on my reply . This will help other members of the community find this solution more quickly 🙂

Moreover, in the subject of of the "PLL Mux should have HSE as input" error, selecting RC48 as an USB clock source can also clear this error.

In fact, for USB application, the internal clock source is not precise enough: To achieve a High-Speed communication, a high frequency clock is required. So the USB clock is sourced from the HSE clock.

Thus, if you're using USB in your project, it is preferred to use HSE clock source for best accuracy since RC48 clock does not technically guarantee the clock stability required for USB use.

RC48 can be good enough, hence it can be used as USB Clock source.

Khouloud.

Christophe VRIGNAUD
ST Employee

Hello @Osto​ ,

In complement of Khouloud's answer, you can find some more information on USB clock source in AN4879 - USB hardware and PCB guidelines using STM32 MCUs.

Best regards,

Christophe

Dear Khouloud,

sorry for late answer. the mails about your comments was landed in spam folder.

First of all, I didn't knew that I can change the fraction. This is a missed information in Cube that things which can be changed and thing which cant be changed are displayed in exactly the same way.

I know, there are missconfiguration in this file because the problem happened middle of design phase but explain me please why I have to use External crystal for my clock? There is not external crystal. Why I can neither use CSI nor HSI??? The clock source was a missconfiguration which I changed back.

Please also see what happens when you change for example to CSI. The blinkung of almost everthing hints to understand the reason and during this time you can only wait. You cant do anything because the blinking blocks all comboboxes so that you cant change the in the right way. A messagebox would help a lot more. But anyway, I never changed the Power Regukator Voltage Scale. Why its wrong? Who/what change that to the wrong value.

My main problem is that I dont have an external crystal and I cant use this configuration at all.

An HSE is required to satisfy the timing requirements of USB in OTG mode. The CSI/HSI is not accurate enough.

If you feel a post has answered your question, please click "Accept as Solution".