




版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
1、UM1718User manualSTM32CubeMX for STM32 configuration and initialization C code generationIntroductionSTM32CubeMX is a graphical tool for 32-bit ARM Cortex STM32 microcontrollers. It is part of STMCube initiative (see Section 1) and is available either as a standalone application or as an Eclipse plu
2、g-in for integration in Integrated Development Environments (IDEs).STM32CubeMX has the following key features:Easy microcontroller selection covering whole STM32 portfolio. Board selection from a list of STMicroelectronics boards.Easy microcontroller configuration (pins, clock tree, peripherals, mid
3、dleware) and generation of the corresponding initialization C code.Easy switching to another microcontroller belonging to the same series by importing a previously-saved configuration to a new MCU project.Generation of configuration reports.Generation of IDE ready projects for a selection of integra
4、ted development environment tool chains. STM32CubeMX projects include the generated initialization C code, STM32 HAL drivers, the middleware stacks required for the user configuration, and all the relevant files needed to open and build the project in the selected IDE.Power consumption calculation f
5、or a user-defined application sequence. Self-updates allowing the user to keep the STM32CubeMX up-to-date.Download and update of STM32Cube embedded software required for userapplication development (see Appendix E: STM32Cube embedded software packagesfor details on STM32Cube embedded software offer)
6、.Although STM32CubeMX offers a user interface and generates a C code compliant with STM32 MCU design and firmware solutions, it is recommended to refer to the product technical documentation for details on actual implementation of microcontroller peripherals and firmware.Reference documentsThe follo
7、wing documents are available from :STM32 microcontroller reference manuals STM32 microcontroller datasheetsSTM32Cube HAL driver user manuals for STM32F0 (UM1785), STM32F1 (UM1850), STM32F2 (UM1940), STM32F3 (UM1786), STM32F4 (UM1725), STM32F7 (UM1905), STM32L0 (UM1749), STM32L1 (UM18
8、16) and STM32L4 (UM1884).May 2016DocID025776 Rev 151/231ContentsUM1718Contents1STM32Cube overview132Getting started with STM32CubeMXPrinciples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Key features . . . . . . . . . . . . .
9、. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Rules and limitations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .1416173Installing and running STM32CubeMX . . . . . . . . . . . . . . . . . . . . . . . . .183.1System requirements.23.1.3
10、Supported operating systems and architectures18Memory prerequisites18Software requirements183.2Installing/uninstalling STM32CubeMX standalone version.23.2.3Installing STM32CubeMX standalone version18Installing STM32CubeMX from command line19Uninstalling STM32CubeMX standalone version223.3I
11、nstalling STM32CubeMX plug-in version.23.3.3Downloading STM32CubeMX plug-in installation package22Installing STM32CubeMX as an Eclipse IDE plug-in23Uninstalling STM32CubeMX as Eclipse IDE plug-in243.4Launching STM32CubeMX2.23.4.3Running STM32CubeMX as standalone application26Runni
12、ng STM32CubeMX in command-line mode26Running STM32CubeMX plug-in from Eclipse IDE283.5Getting STM32Cube updates30..4Updater configuration31Downloading new libraries34Removing libraries36Checking for updates374STM32CubeMX User Interface384.14.2Welcome page38New project window392/231D
13、ocID025776 Rev 15UM1718Contents4.34.4Main window42Toolbar and menus4..44.4.5File menu45Project menu46Pinout menu46Window menu48Help menu484.5Output windows4.2MCUs selection pane49Output pane4Import Project window . . . . . . . . . . . . . . . . . . . . . . . . .
14、. . . . . . . . . . . . . .Set unused / Reset used GPIOs windows . . . . . . . . . . . . . . . . . . . . . . . .Project Settings window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .50565.24.8.3Project tab60Code Generator tab61Advanced Settings tab61U
15、pdate Manager windows . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .About window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Pinout view . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
16、 . .66676IP tree pane69Chip view70Chip view advanced actions73Keep Current Signals Placement75Pinning and labeling signals on pins76Setting HAL timebase source774.12Configuration view8IP and Middleware Configuration window85Us
17、er Constants configuration window87GPIO Configuration window92DMA Configuration window95NVIC Configuration window97FreeRTOS middleware configuration view1054.13Clock tree configuration view1Clock tree configuration functions111Recommendations116STM32F43x/42x power-over drive feat
18、ure117DocID025776 Rev 153/231ContentsUM17184.13.4Clock tree glossary1194.14Power Consumption Calculator (PCC) view14.5Building a power consumption sequence120Configuring a step in the power sequence127Managing user-defined power sequence and reviewing results131Power seq
19、uence step parameters glossary134Battery glossary1375STM32CubeMX C Code generation overview1385.15.2Standard STM32Cube code generation138Custom code generation14.25.2.3STM32CubeMX data model for FreeMarker user templates141Saving and selecting user templates141Custom code generation1426Tuto
20、rial 1: From pinout to project C code generationusing an STM32F4 MCU14Creating a new STM32CubeMX Project . . . . . . . . . . . . . . . . . . . . . . . .Configuring the MCU pinout . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Saving the project . . . . . . . .
21、. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Generating the report . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Configuring the MCU Clock tree . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Configuring the MCU initialization paramet
22、ers . . . . . . . . . . . . . . . . . . . .14514814915015015..46.6.5Initial conditions153Configuring the peripherals154Configuring the GPIOs157Configuring the DMAs158Configuring the middleware1596.7Generating a complete C project16.2Setting project options162Downloading fi
23、rmware package and generating the C code1646.86.9Building and updating the C code project169Switching to another MCU1747Tutorial 2 - Example of FatFs on an SD card usingSTM32429I-EVAL evaluation board1764/231DocID025776 Rev 15UM1718Contents8Tutorial 3- Using PCC to optimize the embeddedapplication p
24、ower consumption and more18Tutorial overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Application example description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Using the Power Consumption Calculator . . . . . . . . . . . . . . .
25、. . . . . . . .18318418.2Creating a PCC sequence184Optimizing application power consumption1879FAQ1959.1On the Pinout configuration pane, why does STM32CubeMXmove some functions when I add a new peripheral mode? . . . . . . . . . .How can I manually force a function remapping? . . . . . . .
26、 . . . . . . . . . .Why are some pins highlighted in yellow or in light green in the Chip view? Why cannot I change the function of somepins (when I click some pins, nothing happens)? . . . . . . . . . . . . . . . . . .Why do I get the error “Java 7 update 45 when installingJava 7 update 45 or a mor
27、e recent version of the JRE? . . . . . . . . . . .Why does the RTC multiplexer remain inactive on the Clock tree view?How can I select LSE and HSE as clock source andchange the frequency? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Why STM32CubeMX does not allow me to
28、configure PC13,PC14, PC15 and PI8 as outputs when one of themis already configured as an output? . . . . . . . . . . . . . . . . . . . . . . . . . . . .1951959.29.31959.41951969.59.61979.7197Appendix AA.1A.2A.3A.4A.5A.6STM32CubeMX pin assignment rules . . . . . . . . . . . . . . . . . . . . . .Block
29、 consistency . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Block inter-dependency. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .One block = one peripheral mode. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Block remapping (
30、STM32F10x only). . . . . . . . . . . . . . . . . . . . . . . . . . . .Function remapping. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Block shifting (only for STM32F10x and when“Keep Current Signals placement” is unchecked). . . . . . . . . . . . . . . . . .Setting
31、 and clearing a peripheral mode. . . . . . . . . . . . . . . . . . . . . . . . . .Mapping a function individually . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .GPIO signals mapping . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .19819820220520520620720820820
32、8A.7A.8A.9DocID025776 Rev 155/231ContentsUM1718Appendix BSTM32CubeMX C code generation designchoices and limitations209B.1B.2B.3STM32CubeMX generated C code and user sections . . . . . . . . . . . . . .STM32CubeMX design choices for peripheral initialization . . . . . . . . . .STM32CubeMX design cho
33、ices and limitations formiddleware initialization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .209209210B.3.1B.3.2B.3.3B.3.4B.3.5B.3.6Overview210USB Host211USB Device211FatFs211FreeRTOS212LwIP213Appendix CSTM32 microcontrollers naming conventions215Appendix DSTM32 microco
34、ntrollers power consumption parameters217D.1Power modes217D.1.1D.1.2D.1.3STM32L1 series217STM32F4 series218STM32L0 series219D.2Power consumption ranges220D.2.1D.2.2D.2.3STM32L1 series feature 3 VCORE ranges220STM32F4 series feature several VCORE scales221STM32L0 series feature 3 VCORE ranges221Appen
35、dix ESTM32Cube embedded software packages22210Revision history2236/231DocID025776 Rev 15UM1718List of tablesList of tablesTable 1.Table 2.Table 3.Table 4.Table 5.Table 6.Table 7.Table 8.Table 9.Table 10.Table 11.Table 12.Table 13.Table 14.Table 15.Table 16.Command line summary27Welcome page shortcut
36、s39File menu functions45Project menu46Pinout menu47Window menu48Help menu48IP tree pane - icons and color scheme69STM32CubeMX Chip view - Icons and color scheme.71IP configuration buttons84IP Configuration window buttons and tooltips86Clock tree view widget115Voltage scaling versus power over-drive
37、and HCLK frequency118Relations between power over-drive and HCLK frequency118Glossary119Document revision history. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 223DocID025776 Rev 157/231List of figuresUM1718List of figuresFigure 1.Figure 2.Figure 3.Fi
38、gure 4.Figure 5.Figure 6.Figure 7.Figure 8.Figure 9.Figure 10.Figure 11.Figure 12.Figure 13.Figure 14.Figure 15.Figure 16.Figure 17.Figure 18.Figure 19.Figure 20.Figure 21.Figure 22.Figure 23.Figure 24.Overview of STM32CubeMX C code generation flow15Example of STM32CubeMX installation in interactive
39、 mode20STM32Cube Installation Wizard21Auto-install command line22Adding STM32CubeMX plug-in archive23Installing STM32CubeMX plug-in24Closing STM32CubeMX perspective24Uninstalling STM32CubeMX plug-in25Opening Eclipse plug-in29STM32CubeMX perspective29Displaying Windows default proxy settings30Updater
40、 Settings window31Connection Parameters tab - No proxy32Connection Parameters tab - Use System proxy parameters33Connection Parameters tab - Manual Configuration of Proxy Server34New library Manager window35Removing libraries36Removing library confirmation message37Library deletion progress window37
41、STM32CubeMX Welcome page38New Project window - MCU selector40New Project window - board selector41STM32CubeMX Main window upon MCU selection42STM32CubeMX Main window upon board selection(Peripheral default option unchecked)43STM32CubeMX Main window upon board selection(Peripheral default option chec
42、ked)44Pinout menus (Pinout tab selected)46Pinout menus (Pinout tab not selected)47MCU selection menu49Output pane50Error message obtained when importing from different series50Automatic project import51Manual project import52Import Project menu - Try import with errors54Import Project menu - Success
43、ful import after adjustments55Set unused pins window56Reset used pins window56Set unused GPIO pins with Keep Current Signals Placement checked57Set unused GPIO pins with Keep Current Signals Placement unchecked58Project Settings window59Project folder60Project Settings Code Generator63Template Setti
44、ngs window64Generated project template65Advanced Settings window66About window67STM32CubeMX Pinout view68Figure 25.Figure 26.Figure 27.Figure 28.Figure 29.Figure 30.Figure 31.Figure 32.Figure 33.Figure 34.Figure 35.Figure 36.Figure 37.Figure 38.Figure 39.Figure 40.Figure 41.Figure 42.Figure 43.Figur
45、e 44.Figure 45.Figure 46.8/231DocID025776 Rev 15UM1718List of figuresFigure 47.Figure 48.Figure 49.Figure 50.Figure 51.Figure 52.Figure 53.Figure 54.Figure 55.Figure 56.Figure 57.Figure 58.Figure 59.Figure 60.Figure 61.Figure 62.Figure 63.Figure 64.Figure 65.Figure 66.Chip view70Red highlights and t
46、ooltip example: no mode configuration available72Orange highlight and tooltip example: some configurations unavailable73Tooltip example: all configurations unavailable73Modifying pin assignments from the Chip view73Example of remapping in case of block of pins consistency74Pins/Signals Options windo
47、w77Selecting a HAL timebase source (STM32F407 example)78TIM2 selected as HAL timebase source78NVIC settings when using systick as HAL timebase, no FreeRTOS79NVIC settings when using FreeRTOS and SysTick as HAL timebase80NVIC settings when using freeRTOS and TIM2 as HAL timebase82STM32CubeMX Configur
48、ation view83Configuration window tabs for GPIO, DMA and NVIC settings (STM32F4 series)84IP Configuration window (STM32F4 series)85User Constants window87Extract of the generated mxconstants.h file87Using constants for peripheral parameter settings88Specifying user constant value and name89Deleting u
49、ser constant not allowed whenconstant already used for another constant definition89Deleting a user constant used for parameter configuration-Confirmation request90Deleting a user constant used for peripheral configuration -Consequence on peripheral configuration90Searching user constants list for n
50、ame91Searching user constants list for value91GPIO Configuration window - GPIO selection92GPIO Configuration window - displaying GPIO settings93GPIO configuration grouped by IP94Multiple Pins Configuration94Adding a new DMA request95DMA Configuration96DMA MemToMem configuration97NVIC Configuration t
51、ab - FreeRTOS disabled98NVIC Configuration tab - FreeRTOS enabled99I2C NVIC Configuration window99NVIC Code generation All interrupts enabled101NVIC Code generation Interrupt initialization sequence configuration103NVIC Code generation IRQ Handler generation104FreeRTOS configuration view105FreeRTOS:
52、 configuring tasks and queues106FreeRTOS: creating a new task107FreeRTOS - Configuring timers, mutexes and semaphores108FreeRTOS Heap usage110STM32F429xx Clock Tree configuration view114Clock Tree configuration view with errors114Clock tree configuration: enabling RTC, RCC Clock sourceand outputs fr
53、om Pinout view116Clock tree configuration: RCC Peripheral Advanced parameters117Power Consumption Calculator default view120Battery selection121Figure 67.Figure 68.Figure 69.Figure 70.Figure 71.Figure 72.Figure 73.Figure 74.Figure 75.Figure 76.Figure 77.Figure 78.Figure 79.Figure 80.Figure 81.Figure
54、 82.Figure 83.Figure 84.Figure 85.Figure 86.Figure 87.Figure 88.Figure 89.Figure 90.Figure 91.Figure 92.Figure 93.Figure 94.DocID025776 Rev 159/231List of figuresUM1718Figure 95.Figure 96.Figure 97.Figure 98.Figure 99.Building a power consumption sequence122Step management functions122Power consumption sequence: new step default view123Edit Step window124Enabling the transition checker option on an already configured sequence -all transitions valid125Enabling the transition checker op
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 健康运动幼儿托班:助力幼儿快乐成长
- 胰岛素瘤循证护理
- 小班保护五官健康
- 野外生存教育
- 正交试验设计方法
- 大学生体育与心理健康
- 新加坡初等教育体系概览
- 新生儿肛周脓肿的护理
- 2025年山东省东营市中考招生考试数学真题试卷
- 预防跌倒护理课件
- 《3-6岁儿童学习与发展指南》考试参考题库120题(含答案)
- 诊所中药饮片清单
- 零信任安全架构-第1篇
- 《发酵饲料的应用》课件
- 物业客服主管的角色与职责解析
- 国家开放大学2023年7月期末统一试《22417客户关系管理》试题及答案-开放专科
- 西式面点师(高级)课件 项目4 甜品制作
- 鼎捷T100-V1.0-销售管理用户手册-简体
- 抗生素的合理应用-专业知识讲座培训课件
- 港式清单模板
- “三高共管、六病同防”工作实践10-40-16
评论
0/150
提交评论