FlexSEA Wiki

A WEARABLE ROBOTICS TOOLKIT

User Tools

Site Tools


manage:software

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
manage:software [2019/10/07 13:12]
jfduval [Overview]
manage:software [2020/05/28 20:44] (current)
jmooney [Windows: Install/download prerequisites]
Line 32: Line 32:
   * Download and install Git Bash https://​gitforwindows.org/​   * Download and install Git Bash https://​gitforwindows.org/​
   * During installation,​ be sure to select the "​Associate .sh files to be run with Bash" at the Select Components screen.   * During installation,​ be sure to select the "​Associate .sh files to be run with Bash" at the Select Components screen.
-  * Open a Git Bash terminal in the desired folder and run the following command:+  * Open a Git Bash terminal in the desired folder and run the following command ​(access required; given on an as needed basis):
   <​code>​git clone --recursive https://​github.com/​DephyInc/​FlexSEA-Embedded-STM.git</​code>​   <​code>​git clone --recursive https://​github.com/​DephyInc/​FlexSEA-Embedded-STM.git</​code>​
  
Line 47: Line 47:
  
 ===== Building Target Applications ===== ===== Building Target Applications =====
-This project is built using CMake so technically it is possible to build directly from the command line using only CMake but below are 3 easier ways to work with the project. If you prefer to use an IDE CLion is a great choice as it is entirely built around using CMake and has a number of great features. ​It is normally $199 but it is possible to get free license ​if you are student or professorhttps://​www.jetbrains.com/​student/​. ​System Workbench from STMicroelectronics also works and has all necessary tools for working with STM32 microcontrollers bundled with the IDE (Eclipse). However Eclipse prefers to generate its own Makefiles so there can be issues using CMake but as of 8/2/2019 we did find a plugin that works fine and instructions are below. The other main option is to build and download the project using the included bash script. This is best if you prefer to use your favorite text editor like Vim, Sublime, etc.+This project is built using CMake so technically it is possible to build directly from the command line using only CMake but below are 3 easier ways to work with the project. 
 + 
 +**Recommended IDE:​** ​If you prefer to use an IDE CLion is a great choice as it is entirely built around using CMake and has a number of great features. ​You can experiment with demo license ​first, then ask your manager for subscription. 
 + 
 +**Free IDE:** System Workbench from STMicroelectronics also works and has all necessary tools for working with STM32 microcontrollers bundled with the IDE (Eclipse). However Eclipse prefers to generate its own Makefiles so there can be issues using CMake but as of 8/2/2019 we did find a plugin that works fine and instructions are below. ​This is only recommended for external clients, not for internal development. 
 + 
 +**Command line (Bash script):​** ​The other main option is to build and download the project using the included bash script. This is best if you prefer to use your favorite text editor like Vim, Sublime, etc.
  
 ==== CLion ==== ==== CLion ====
Line 57: Line 63:
   * Navigate to the FlexSEA-Embedded-STM directory you previously cloned   * Navigate to the FlexSEA-Embedded-STM directory you previously cloned
   * Copy the file named workspace_template.xml in the .idea directory of this repository and rename it workspace.xml (replace the existing workspace.xml file if it exists). Make sure that you now have a file called workspace.xml in the .idea directory, this is where the CMake profiles for different build targets are stored and it is very important to have.   * Copy the file named workspace_template.xml in the .idea directory of this repository and rename it workspace.xml (replace the existing workspace.xml file if it exists). Make sure that you now have a file called workspace.xml in the .idea directory, this is where the CMake profiles for different build targets are stored and it is very important to have.
 +  * Copy the file named local_settings_template.sh in the main project directory of this repository and rename it local_settings.xml (replace the existing local_settings.sh file if it exists). Open it in a text editor and update the toolchain path.
 +  * Download MinGW following this link if you haven'​t downloaded it before
 +  * http://​dephy.com/​wiki/​flexsea/​doku.php?​id=installbuildtoolswindows&​s[]=mingw#​mingw-w64 ​
   * You're now ready to open CLion and finish the setup   * You're now ready to open CLion and finish the setup
     * Open this project in CLion     * Open this project in CLion
Line 65: Line 74:
       * CLion will now restart       * CLion will now restart
     * Once CLion is open again click File -> Settings...     * Once CLion is open again click File -> Settings...
-    ​* Click the Appearance & Behavior tab on the left +      ​* Click the Appearance & Behavior tab on the left 
-    * Click on the Path Variables menu +      * Click on the Path Variables menu 
-    * Click the * symbol on the right to add a new path variable with the following info: +      * Click the * symbol on the right to add a new path variable with the following info: 
-      * Name: TOOLCHAIN_PATH +        * Name: TOOLCHAIN_PATH 
-      * Value: /​path/​to/​the/​toolchain/​gcc-arm-none-eabi-7-2018-q2-update +        * Value: /​path/​to/​the/​toolchain/​gcc-arm-none-eabi-7-2018-q2-update 
-        your path will probably look like "​C:​\toolchains\gcc-arm-none-eabi-7-2018-q2-update"​ or "/​home/​dephy/​toolchains/​gcc-arm-none-eabi-7-2018-q2-update"​+          Your path will probably look like "​C:​\toolchains\gcc-arm-none-eabi-7-2018-q2-update"​ or "/​home/​dephy/​toolchains/​gcc-arm-none-eabi-7-2018-q2-update"​ 
 +  * Run CMake update (within CLion) to confirm that it sees your toolchain
   * Congratulations,​ if you've been diligent in reading these instructions and these instructions are still accurate you should be good to go.   * Congratulations,​ if you've been diligent in reading these instructions and these instructions are still accurate you should be good to go.
 === Building === === Building ===
