2024-09-15 08:15 AM - last edited on 2024-09-15 09:57 AM by SofLit
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
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
Solved! Go to Solution.
2024-09-16 09:07 AM
@John_S wrote:i've had to comment out the I2C1_init functions .
Why? What happens if you don't?
2024-09-17 12:14 AM
the board doesnt run , all 4 LEDs come on but no flashing.
2024-09-17 01:00 AM
Again check the Crystal connection or simply replace it.
2024-09-18 02:32 AM
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
2024-09-18 02:39 AM - edited 2024-09-18 02:42 AM
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 ;);)
2024-10-29 02:46 AM
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 )
2024-10-29 04:14 AM
Hello @John_S ,
I suggest you to open a new thread for this.
Thank you.