Example: quiz answers

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.

STM32 microcontroller debug toolbox Introduction STM32 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 users.

Tags:

  Microcontrollers, Toolbox, Debug, Stm32, 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.

2 Table 1. Applicable products TypeSub classMicrocontrollersSTM32 High Performance MCUsSTM32 Mainstream MCUsSTM32 Ultra Low Power Rev 3 Contents1 Foreword .. 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.

3 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 .. via UART .. via SWO/SWV.

4 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.

5 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 .. 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.

6 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.

7 34 Figure Vision Code Optimization option .. 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.

8 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 .. 60 Figure -M3 SCB_CCR Description .. 61 Figure SCB_CFSR Description .. 61 Figure EWARM exception handling .. 62 Figure System Control and Configure.

9 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.

10 78 Figure ITM stimulus Port 0 in STM32 CubeIDE .. 79 Figure Trace button in STM32 CubeIDE .. 79 Figure configuration in IAR EWARM .. 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.