Example: bankruptcy

STM32 microcontroller debug toolbox - Application note

January 2021AN4989 Rev 31/1181AN4989 Application noteSTM32 microcontroller debug toolboxIntroductionSTM32 end-users are sometimes confronted with non- or partially-functional systems during product development. The best approach to use for the debug process is not always obvious, particularly for inexperienced address the above concerns, this Application note provides a toolbox describing the most common debug techniques and their Application to popular recommended IDEs for STM32 32-bit Arm Cortex MCUs. It contains detailed information for getting started as well as hints and tips to make the best use of STM32 software Development Tools in STM32 Application note applies to the microcontrollers listed in Ta b l e 1. Table 1. Applicable products TypeSub classMicrocontrollersSTM32 High Performance MCUsSTM32 Mainstream MCUsSTM32 Ultra Low Power Rev 3 Contents1 Foreword.

STMicroelectronics and its part ners are providing a full hardw are and software ecosystem to support rapid evaluation, prototyping, and productizing of complete systems using STM32 microcontrollers. As presented in Figure 1, the ecosystem is composed of all the collaterals required to develop a project with STM32. Figure 1. STM32 ecosystem ...

Tags:

  Software, Microcontrollers, Toolbox, Debug, Stm32, Ners, Stm32 microcontroller debug toolbox

Information

Domain:

Source:

Link to this page:

Please notify us if you found a problem with this document:

Other abuse

Advertisement

Transcription of STM32 microcontroller debug toolbox - Application note

1 January 2021AN4989 Rev 31/1181AN4989 Application noteSTM32 microcontroller debug toolboxIntroductionSTM32 end-users are sometimes confronted with non- or partially-functional systems during product development. The best approach to use for the debug process is not always obvious, particularly for inexperienced address the above concerns, this Application note provides a toolbox describing the most common debug techniques and their Application to popular recommended IDEs for STM32 32-bit Arm Cortex MCUs. It contains detailed information for getting started as well as hints and tips to make the best use of STM32 software Development Tools in STM32 Application note applies to the microcontrollers listed in Ta b l e 1. Table 1. Applicable products TypeSub classMicrocontrollersSTM32 High Performance MCUsSTM32 Mainstream MCUsSTM32 Ultra Low Power Rev 3 Contents1 Foreword.

2 Information .. versions .. 82 STM32 ecosystem outlines .. development tools .. kits .. probe .. debugger probes .. development tools .. IDEs .. software .. and sharing .. platform .. Community .. Education .. 323 Compiling for debug .. EWARM .. MDK-Arm Vision .. information .. EWARM .. -MDK-Arm Vision .. 39AN4989 Rev 33/118AN4989 Contents44 Connecting to the board .. pinout .. and connection mode .. EWARM .. MDK-Arm VISION .. case .. 505 Breaking and stepping into code .. support for timers, RTC, watchdog, BxCAN and I2C .. performance .. EWARM .. MDK-Arm VISION .. platform limitation .. 566 Exception handling .. weak Handlers .. Handlers .. div/0 exception .. -M0/M0+ case .. -M3/4/7 case .. 617 Printf debugging .. Virtual COM port driver.

3 Via UART .. via SWO/SWV .. EWARM .. MDK-Arm VISION .. 81 ContentsAN49894/118AN4989 Rev 38 debug through hardware exploration .. pinout probing with STMicroelectronics hardware kits .. clock output (MCO) .. with STM32 CubeMX .. Series differences .. 909 Dual-Core microcontroller debugging .. 9210 From debug to release .. 9311 Troubleshooting .. 94 Appendix A Managing DBGMCU registers.. software .. debugger .. 96 Appendix B Use Nucleo cuttable ST-LINK as stand-alone VCP .. 106 Appendix C Managing various targets on the same PC .. 109 Appendix D Cortex -M debug capabilities reminder .. notes index ..116 Revision history .. 117AN4989 Rev 35/118AN4989 List of tables5 List of tablesTable products .. 1 Table software pack .. 19 Table documentation guide .. 30 Table Series RDP protection extension.

4 56 Table USART vs. PC terminal WordLength example.. 71 Table .. 94 Table Series vs. debug capabilties .. 116 Table Series vs. debug capabilities .. 116 Table revision history .. 117 List of figuresAN49896/118AN4989 Rev 3 List of figuresFigure ecosystem overview .. 9 Figure tools overview .. 10 Figure , Nucleo-64 and Nucleo-32 boards.. 10 Figure Nucleo-144 structure .. 11 Figure board example .. 12 Figure board example .. 13 Figure .. 14 Figure , ST-LINK/V2, and ST-LINK/V2-ISOL stand-alone probes .. 16 Figure .. 16 Figure ST-LINK-V3 on Nucleo .. 17 Figure software development .. 20 Figure Configure and code generation .. 21 Figure .. 22 Figure programmer .. 26 Figure monitor.. 28 Figure screenshot .. 29 Figure connected to STM32 world .. 29 Figure EWARM Optimization option .. 34 Figure Vision Code Optimization option.

5 35 Figure optimization level setting .. 36 Figure EWARM Generate debug Information option.. 37 Figure debug Information option .. 38 Figure debug information option .. 39 Figure pins PA13 and PA14 in Reset state under STM32 CubeMX .. 40 Figure pins PA13 and PA14 in Reserved but inactive state under STM32 CubeMX .. 41 Figure pins PA13 and PA14 in Active State under STM32 CubeMX.. 41 Figure Mode in : screenshot .. 43 Figure and Reset option Keil .. 44 Figure hotplug step1 .. 45 Figure hotplug step2 .. 46 Figure hotplug step3 .. 47 Figure Generator Options Reset Mode .. 48 Figure Reset mode .. 49 Figure Connection mode .. 49 Figure EWARM ST-LINK SWD Speed setting .. 52 Figure SWD Speed Setting.. 53 Figure to Generator Options in STM32 CubeIDE .. 54 Figure for Handler code generation .. 58 Figure Access to Show Caller Code in Contextual menu.