Line 77: Line 87:
     * You can the select the build target, current options include Exo-rigid2.0-left,​ ActPack-rigid2.0,​ etc.     * You can the select the build target, current options include Exo-rigid2.0-left,​ ActPack-rigid2.0,​ etc.
   * CLion will attempt to compile the project and compile output should appear in the window at the bottom   * CLion will attempt to compile the project and compile output should appear in the window at the bottom
 +=== Build Types === 
 +If you are using CLion, navigate to CMake configuration menu which can be accessed via File→Settings→Build,​Execution,​Deployment→CMake 
 +  * For debug mode 
 +    * Select the profile you are working on and change build type to Debug 
 +  * For release mode 
 +    * Select the profile you are working on and change build type to RelWithDebInfo or MinSizeRel. Due to a known issue, **never pick up Release** here as build type since it causes malfunction. See [[manage:​build_system#​build_type|Build Type]] for more info. 
 +=== Exchanging Build/​Projects Settings === 
 +It is common to exchange your project settings with team members. workspace.xml contains that information in plain text form. Look for the ''<​component name="​CMakeSettings"​ AUTO_RELOAD="​true">''​ section. Add configurations as needed, and save the file. It will auto-reload and the list of projects will be accessible in the CMake settings as well as the drop-wodn Build menu.
 ==== Bash script ==== ==== Bash script ====
 === First Time === === First Time ===
Line 94: Line 111:
   ./​manage_builder.sh Exo-rigid3.0-left   ./​manage_builder.sh Exo-rigid3.0-left
  
-The basic format of the arguments is APP-HARDWARE_PLATFORM but subproject can be added with an additional * symbol as seen in the last example and download can be added to the end of the arguments to also flash a device.+The basic format of the arguments is APP-HARDWARE_PLATFORM but subproject can be added with an additional * symbol as seen in the last example and download can be added to the end of the arguments to also flash a device. For more examples and instructions refer to [[manage:​build_system#​build_firmware|Build Firmware]].
  
 These options can be added as build configurations for CLion or Eclipse. These options can be added as build configurations for CLion or Eclipse.
Line 104: Line 121:
 ==== Windows ==== ==== Windows ====
   * stlink is a command line utility for flashing STM32s   * stlink is a command line utility for flashing STM32s
-  * Download the stlink Windows zip from the following link: https://​github.com/​texane/​stlink/​releases/​tag/​1.3.0+  * Download the stlink Windows zip from the following link: https://​github.com/​stlink-org/​stlink/​releases/​tag/​v1.3.0
   * Extract the contents of the zip file to C:\   * Extract the contents of the zip file to C:\
   * Add the location of the stlink bin folder to the PATH (i.e. C:​\stlink-1.3.0-win64\bin)   * Add the location of the stlink bin folder to the PATH (i.e. C:​\stlink-1.3.0-win64\bin)
Line 131: Line 148:
   <​code>​./​manage_builder.sh Exo-rigid3.0-left download</​code>​   <​code>​./​manage_builder.sh Exo-rigid3.0-left download</​code>​
  
 +===== Setting up and using the debugger in CLion =====
 +
 +Clion fully supports step-by-step debugging using GDB/​OpenOCD/​STLink-v2 or v3.
 +
 +  - Only follow this section after you have completed the general Setup and the CLion Setup steps.
 +  - Settings > Build, Execution, Deployment > Toolchains > set the debugger to be "​arm-none-eabi-gdb.exe"​ with the proper path (ex.: ''​C:​\toolchains\7-2018-q2-update\bin\arm-none-eabi-gdb.exe''​)
 +  - Run/Debug Configurations > OpenOCD Download and Run
 +    * Target and Executable need to be fx-manage
 +    * Pick a board config file. \FlexSEA-Embedded-STM\config\debugging\fx-rigid-f4-openocd.cfg works. Using the Discovery files that came with OpenOCD is also OK.
 +    * User preference, but Download Always and Reset Init work well
 +
 +{{ :​manage:​dbg.png?​400 |}}
 ===== Troubleshooting! ===== ===== Troubleshooting! =====
   * Make sure you made a local_settings.sh file in the root of the repo with the correct path to your compiler.   * Make sure you made a local_settings.sh file in the root of the repo with the correct path to your compiler.
manage/software.1570453941.txt.gz · Last modified: 2019/10/07 13:12 by jfduval