Skip to main content
hmc
Associate III
February 23, 2018
Question

STM32CubeMX config question

  • February 23, 2018
  • 5 replies
  • 1661 views
Posted on February 23, 2018 at 22:56

Hello,

There are 2 things I do not understand about my Nucleo-FRM32F042K6 project (attached take1.ioc).  As you can see, I turned off everything except the SWD and USB.

0690X00000609gvQAA.png 

I want to use the HSI48 for USB, and run everything else off the HSI, without the PLL.  In Mr. Noviello's ''Mastering STM32'' book section 10.1.2 Configuraing Clock Tree Using CubeMX, he uses 8 MHz for APB1 peripheral clock just like I did, but my CubeMX marks the box as red.  So far, I haven't found an explanation.

0690X00000609MIQAY.png

And why does CubeMX want to generate GPIO code, when I am not using any GPIO?

0690X00000609nzQAA.png

Thanks for reading!

    This topic has been closed for replies.

    5 replies

    Bogdan Golab
    Lead
    February 23, 2018
    Posted on February 23, 2018 at 23:19

    You checked: 'set All pins as analog' in code generator option - that's why all unused pins are configured

    Bogdan Golab
    Lead
    February 23, 2018
    Posted on February 23, 2018 at 23:42

    It seems that the dependency is on USB - when you disable USB the 8MHz on APB1 is accepted.

    Cannot find any relevant limitation in the datasheet.

    hmc
    hmcAuthor
    Associate III
    February 23, 2018
    Posted on February 23, 2018 at 23:53

    Thanks for the quick reply Bogdan,

    So is it cheaper to choose HSI48 into the clock mux (SW) and divide by 4 to run everything at 12 MHz, or to turn on PLL to generate a 16 MHz from 8 MHz?  The power consumption calculator doesn't have an option for HSI48 into the clock mux...