6 60 Figure -M3 SCB_CCR Description .. 61 Figure SCB_CFSR Description .. 61 Figure EWARM exception handling .. 62 Figure System Control and Configure.. 63 Figure Fault Reports .. 64 Figure SCB register access .. 65 Figure Analyzer in STM32 CubeIDE .. 66 Figure COM port on Windows PC .. 68AN4989 Rev 37/118AN4989 List of figures7 Figure Pinout configuration with STM32 CubeMX .. 69 Figure setting with STM32 CubeMX .. 70 Figure Pin configuration with STM32 CubeMX .. 72 Figure configuration with IAR EWARM .. 73 Figure EWARM SWO Clock setting .. 74 Figure configuration with Keil .. 75 Figure to SWV in Keil .. 75 Figure SWD in STM32 CubeIDE .. 77 Figure SWV ITM Data Console in STM32 CubeIDE.. 78 Figure ITM stimulus Port 0 in STM32 CubeIDE .. 79 Figure Trace button in STM32 CubeIDE .. 79 Figure configuration in IAR EWARM.

7 80 Figure for semihosting in STM32 CubeIDE- Source Location .. 81 Figure for semihosting in STM32 CubeIDE- Librairies .. 82 Figure for semihosting in STM32 CubeIDE .. 82 Figure in STM32 CubeIDE debug configuration .. 84 Figure in STM32 CubeIDE Startup .. 85 Figure in STM32 CubeIDE Run .. 86 Figure pin selection in STM32 CubeMX .. 87 Figure alternate pin highlight exemple with L073 .. 88 Figure Multiplexer in STM32 CubeMX Clock Configuration Pane .. 89 Figure dual MCO capabilities .. 91 Figure Register LL Library Functions.. 95 Figure HAL Library Functions .. 96 Figure to DBGMCU register with IAR EWARM .. 97 Figure C-SPY Macro script setting .. 98 Figure DBGMCU register in Keil MDK-Arm Vision (1/2).. 99 Figure DBGMCU register in Keil MDK-Arm Vision (2/2)) .. 100 Figure Initialization script setting.. 101 Figure to Generator Options in STM32 CubeIDE.

8 102 Figure Options debug MCU in STM32 CubeIDE .. 103 Figure to DBGMCU settings with STM32 CubeIDE .. 104 Figure R/W access to DBGMCU register with SSTM32 CubeIDE .. 105 Figure cuttable part of Nucleo .. 106 Figure ST-LINK stand-alone part of Nucleo-L476RG as VCP .. 107 Figure COM port on PC side .. 108 Figure target selection pick list .. 109 Figure target ST-LINK S/N from the console.. 110 Figure EWARM debug Probe Selection pop-up window .. 110 Figure EWARM debug Probe Selection with nickname .. 111 Figure selection prompt setting on IAR EWARM .. 111 Figure ST-LINK selection .. 112 Figure message for multiple ST-LINK detected in STM32 CubeIDE .. 113 Figure specific ST-LINK S/N with STM32 CubeIDE with OpenOCD option.. 114 Figure specific ST-LINK S/N with STM32 CubeIDE with ST-LINK GDB server.. 115 ForewordAN49898/118AN4989 Rev 31 General informationThis document applies to STM32 32-bit Arm Cortex :Arm is a registered trademark of Arm Limited (or its subsidiaries) in the US and/or elsewhere.

9 software versionsThe various examples in this Application note are illustrated on basis of the following versions of the tools: IAR EWARM: Keil MDK-Arm Vision: STM32 CubeIDE: STM32 CubeProg: Acronyms AN: Application note CMSIS: Cortex microcontroller software interface standard HAL:Hardware abstraction layer ( software library) IDE: Integrated development environment JTAG: Joint Test Action Group MCO: microcontroller clock output MCU: microcontroller unit NVIC: Nested vector interrupt controller PM: Programming manual RM: Reference manual SB: Solder bridge SWD: Serial wire debug SWO: Single wire output SWV: Single wire viewer VCP: Virtual COM portAN4989 Rev 39/118AN4989 STM32 ecosystem outlines1172 STM32 ecosystem outlinesSTMicroelectronics and its partners are providing a full hardware and software ecosystem to support rapid evaluation, prototyping, and productizing of complete systems using STM32 presented in Figure 1, the ecosystem is composed of all the collaterals required to develop a project with 1.

10 STM32 ecosystem overviewThis chapter provides a global overview of the main elements composing the ecosystem, outlining debug features and useful pointers, in order to guide the user among available Hardware development toolsThis section introduces the range of available development tools from hardware kits to ST-LINK probes and alternative debugger Hardware kitsThis section lists the hardware kits provided by STMicroelectronics for STM32 -based development: Nucleo boards Discovery kits Evaluation boards (EVAL) STM32 Nucleo expansion Third-party boardsSTM32 ecosystem outlinesAN498910/118AN4989 Rev 3 Figure 2. Development tools overviewSTM32 NucleoSTM32 Nucleo boards are affordable solutions for user willing to try out new ideas and to quickly create prototypes based on STM32 3. Nucleo-144, Nucleo-64 and Nucleo-32 boardsSTM32 Nucleo boards feature the same connectors.


Related search queries