cancel
Showing results for 
Search instead for 
Did you mean: 

stm32cubeMX doesn't modify/generate the system_stm32l0xx.c

moranf
Associate II
Posted on October 17, 2017 at 12:49

Hi All,

in order to build new project (using STM32l073v8t processor) folder, I used the STM32cubeMX.

I've set all IOs, change the clock tree using its UI and etc' according to my project.

When I check the generated code source folder I see that all files are updated while the system_stm32l07xx.c is old and doesn't modify also I change the clock tree parameters.

Also, i can't find clock generator tool for this processor family.

Please advise how should I modify the clock file.

Thanks in advance,

Moran.

#stm32l073v8t #cubemx
3 REPLIES 3
Posted on October 19, 2017 at 06:33

Hello Moran.

There is nothing modificable by  STM32cubeMX inside system_stm32l0xx.c

The only modification in this file must be done manualy by the user, is  to change the  HSE_VALUE parameter  to fit to  crystal's frequency.

The clock generator tool, is the  'Clock Configuration' tab in STM32cubeMX.

No need for an external clock  generator.

The PLL values, etc calculated by STM32cubeMX .

The produced code for clocks, resides inside 'main.c'  file in 'SystemClock_Config' function.

Regards

vf

Posted on October 19, 2017 at 07:47

Thanks vf,

I still don't understand why to keep the clock setting function in the main for STM32L0XX while STM32L1XX excel (

same as clock configuration tab

) modify the 

system_stm32l1xx.c with the selected clock tree.

It seemed to me like a bug... or I missing something.

Posted on October 19, 2017 at 22:27

Hi!

It is not a bug.  This is the way STM32cubeMX works . When use the cube, excel is obsolete.

STM32cubeMX produces clock initialization code that  uses timeouts for some delayed flags and has also error handling.(old

system_stm32l1xx.c

not)

cube's

system_stm32l1xx.c

version is far away newer than this from excel .

Of course a programmer may use the clock generator but must delete the call to SystemClock_Config().

After every cube's  code regeneration, it will appears again.!

Note:this excel is for L1  and not for L0 family.

Regards

vf