I have not found complete working instructions about how to change and build the VESC firmware, there is a couple helpful videos on YouTube, but those do not work if you follow them to the tee. If you want to experiment with the VESC firmware, settings and algorithms here is how you make it:
1) Download the STM32CubeIDE 1.0.8 (you can register an account on their website to download it or you can download it as a guest filling a form on their website)
2) Unzip the archive with the STM32CubeIDE 1.0.8 and install it with default settings it offers
3) Download GNU arm embedded toolchain 7-2018-q2-update June 27, 2018
Download the GNU Embedded Toolchain for ARM, an open-source suite of tools for C, C++, and Assembly programming for 32-bit ARM Cortex-A, ARM Cortex-M and Cortex-R families
developer.arm.com
4) Install GNU arm embedded toolchain 7-2018-q2-update. Before clicking the "Finish" button check the box "Add path to environment variable". Close the windows popped after the installation.
5) Go to the VESC firmware web page
The VESC motor control firmware. Contribute to vedderb/bldc development by creating an account on GitHub.
github.com
6) Select the version of the firmware you want to download clicking on the button with the branch icon (master (default) is the current work in progress firmware and it can have issues, release_6_06 is current stable version of the firmware, release_6_05 is previous stable version of the firmware and so on). Select the one you need.
7) Download the achieve with the selected firmware source code files clicking the green "Code" button and clicking "Download ZIP"
8) Unzip the downloaded firmware source files. I recommend to unzip it directly on disk C to avoid possible issues with too many subfolders. Here is an example of the unzipped VESC firmware source files.
9) Launch the STN32CubeIDE you installed earlier and click "Launch" button on the popped window
10) Since you did not define the firmware folder yet click File --> New --> Makefile Project with Existing Code
11) Select MCU ARM GCC on the popped window
12) Click the "Browse" button against the Existing Code Location field and select the VESC firmware folder with the source code files you downloaded and unzipped before and click the "Select Folder" button
13) Click the "Finish" button
14) Click the main source code folder (in this example it is bldc-release_6_06) in the Project Explorer with right mouse button and select Properties
15) In the opened menu select C/C++Build --> Behavior. Print
luna_m600_Rev5 in the "Build (Incremental build)" field and click the "Apply" button
16) Under the "C/C++Build" menu click on the "Environment" menu and double click on the "PATH" option. Copy the whole text from the Value field in the opened window to a text editor (click in the field then press Ctrl+A --> Ctrl+C, then click in a text editor and press Ctrl+V)
It should look like this
17) Select the the text from the beginning and up to first ";" sigh and delete it (do not delete the ";" sign)
So it looks like this
19) Copy the path to the bin folder of the Download GNU arm embedded toolchain 7-2018-q2-update you installed earlier. In my case it is
C:\Program Files (x86)\GNU Tools Arm Embedded\7 2018-q2-update\bin
20) Paste the the path to the bin folder of the Download GNU arm embedded toolchain 7-2018-q2-update to the text editor at the beginning of the copied text before the ";" sign
21) Copy the whole text from the text editor (in the text editor window press Ctrl+A --> Ctrl+C) and paste the text into the Value field of the window you opened in the step 16 instead of the existing text (click in the Value field and then press Ctrl+A --> Ctrl+V). Click the button "OK" and then click the "Apply and Close" button. Now you can close the text editor, you do not need it anymore.
Now you finished setting up the STM32CubeIDE and do not need to do this anymore and can work with the code in the VESC firmware files.
See the further instructions in the next post