cancel
Showing results for 
Search instead for 
Did you mean: 

Newbie with newbie problems Oscillator start up ?

John_S
Associate II

Hi People,

for the since start of year i've been setting up boards with Texas C2000 , and for the past 6 months infineon tri-core processors.  I may be changing jobs and it involves STM32 so i'm getting a head start. I have a STM32373C-EVAL , as i need TFT display and CAN. i have attempted to make a 'blinky ' project. Compiles fine but when it runs it hangs on the oscilator start up . Fresh install of STM32CubeIDE so used the config tool and let it do all the defaults.. The dev kit has solder bridges for crystal - they are open , but i've let it use the PLL.  it wont let me 

John_S_0-1726412883613.png

When running in debug it 'hangs' on stopping the code , its in the error handler from the system clock settings , if i comment out the error handler it runs . 

 

void SystemClock_Config(void)

{

RCC_OscInitTypeDef RCC_OscInitStruct = {0};

RCC_ClkInitTypeDef RCC_ClkInitStruct = {0};





/** Initializes the RCC Oscillators according to the specified parameters

* in the RCC_OscInitTypeDef structure.

*/

RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSI;

RCC_OscInitStruct.HSIState = RCC_HSI_ON;

RCC_OscInitStruct.HSICalibrationValue = RCC_HSICALIBRATION_DEFAULT;

RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON;

RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSI;

RCC_OscInitStruct.PLL.PLLMUL = RCC_PLL_MUL9;

if (HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK)

{

Error_Handler(); // sometimes comment this out

}



/** Initializes the CPU, AHB and APB buses clocks

*/

RCC_ClkInitStruct.ClockType = RCC_CLOCKTYPE_HCLK|RCC_CLOCKTYPE_SYSCLK

|RCC_CLOCKTYPE_PCLK1|RCC_CLOCKTYPE_PCLK2;

RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK;

RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1;

RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV1;

RCC_ClkInitStruct.APB2CLKDivider = RCC_HCLK_DIV1;



if (HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_1) != HAL_OK)

{

// Error_Handler(); // wont get past this one either , but still runs ok ... why ?

}

}

Has anyone else have this grief ?

Are u supposed to do something about this... Other micros i've used you just set them up and job done ?!?!

 

for now i'm leaving the check commented out so i can carry on .. Some advice would be helpful though

 

Thanks In Advance

 

14 REPLIES 14

@John_S wrote:

 i've had to comment out the I2C1_init  functions .


Why? What happens if you don't?

the board doesnt run , all 4 LEDs come on but no flashing.

 

@John_S 

Again check the Crystal connection or simply replace it.

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.
John_S
Associate II

after some messing , i've took the board in to work were we have some spare crystals ... we didnt have a spare 8mhz but we did have some 16's so i've tried one of those ... low and behold after changing the setup and clock config it looks like its working.  More checking as i've only quickly hooked the crystal up to try it. i'll buy a 8meg when i get chance and this will prove the point.

To be continued but thanks all 

Hello @John_S ,


@John_S wrote:

but we did have some 16's so i've tried one of those ... low and behold after changing the setup and clock config it looks like its working. 


This feedback proves my assumption: the issue was on the crystal itself

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.