Download STM32CubeMX for STM32 configuration and initialization C code
Transcript
Contents UM1718 6.1 Creating a new STM32CubeMX Project . . . . . . . . . . . . . . . . . . . . . . . . . 79 6.2 Configuring the MCU pinout . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82 6.3 Saving the project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83 6.4 Generating the report . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84 6.5 Configuring the MCU Clock tree . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84 6.6 Configuring the MCU initialization parameters . . . . . . . . . . . . . . . . . . . . . 87 6.7 6.8 6.6.1 Initial conditions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87 6.6.2 Configuring the peripherals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88 6.6.3 Configuring the GPIOs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89 6.6.4 Configuring the DMAs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90 6.6.5 Configuring the middleware . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91 Generating a complete C project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94 6.7.1 Setting project options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94 6.7.2 Downloading firmware package and generating the C code . . . . . . . . . 95 Building and updating the C code project . . . . . . . . . . . . . . . . . . . . . . . . . 99 7 Tutorial 2 - Generating GPIO initialization C code (STM32F1/L1 series only) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103 8 Tutorial 3 - Getting power consumption results for a user-defined sequence . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 106 8.1 9 4/140 Creating a new power sequence . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 106 8.1.1 Adding a step . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107 8.1.2 Moving a step . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107 8.1.3 Deleting a step . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107 8.2 Configuring a step in the power sequence . . . . . . . . . . . . . . . . . . . . . . . 108 8.3 Reviewing results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 108 FAQ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111 9.1 On the Pinout configuration panel, why does STM32CubeMX move some functions when I add a new peripheral mode? . . . . . . . . . . . 111 9.2 How can I manually force a function remapping? . . . . . . . . . . . . . . . . . . 111 9.3 Why are some pins highlighted in yellow or in light green in the Chip view? Why cannot I change the function of some pins (when I click some pins, nothing happens)? . . . . . . . . . . . . . . . . . . . 111 9.4 Why do I get the error “Java 7 update 45’ when installing ‘Java 7 update 45’ or a more recent version of the JRE? . . . . . . . . . . . . 111 DocID025776 Rev 4