2020-10-01 08:19 AM
Hello,
I have been observing this issue with previous as well as latest STM32CubeMX versions, wherein the generated MDK-ARM (minimum version 5.27) project file (UVPROJX) has incorrect value set to Options for Target -> Target -> Xtal (MHz).
In the IOC file I have informed that used XTAL value is 25 MHz.
In Clock configuration, I have set SYSCLK to 480 MHz and D1CPRE Prescaler to Divide by 1. thus FCLK is 480 MHz.
STM32CubeMX copying SYSCLK value to Xtal (MHz) is a BUG.
Please fix the bug.
Regards,
2020-10-05 03:32 AM
Hello @Rajeev Arora
Could you please share your ioc file ?
Thanks
Khouloud
2020-10-05 03:48 AM
2020-10-05 03:58 AM
Hello @Khouloud ZEMMELI
There was an erratum in the information I shared. Please read "STM32CubeMX copying SYSCLK value to Xtal (MHz) is a BUG."
as
"STM32CubeMX copying 240 MHz value to Xtal (MHz) is a BUG."
The value of HPRE Prescaler is set to "/2".
Regards,
Rajeev
2020-10-05 06:04 AM
Could you please share more details ? what do you mean by "XTAL"
Cannot find value Xtal (MHz) under project file (UVPROJX) .
Thanks
2020-10-05 06:23 AM
Hello @Khouloud ZEMMELI ,
I am not sure whether you have access to ARM / Keil's MDK-ARM compiler.
Once the IOC file is opened with the STM32CubeMX tool and code generated, a folder named MDK-ARM is created which has a file named USART-Test.uvprojx.
I open this file with help of Keil's IDE. Then in project pane I right click the text USART3-TEST which is next to folder symbol and then click on options for Target 'USART3-Test' (shortcut Alt+F7).
Under Target Tab there is this Xtal (MHz) Text box, which shows the value as 240.0 and not 25.0
I assume the reason for this issue is that the helper file / settings file USART3-Test.uvoptx is being appended with an incorrect tag value:
<CLKADS>240000000</CLKADS>
which should rather be:
<CLKADS>25000000</CLKADS>
Regards,
Rajeev
2020-10-05 06:30 AM
Keil IDE informs:
Xtal (MHz)
Specifies the XTAL frequency of your device. XTAL is used to configure the debugger and Flash programmer. Note that XTAL reflects the main oscillator externally connected to the device.
2020-10-16 02:59 AM
Hello @Rajeev Arora
It's not an issue, the Xtal value takes always the HCLK frequency ( not the Sysclk freq) to ensure the proper synchronisation and functioning of the project, you can change this value if you want (as the case of MicroLIB , you change it at the end of your config project ).
Best Regards,
Khouloud
2020-10-16 03:11 AM
Hello @Khouloud ZEMMELI ,
As per information shared by Keil and the snapshot I've shared, I am of a different opinion, and my opinion matches with what ARM / Keil has informed.
I am of the opinion that STM32CubeMX must update the INPUT FREQUENCY VALUE passed to HSE (set in Clock configuration menu) as value for TAG CLKADS which is present with UVOPTX file (which the STM32CubeMX generated when informed compiler is MDK-ARM (minimum version 5)).
Xtal (MHz)
Specifies the XTAL frequency of your device. XTAL is used to configure the debugger and Flash programmer. Note that XTAL reflects the main oscillator externally connected to the device.
Please refer to attachment.
Regards,
Rajeev
2020-10-16 03:26 AM
@Rajeev Arora I'll make a double check so, then I'll back to you.
Regards,
Khouloud