From 3607f5fe03eeb56600ab521fb104f7c872c3eeb3 Mon Sep 17 00:00:00 2001 From: Kenn Sebesta Date: Sun, 6 Mar 2022 10:32:02 -0500 Subject: [PATCH] [README] Update README.md instructions --- README.md | 178 ++++++++++++++++++------------------------------------ 1 file changed, 59 insertions(+), 119 deletions(-) diff --git a/README.md b/README.md index 0bd0cb88..f547e700 100644 --- a/README.md +++ b/README.md @@ -17,155 +17,94 @@ This is the source code for the VESC DC/BLDC/FOC controller. Read more at All of them! -Make sure you select your board in [conf_general.h](conf_general.h) +Check the supported boards by typing `make` - -```c -//#define HW_SOURCE "hw_40.c" -//#define HW_HEADER "hw_40.h" - -//#define HW_SOURCE "hw_45.c" -//#define HW_HEADER "hw_45.h" - -//#define HW_SOURCE "hw_46.c" // Also for 4.7 -//#define HW_HEADER "hw_46.h" // Also for 4.7 - -//#define HW_SOURCE "hw_48.c" -//#define HW_HEADER "hw_48.h" - -//#define HW_SOURCE "hw_49.c" -//#define HW_HEADER "hw_49.h" - -//#define HW_SOURCE "hw_410.c" // Also for 4.11 and 4.12 -//#define HW_HEADER "hw_410.h" // Also for 4.11 and 4.12 - -#define HW_SOURCE "hw_60.c" -#define HW_HEADER "hw_60.h" - -//#define HW_SOURCE "hw_r2.c" -//#define HW_HEADER "hw_r2.h" - -//#define HW_SOURCE "hw_victor_r1a.c" -//#define HW_HEADER "hw_victor_r1a.h" - -//#define HW_SOURCE "hw_das_rs.c" -//#define HW_HEADER "hw_das_rs.h" - -//#define HW_SOURCE "hw_axiom.c" -//#define HW_HEADER "hw_axiom.h" - -//#define HW_SOURCE "hw_rh.c" -//#define HW_HEADER "hw_rh.h" - -//#define HW_SOURCE "hw_tp.c" -//#define HW_HEADER "hw_tp.h" - -//#define HW_SOURCE "hw_75_300.c" -//#define HW_HEADER "hw_75_300.h" - -//#define HW_SOURCE "hw_mini4.c" -//#define HW_HEADER "hw_mini4.h" - -//#define HW_SOURCE "hw_das_mini.c" -//#define HW_HEADER "hw_das_mini.h" - -//#define HW_SOURCE "hw_uavc_qcube.c" -//#define HW_HEADER "hw_uavc_qcube.h" - -//#define HW_SOURCE "hw_uavc_basic.c" -//#define HW_HEADER "hw_uavc_basic.h" ``` -There are also many other options that can be changed in conf_general.h +[Firmware] + fw - Build firmware for default target + supported boards are: 100_250 100_250_no_limits 100_500... +``` + +There are also many other options that can be changed in [conf_general.h](conf_general.h). ## Prerequisites -### On Ubuntu - -Install the gcc-arm-embedded toolchain. Recommended version ```gcc-arm-none-eabi-7-2018-q2``` - -**Method 1 - Through Official GNU Arm Embedded Toolchain Downloads** -1. Go to [GNU Arm Embedded Toolchain Downloads](https://developer.arm.com/tools-and-software/open-source-software/developer-tools/gnu-toolchain/gnu-rm/downloads) -2. Locate and Download version **gcc-arm-none-eabi-7-2018-q2** for your machine - ```GNU Arm Embedded Toolchain: 7-2018-q2-update June 27, 2018``` - Linux 64-bit version can be downloaded from [here](https://developer.arm.com/-/media/Files/downloads/gnu-rm/7-2018q2/gcc-arm-none-eabi-7-2018-q2-update-linux.tar.bz2?revision=bc2c96c0-14b5-4bb4-9f18-bceb4050fee7?product=GNU%20Arm%20Embedded%20Toolchain,64-bit,,Linux,7-2018-q2-update) -3. Unpack the archive in the file manager by right-clicking on it and select "extract here" -4. Change directory to the unpacked folder, unpack it in /usr/local by execute the following command - ``` - cd gcc-arm-none-eabi-7-2018-q2-update-linux - sudo cp -RT gcc-arm-none-eabi-7-2018-q2-update/ /usr/local - ``` - -**Method 2 - Through apt install** -```bash -sudo add-apt-repository ppa:team-gcc-arm-embedded/ppa -sudo apt update -sudo apt install gcc-arm-embedded -``` - - -**Optional - Add udev rules to use the stlink v2 programmer without being root** -```bash -wget vedder.se/Temp/49-stlinkv2.rules -sudo mv 49-stlinkv2.rules /etc/udev/rules.d/ -sudo udevadm trigger -``` - -### On MacOS - -Go to the [GNU ARM embedded toolchain downloads Website](https://developer.arm.com/tools-and-software/open-source-software/developer-tools/gnu-toolchain/gnu-rm/downloads) and select the mac version, download it and extract it to your user directory. - -Append the bin directory to your **$PATH**. For example: - - -```bash -export PATH="$PATH:/Users/your-name/gcc-arm-none-eabi-8-2019-q3-update/bin/" -``` - -Install stlink and openocd - +### On Ubuntu (Linux)/macOS +- Tools: `git`, `wget, `make`, `python3`, and `pip` +- Additional Linux requirements: `libgl-dev` and `libxcb-xinerama0` +- Helpful macOS tools: ```bash brew install stlink brew install openocd ``` -## Build -Clone and build the firmware +### On Windows +- MS Visual Compiler +- Chocolately: https://chocolatey.org/install +- Powershell: https://docs.microsoft.com/en-us/powershell/scripting/install/installing-powershell-on-windows +- Git: https://git-scm.com/download/win. Make sure to click any boxes to add Git to your Environment (aka PATH) +- Python 3: https://www.python.org/downloads/. Make sure to click the box to add Python3 to your Environment. +## Install Dev environment and build + +### On Ubuntu (Linux)/MacOS +Open up a terminal +1. `pip install aqtinstall` +5. `git clone http://github.com/vedderb/bldc.git` +6. `cd bldc` +6. Continue with [On all platforms](#on-all-platforms) + +### On Windows + +3. Open up a Powershell terminal (Resist the urger to run Powershell as administrator, that will break things) +4. Type `choco install make` +4. `pip install aqtinstall` +5. `git clone http://github.com/vedderb/vesc_tool` +6. `cd bldc` +6. Unzip the file at https://discordapp.com/channels/904830990319485030/910181652192448532/917451210791989248 into this directory +6. Continue with [On all platforms](#on-all-platforms) + +### On all platforms + +7. `git checkout origin/master` +8. `make arm_sdk_install` +9. `make qt_install` +10. `make` <-- Pick out the name of your target device from the supported boards list. For instance, I have a Trampa **VESC 100/250**, so my target is `100_250` +11. `make 100_250` <-- This will build the **VESC 100/250** firmware and place it into the `bldc/builds/100_250/` directory + + +## Other tools + +**Linux Optional - Add udev rules to use the stlink v2 programmer without being root** ```bash -git clone https://github.com/vedderb/bldc.git vesc_firmware -cd vesc_firmware -make +wget vedder.se/Temp/49-stlinkv2.rules +sudo mv 49-stlinkv2.rules /etc/udev/rules.d/ +sudo udevadm trigger ``` + ## Upload to VESC ### Method 1 - Flash it using an STLink SWD debugger -Build and flash the [bootloader](https://github.com/vedderb/bldc-bootloader) first - +1. Build and flash the [bootloader](https://github.com/vedderb/bldc-bootloader) first +2. Then `_flash` to the target of your choice. So for instance, for the VESC 100/250: ```bash -make upload +make 100_250_flash ``` + ### Method 2 - Upload Firmware via VESC tool through USB -1. Clone and build the firmware in **.bin** format +1. Clone and build the firmware in **.bin** format as in the above Build instructions -Reminder : Remember to select your board in [**conf_general.h**] - -```bash -git clone https://github.com/vedderb/bldc.git vesc_firmware -cd vesc_firmware -#make build/your_firmware_name_here.bin -make build/VESC_fw.bin -``` In VESC tool 2. Connect to the VESC 3. Navigate to the Firmware tab on the left side menu 4. Click on Custom file tab -5. Click on the folder icon to select the built firmware in .bin format (e.g. VESC_fw.bin) +5. Click on the folder icon to select the built firmware in .bin format (e.g. `build/100_250/100_250.bin`) ##### [ Reminder : It is normal to see VESC disconnects during the firmware upload process ] ##### **[ Warning : DO NOT DISCONNECT POWER/USB to VESC during the upload process, or you will risk bricking your VESC ]** @@ -183,6 +122,7 @@ However, to upload a firmware to a bricked VESC, you have to use a SWD Debugger. ## Contribute Head to the [forums](https://vesc-project.com/forum) to get involved and improve this project. +Join the [Discord](https://discord.gg/JgvV5NwYts) for real-time support and chat ## License