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

 

16 REPLIES 16

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

been a while since i've checked back in , been hacking , writing , compiling and i have problem and questions , so here goes.

I have bought a new crystal and made sure its secure in the holder - this has helped loads.

i've made a project so i can run the STM32F373VC BSP driver examples - this compile , runs in debug , and will run when made as a release , also boots straight away no grief. Happy days :)

I have now made a fresh project copying across all the board support files across so i can run the display but my code has CAN and timers running as i want to display CAN data on the LCD. 

I still have boot up / start up problems . If i compile my code as a release file and load it on via the programmer press the reset it starts , if i unplug the power - it doesnt start straight away , i have to press the reset button a few times then it runs. . . Even worse is when i load the debug file up in debug when i press resume i get nothing unless i hit the reset button a few time then the code runs i can start /stop BUT the LCD is blank ... i'm a tad confused. Looking through the files i have a "startup_stm32f373vctx.s" in my fresh code and a "startup_stm32f373xc.s" in the example code. there are bits that are different.

Can anybody shed some light ? i'm trying to figure out if i have dodgy dev kit .. but then the example code is fine ( agghhh ) 

 

Hello @John_S ,

I suggest you to open a new thread for this.

Thank you.

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.