2016-02-08 01:01 AM
Hi,
i have connected a external clock on stm32f4 microcontroller but the hse is failled to startup the application code (the internal clock works perfectly though.)2016-02-08 01:52 AM
Dear emb_begin,
First deinit your RCC then Config RCC(HSE Enable). In HSE enable follow the following--1.Reset HSEON bit.2.Reset HSEBYP bit3.Enable HSE/*Please
mark helpfull
if this post helps you or solves your problem.*/
/**disclaimer**/
/* I am not a person from ST Technical Support Team. So please verify/test any support/suggestion at your end.*/
/* This post is only for general support purpose and free of any charge.If you need any personal support for your work please contact at
embeddeddesign.help@gmail.com
*/
2016-02-08 05:30 AM
i have done it and it runs the application..
Now the usart output(send some string) on tera term is not working and i am getting a garbage values. The usart output works fine with the internal clock.2016-02-08 08:36 AM
You should perhaps review the timeout period, and the design/characteristics of your circuit. Evaluate how long it takes to start over voltage/temperature.
For odd data output, make sure that HSE_VALUE reflects the speed of your chosen external clock.2016-02-11 05:17 AM
thank you,clive.
2016-02-11 05:58 AM
HSE_VALUE is a define, either passed in the compiler's command line via project settings, or within the stm32f4x_conf.h type file.
For an 8 MHz clock it needs to be 8000000, if you have a different crystal frequency it will need to reflect that. Your PLL settings also need to match your design, see system_stm32f4xx.c The HSE_VALUE is used in computing clocks related to the baud rates settings, so if it is wrong, all you serial data with be garbled.2017-04-02 05:43 AM
Hi.
Maybe it help you.
If you use STM32CubeMX it's bug of STM32Cube code generator. When you don't use HSI new code don't have full initialization RCC_OscInintStruct for HAL_RCC_OscConfig() in main.c of created project.
I put into stm32f4xx_hal_rcc.c at start of function HAL_RCC_OscConfig the following code:
----------------------------------------------------------------------------------------------------------------------------------------
__weak HAL_StatusTypeDef HAL_RCC_OscConfig(RCC_OscInitTypeDef *RCC_OscInitStruct)
{ if (RCC_OscInitStruct->HSIState != RCC_HSI_ON){RCC_OscInitStruct->HSIState = RCC_HSI_ON; RCC_OscInitStruct->HSICalibrationValue = 16;};
if (RCC_OscInitStruct->LSIState != RCC_LSI_ON) {RCC_OscInitStruct->LSIState = RCC_LSI_OFF;};
if ((RCC_OscInitStruct->LSEState != RCC_LSE_ON) ||\
(RCC_OscInitStruct->LSEState != RCC_LSE_OFF)||\ (RCC_OscInitStruct->LSEState != RCC_LSE_BYPASS)) {RCC_OscInitStruct->LSEState = RCC_LSE_OFF;};uint32_t tickstart = 0U;
/* Check the parameters */----------------------------------------------------------------------------------------------------------------------------------------
Thank you.