cancel
Showing results for 
Search instead for 
Did you mean: 

32KHz External Oscillator on STM32F779

Deabill.Roy
Associate II
Posted on October 19, 2016 at 09:44

Hi,

I have recently been having problems with the 32KHz external oscillator on a number of boards failing to start or running slowly when it does start. After trawling the reference manual I found the LSEDRV bits in the RCC_BDCR register. Setting these bits to a High drive level appears to solve the problem. I was wondering if there is any advice on the appropriate settings for these bits of if it just trial and error.

I am currently using CubeMX and the HAL system to provide initialization and peripheral access to the chip. This brings me to the second problem in that there is no way in CubeMX to set up parameters to define these bits, and there does not apper to be any way that they can be set with the HAL: interface apart from using direct SET_BIT and CLER_BIT macros on the relevant registers. As the bits cannot be set up in CubeMX,and the initialization is done by the HAL startup code in SystemClock_Config(), it seems that I wil hjave to use CubeMX to disable the oscillator and then set it up myself with an extra routine after the system starts. This is far from ideal and I would appreciate any advice on how to do this in an elegant manner.

#stm32f779-cubemx-hal
3 REPLIES 3
Amel NASRI
ST Employee
Posted on October 19, 2016 at 11:47

Hi deabill.roy,

I would like to know if you are using your own PCB or ST boards? if they are ST boards, which ones?

If it is your own PCB, did you checked recommendations of

http://www.st.com/content/ccc/resource/technical/document/application_note/c6/eb/5e/11/e3/69/43/eb/CD00221665.pdf/files/CD00221665.pdf/jcr:content/translations/en.CD00221665.pdf

?

In fact, you have to select a compatible LSE with your product, that respects the gm_crit_max. You have to calculate the drive level and pay attention not to exceed the crystal DL.

All the checks to do may be found in the section ''Detailed steps to select an STM32-compatible crystal'' of the suggested application note.

Please let me know if the content of this application note answers your first question or not.

I continue with the check of Cube and CubeMX related questions and come back to you.

-Mayla-

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.

Deabill.Roy
Associate II
Posted on October 19, 2016 at 12:15

Hi,

We are using our own boards.

I will pas on your response to our hardware engineer for review

Amel NASRI
ST Employee
Posted on October 19, 2016 at 13:40

Hi,

I checked that in HAL driver (stm32f7xx_hal_rcc.h) you may use the macro ''__HAL_RCC_LSEDRIVE_CONFIG'' to configure the LSE drive capability.

Remains now to allow this using CubeMX interface.  Your request will be shared internally and we will come back to you when we will have more details on this regard.

-Mayla-

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.