Difference between revisions of "STM32CubeIDE"
(10 intermediate revisions by the same user not shown) | |||
Line 3: | Line 3: | ||
<!-- /*********************************************************************************************************/ --> | <!-- /*********************************************************************************************************/ --> | ||
<span style="background:#00FF00;color:#FF0000;font-size:300%"></span> | <span style="background:#00FF00;color:#FF0000;font-size:300%"></span> | ||
− | |||
__TOC__ | __TOC__ | ||
<!-- /*********************************************************************************************************/ --> | <!-- /*********************************************************************************************************/ --> | ||
Line 66: | Line 65: | ||
<cl> | <cl> | ||
1. '''variables''' - opening this view while stopped in an active function will reveal variable values and update them as you step through. | 1. '''variables''' - opening this view while stopped in an active function will reveal variable values and update them as you step through. | ||
− | *'''Breakpoints''' -This view shows active breakpoints and their locations. It also allows you to toggle them off and on and delete them. | + | * '''Breakpoints''' -This view shows active breakpoints and their locations. It also allows you to toggle them off and on and delete them. |
− | *'''expressions''' -Type in an expression (a variable or an equation of variables and constants) and this view will evaluate them for you. | + | * '''expressions''' -Type in an expression (a variable or an equation of variables and constants) and this view will evaluate them for you. |
− | *'''live expression''' - Updates expression values while the code is running ('live'). Only available with Segger J-link | + | * '''live expression''' - Updates expression values while the code is running ('live'). Only available with Segger J-link |
− | *'''SFRs''' - shows values of peripheral registers | + | * '''SFRs''' - shows values of peripheral registers |
</cl> | </cl> | ||
− | Other views are available by navigating to the top of the window and | + | Other views are available by navigating to the top of the window and selection '''Window->Show View''' and selecting one of the available views. |
+ | ===Setting Breakpoints=== | ||
+ | Breakpoints are set by opening a file in debug perspective and double clicking the line number at which you'd like to place your breakpoint. A blue circle with a checkmark should appear to the left of the line number-This indicates a breakpoint has been set successfully. | ||
+ | [[File:breakpoint.png]]</br> | ||
+ | The breakpoint can be turned off by double clicking line, or by deleting it through the breakpoint view. | ||
− | |||
+ | === STM32CubeMX and Code Generation === | ||
+ | Code generation will result if the projects '''.ioc''' file is modified. Double clicking this file will open it through the STM32CubeMX perspective. There the pinout of the device, configured peripherals, middlewares, and clock information will be available. 'Modification' of the baseline settings is not recommended, though 'additions' by the user should be fine. This feature may be used for configuring header pins in alternate function modes (Something other than ANALOG, INPUT, or OUTPUT). Or configuring various other options. After modifying the .ioc file (Changing the setting in STM32CubeMX), code can be generated by clicking the build symbol on the tool bar. | ||
− | |||
− | |||
− | + | {{note|Generation of code will result in the build settings and source folders having to be reset through the IDE. Items needing to be re-set include # Symbols (MACROS), Includes and Source Locations located at ''Properties->C/C++ General->Paths and Symbols''. These can be uploaded by importing EMACsettings.xml. This will upload the necessary symbols and includes. Source locations will have to be manually added on an individual folder basis or by selecting ''Source Location->Add Folder-><root folder>'' and clicking ''OK'', then ''Apply and Close'' }} | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | These | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | < | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
+ | {{:Templateimpl:whatnext | initials=BS | title=Getting Started with the EMAC OE SDK | desc=Basic tutorial for using the EMAC OE SDK. | project=OE 5.0 }} | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | + | [[ Getting Started with CutiPy and FreeRTOS | Getting Started with CutiPy and FreeRTOS ]] | |
− | + | [[CutiPy FreeRTOS Documentation | CutiPy FreeRTOS Documentation]] | |
− | [[ | + | [[FreeRTOS | FreeRTOS]] |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− |
Latest revision as of 08:54, 24 March 2020
Contents
Intro
STM32CubeIDE is an all in one integrated development environment, possessing MCU Pin Configuration, Middleware selection, code generation, compilation, build analysis, and debugging capabilities. It is based on the ECLIPSE™/CDT framework and GCC toolchain for the development, and GDB for the debugging. It allows the integration of the hundreds of existing plugins that complete the features of the ECLIPSE™ IDE. A full product description is given HERE.
STM32CubeIDE is used for CutiPy FreeRTOS development. Essential feature descriptions are given below.
Supported Systems
Windows®, Linux®, and macOS®, 64-bit versions only
Download
STM32CubeIDE can be downloaded HERE
Importing a Project
After intalling STM32CubeIDE to your development machine and downloading an EMAC STM32Cube Project (Like CutiPy_FreeRTOS), import the project as follows:
-
Open the STM32CubeIDE and navigate to the Project Explorer window. Right click in the empty window and select Import..., to open the Import window.
-
Select General->Existing Projects into Workdspace and click Next> to advance.
-
Now select Browse and navigated to the folder containing the dowloaded project. The project will appear in the Projects: box. Check the box next to the project name, and then select Finish, the project will then be imported.
Building and Upload
Setup
-
Connect the ST-Link programmer to the board for programming
-
Power on your board
-
If needed, upgrade your ST-LINK firmware by navigating to Help and selecting ST-LINK Upgrade. The ST Link upgrade window will open. Select refresh device list, and then select Open in update mode, and finally Upgrade
The project now ready to be built and uploaded.
Build and Upload
The project can be built by selecting the hammer symbol on the upper toolbar. The selected build can also be toggled by clicking on the down arrow next to the hammer. The default options available are Debug (a build with debug symbols, and optimizations turned off), and Release (a build with optimizations ON and no debug sybols). The project can be built and uploaded by selecting the green bug symbol. After upload this will automatically launch the debug perspective, from which debugging can commence.
NOTE |
In current release of the IDE there is no 'upload without launching debug perspective' option available. ALL uploads are accomplished by the green debug symbol, but meaningful debugging can only be accomplished through upload of a Debug build. |
Debugging
Debugging is accomplished by building and uploading a Debug build. This done by selecting the Debug build with the down arrow next to the hammer symbol, then selecting the green bug symbol for upload. The debug perspective should launch automatically. if not the debug perspective can be selected by clicking the green bug symbol in the right hand corner.
Debug Perspective
The debug perspective makes available debug options like start, stop, reset, breakpoint set and reset, step into, step over, etc. The following items on the upper tool bar are of particular use:
From left to right these symbol accomplish the following:
-
Reset the chip and restart the debug session
-
Skip all breakpoints
-
Terminate and relaunch, This kills the debug session and re uploads the firmware
-
Resume (The play symbol), This option becomes available when code execution is suspended. Selecting this option resumes/continues code execution until the next breakpoint is encountered.
-
Suspend (The pause symbol), This option becomes available while the code is running (after clicking Resume), Selecting this option pauses code at the next line to be executed.
-
Terminate kills the debug session
-
Disconnect disconnects from the current debug session
-
Step into -Steps into a function
-
Step Over Steps over the current line of code
-
Return If in a function, this option will exit the function and stop at the next line to be executed (continue and stop)
In the upper right hand corner of the debug perspective are additional debug views. From top to bottom these are:
-
variables - opening this view while stopped in an active function will reveal variable values and update them as you step through.
-
Breakpoints -This view shows active breakpoints and their locations. It also allows you to toggle them off and on and delete them.
-
expressions -Type in an expression (a variable or an equation of variables and constants) and this view will evaluate them for you.
-
live expression - Updates expression values while the code is running ('live'). Only available with Segger J-link
-
SFRs - shows values of peripheral registers
Other views are available by navigating to the top of the window and selection Window->Show View and selecting one of the available views.
Setting Breakpoints
Breakpoints are set by opening a file in debug perspective and double clicking the line number at which you'd like to place your breakpoint. A blue circle with a checkmark should appear to the left of the line number-This indicates a breakpoint has been set successfully.
The breakpoint can be turned off by double clicking line, or by deleting it through the breakpoint view.
STM32CubeMX and Code Generation
Code generation will result if the projects .ioc file is modified. Double clicking this file will open it through the STM32CubeMX perspective. There the pinout of the device, configured peripherals, middlewares, and clock information will be available. 'Modification' of the baseline settings is not recommended, though 'additions' by the user should be fine. This feature may be used for configuring header pins in alternate function modes (Something other than ANALOG, INPUT, or OUTPUT). Or configuring various other options. After modifying the .ioc file (Changing the setting in STM32CubeMX), code can be generated by clicking the build symbol on the tool bar.
NOTE |
Generation of code will result in the build settings and source folders having to be reset through the IDE. Items needing to be re-set include # Symbols (MACROS), Includes and Source Locations located at Properties->C/C++ General->Paths and Symbols. These can be uploaded by importing EMACsettings.xml. This will upload the necessary symbols and includes. Source locations will have to be manually added on an individual folder basis or by selecting Source Location->Add Folder-><root folder> and clicking OK, then Apply and Close |