[SOLVED] STM32Fxxx clock configuration

This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

  • [SOLVED] STM32Fxxx clock configuration

    CubeMX the MCU configuration software for STM32Fxxx MCUs creates code for the myriad internal clocks and many other peripheral config such as GPIO, Interrupts, timers et cetera; which makes new projects quick and easy. I can see that the Package Manager for Embedded Studio adds MCU specific libraries and other things, but how is the internal clocks and peripherals set-up, I assume it must start the MCU with some working configuration but how can one change the parameters?
    Thanks
  • Hello,

    Thank you for your inquiry.
    As mentioned in your other post the CPU support Packages provided by Embedded Studio will give you access to CMSIS files from the silicon vendors, but not the HAL or SDK or whatever else a silicon vendor might offer.
    One of the files is e.g. the system_stm32f4xx.c (or what ever STM32F subfamily you are using). There you will find function SystemInit(). There the clock init is happening.

    The CMSIS default will give you a setup that should run on any board with that chip.

    But if you require additional peripherals or want to speed up the clock to max speed, this is the place where to do it.


    When autogenerating the init with CubeMX the same CMSIS files and function is used. However additionally ST relies here on their HAL. So simply using that init in a generic ES project will not work.

    But you can either add the HAL sources to your project as well. Then it will also work with the generated init or you use the ES importer under File->Import Project->Eclipse Project.

    This is compatible to the CubeIDE project format and can be used to import the projects generated by CubeMX for CubeIDE.


    In most cases the projects will build out of the box. But sometimes slight modifications are necessary. Usually the error messages from the ES toolchain should give enough hints what needs to be adjusted.


    Best regards,

    Nino
    Please read the forum rules before posting.

    Keep in mind, this is *not* a support forum.
    Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
    Should you be entitled to support you can contact us via our support system: segger.com/ticket/

    Or you can contact us via e-mail.
  • Thanks again Nino, I did try the File->Import Project->Eclipse Project but the import did nothing, however I was using Linux Mint but trying it again on a Win 10 machine it looks like it will work, is this a bug with the Linux version?
  • Hi,

    The importer was tested for Windows only for now as CubeMX was not always multi platform. So it is possible that some paths may not be matching for the import.
    We are currently planing on creating a little guide on how to import CudeMX generated projects to Embedded Studio and will check the other platforms as well.

    Best regards,
    Nino
    Please read the forum rules before posting.

    Keep in mind, this is *not* a support forum.
    Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
    Should you be entitled to support you can contact us via our support system: segger.com/ticket/

    Or you can contact us via e-mail.