AnsweredAssumed Answered

Best way to configure clock [from scratch project]

Question asked by Jems On on Mar 24, 2018
Latest reply on Mar 25, 2018 by avi_crak.videocrak

Hello everyone,

I'm starting a blank project and would like to know the best way to configure the clocks (without using CubeMX).

The initial project therefore contains the startup file stm32f413xx.s as well as the file system_stm32f4xx.c and a main.c

In the startup file, after the reset comes the call of the SystemInit function present in the system_stm32f4xx.c

When using CubeMX, the system_stm32f4xx.c file is not modified and therefore remains the one proposed by the CMSIS driver by default. The clocks are then modified in initialization via the SystemClock_Config () function; using the function calls of the HAL library. As I understand the clock configuration is done in two stages (not very effective)

I would like to configure the registers by myself without going through the HAL layer but I would like to know if the cleanest way is to keep the file system_stm32f4xx.c as it is provided in the CMSIS pack and to do a function of initialization registers called in the main. Or is it better to modify directly the system_stm32f4xx.c file. Before using CubeMX we generated a file system_stm32f4xx.c from an excel clock system configuration tool. C'était plutot propre. Existait il des soucis en procédant ainsi ? 


Thanks in advance !