cancel
Showing results for 
Search instead for 
Did you mean: 

Cube divides Input Frequency value by 1 000 000

Tomasz Kowalczyk
Associate II
Posted on November 13, 2017 at 13:47

Hi, I'm using Cube v4.22 as Eclipse (version 4.5.2) plugin. I've encountered a problem with clock configuration - when I write a frequency in the Input Frequency field, Cube automatically divides it by million. This generally wouldn't be a big deal (putting value in Hz instead of MHz as indicated by the comment), but when I later touch any other setting or generate code, the value divides by another million again - producing wrong values in all the fields. I don't know if it actually affects the generated code, but surely it is annoying.

Screenshot of my Cube after I have written 8000000, enter and then started changing some ADC divider:


_legacyfs_online_stmicro_images_0690X0000060MxgQAE.png

If I keep pressing enter while in Input Frequency window, it keeps dividing whatever is in there by one milion at a time.

All of above happens to LSE too.

Does anyone know where exactly the problem lies and if it is possible to get rid of it? I've looked through release notes of two newer versions of Cube and this problem was not mentioned as fixed.

#settings #frequency #cube #clock
8 REPLIES 8
alfbaz
Associate II
Posted on November 13, 2017 at 16:52

Hi Tomasz.

What micro are you using?

For the ones I use if I want an 8MHz clock input I simply type 8 in the input field and go from there without issue so maybe the problem is particular to the mcu you are  using

Posted on November 13, 2017 at 17:05

STM32F103C8. The same happens when I try STM32F072V8. I think this isn't associated with any specific uC, it is a problem somewhere in Cube and/or Eclipse, as I don't even get to generating the code.

When I write 8 in the field and press enter or click anywhere outside the box, it automatically divides by 1000000 and leaves same screen as I attached.

If I enter 8 with as many zeroes as needed, I get to generate code with correct value visible on screen and the code works correctly, I'm aiming only the necessity of writing a number with many zeroes to get the correct, lone 8 in the field.
Posted on November 13, 2017 at 17:24

I just tried it with the micro you mentioned and every thing works as it should by just typing 8. As a matter of fact the default value is 8 after starting the project.

However from the plugin's Help->About it's version 4.23 and I'm using eclipse Neon.3 (4.6.3) so maybe some software updates is all you need

Imen.D
ST Employee
Posted on November 16, 2017 at 14:44

Hello

ten.kowal

,

Could you please try with CubeMx version 4.

If your issue persists, please share your .ioc file and provide us your environment details.

Best Regards

Imen

When your question is answered, please close this topic by clicking "Accept as Solution".
Thanks
Imen
Posted on November 16, 2017 at 21:35

Hi, I've manually downloaded the latest version of Cube (4.23). LSE was bugged as soon as chosen, HSE was correctly set at 8MHz until I tried to write the value manually. I didn't update Eclipse.

I'm attaching the .ioc file.

BTW. If only 32768Hz quartz is accepted as LSE, maybe the option to write arbitrary values in the Input Frequency for LSE is not needed?

________________

Attachments :

stm32f103_nixie_clock_multiplexed.ioc.zip : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006HyHg&d=%2Fa%2F0X0000000b5b%2FplMLob5P8WTvLCyKfoPHaEIkyMdo01Yf6i3TJyIaAk8&asPdf=false
atomassini
Associate II
Posted on March 27, 2018 at 12:49

Hello,

still not solved in 4.24, but find a workaround here:

https://community.st.com/0D50X00009XkeTPSAZ

Tomasz Kowalczyk
Associate II

Over a year passed and this annoying bug still exists. I've downloaded newest SW4STM32 with newest Cube (and checked for updates) and again I can see this:

I've tried manually changing the value in .ioc file to 32768, 32.768 - whatever, it still divides it and then constantly bothers me with message that my clock system is #$%^ up.

Now with old cube I was able to work around the problem by putting 32768000, which then automatically divided into correct value. Currently I am unable to write into LSE Input Frequency (so this definitely is not my fault, that there is wrong value in that field!)

I tried to overcome it by editing the .ioc file, but whatever I write (32768, 32768000, 32.768) Cube still divides this value by 1000000 whenever I open Clock Configuration panel.

I even tried building a project on H743ZI Nucleo board using the option of having everything predefined to the board. And guess what - from the start the Clock Configuration was messed up by LSE input frequency field.

BTW. This "Save Project" popup should definitely appear less frequently, it's annoying. And user can't change it at all. User preferences box is empty.

So now, that the problem is definitely not caused by me using outdated software, why is this out-of-nowhere LSE input division still here?!

@atomassini I've already been using this workaround, but now I can't even write into LSE input frequency field.

Tomasz Kowalczyk
Associate II

Ha! As soon as I modified .ioc file by myself and wrote

RCC.LSE_VALUE=32768000

RCC.RTCFreq_Value=32768000

saved it, opened SW4STM32, generated code without going into Clock Configuration I suddenly saw my code working properly. This incorrect value seems to block SystemClock_Config();, as my previously not working code suddenly started working flawlessly even though I changed nothing but that.

So, long story short, if you want to use the easy to use code generator, you have to set your MCU and then save it, close program, open .ioc file manually and then change two specific values in it. Later you have to close the .ioc file, open SW4STM32, open Cube, DON'T YOU DARE GO INTO CLOCK CONFIGURATION and press Generate Code. Phew, that's intuitive!