#22 Frequency selection not complete for STM32F4 Template

Next Release
closed
None
5
2013-12-10
2013-11-22
Hampus Sandberg
No

I'm not sure if this should be considered a bug or if it's an unimplemented/unnecessary feature.

When setting the frequency for the STM32F4 template it will only create a preprocessor symbol for HSE_VALUE but to get everything to work correctly one must set PLL_M, PLL_N, etc values in the system_stm32f4xx.c file.

So for me when using a 8MHz crystal I need to set PLL_N to 8 instead of the default 25.

plug-in version: 1.1.6-201311220955
eclipse version: 2.0.1.20130919-0803
os: windows 7

Discussion

1 2 > >> (Page 1 of 2)
  • one must set PLL_M, PLL_N, etc values in the system_stm32f4xx.c file.

    that's correct.

    do you have any suggestions on how to pass the PLL settings? currently ST recommends to use the XLS application to perform the computation and generate an updated system_stm32f4xx.c file.

    the comment in main.c mentions the need to set these values, but does not go into details on how to do it.

    any suggestions are highly appreciated.

     
    • status: open --> open-accepted
    • assigned_to: Liviu Ionescu (ilg)
     
  • I don't have a good solution unfortunately besides editing the system_stm32f4xx.c file manually. Though it might be helpful to put some kind of text when creating a new template project which tells the user to check and change the values according to their selected frequency.

     
  • I made some changes to the templates, mainly the PLL_M is set to HSE_VALUE/1000000. for usual HSE_VALUEs this should produce running configurations.

    the beta version is available from:

    http://gnuarmeclipse.sourceforge.net/updates-test

    could you test it and let me know if it works for you and if the text in main.c is appropriate?

     
    Last edit: Liviu Ionescu (ilg) 2013-12-10
  • It works good on my STM32F4 Discovery Board using a 8MHz crystal so it will produce a running config as you say which is great!

    Maybe it's my Eclipse setup but the first comment with the explanation for the PLL was hidden/minimized or whatever it's called. Otherwise I think the note is explanatory enough!

     
    • the first comment with the explanation for the PLL was hidden/minimized

      yeah, this is the Eclipse default setting, it is called 'folding' and you can configure it in the Preferences -> C/C++ -> Editor window.

       
  • Nice touch with the preprocessor check! Hopefully that will help catch user who need to change the PLL settings.

     
    • :-)

       
  • do you have any other suggestions? if not, can we close this ticket?

     
  • Feels like this solution fixes any problems that might occur so I'd say we can close it now!
    Thanks for the help!

     
1 2 > >> (Page 1 of 2)