You are here

Setting up a development environment on Ubuntu 16.04 and later LTS releases

Submitted by benjamin on Wed, 2018-01-24 10:16

This guide describes how to set up a development environment on Ubuntu 16.04 and later for working with the VESC firmware and VESC Tool. Open a terminal and follow along...

Start by updating the system and installing some required packages:

sudo apt update
sudo apt upgrade
sudo apt install build-essential openocd git libudev-dev qt-sdk

Now install the gcc-arm-embedded toolchain (see this page for more details)

sudo add-apt-repository ppa:team-gcc-arm-embedded/ppa

press Y, enter, then

sudo apt update
sudo apt install gcc-arm-embedded

now add udev rules to use the stlink v2 programmer without beeing root

wget vedder.se/Temp/49-stlinkv2.rules
sudo mv 49-stlinkv2.rules /etc/udev/rules.d/
sudo udevadm trigger

At this point you should be able to clone the firmware from github, build it and upload it. Let's give it a try

git clone https://github.com/vedderb/bldc.git vesc_firmware
cd vesc_firmware
make

by default this will build firmware for hardware version 6. To change the hardware version, open conf_general.h and change it to use the hardware version that you have. For example, for HW 4.12 it should look like this

/*
 * Select only one hardware version
 */
#if !defined(HW_VERSION_40) && !defined(HW_VERSION_45) && !defined(HW_VERSION_46) && \
	!defined(HW_VERSION_48) && !defined(HW_VERSION_49) && !defined(HW_VERSION_410) && \
	!defined(HW_VERSION_60) && !defined(HW_VERSION_R2) && !defined(HW_VERSION_VICTOR_R1A) && \
	!defined(HW_VERSION_DAS_RS) && !defined(HW_VERSION_PALTA) && !defined(HW_VERSION_RH) && \
	!defined(HW_VERSION_TP)
//#define HW_VERSION_40
//#define HW_VERSION_45
//#define HW_VERSION_46 // Also for 4.7
//#define HW_VERSION_48
//#define HW_VERSION_49
#define HW_VERSION_410 // Also for 4.11 and 4.12
//#define HW_VERSION_60
//#define HW_VERSION_R2
//#define HW_VERSION_VICTOR_R1A
//#define HW_VERSION_DAS_RS
//#define HW_VERSION_PALTA
//#define HW_VERSION_RH
//#define HW_VERSION_TP
#endif

there are also many other options that can be changed in conf_general.h. To rebuild the firmware after the changes, run

make

now connect the stlink v2 programmer, connect power from a lab power supply and try to upload the firmware

make upload

It should say verified ok towards the end if everything went well.

VESC Tool

In order to build VESC Tool you need a recent version of the Qt SDK. Go to https://www.qt.io/download and get Qt Open Source. You should get a file called something like qt-unified-linux-x64-3.0.2-online.run. Set the executable flag of the file and install it as root to get a system-wide installation

cd Downloads
chmod +x qt-unified-linux-x64-3.0.2-online.run
sudo ./qt-unified-linux-x64-3.0.2-online.run

follow the instructions to finish the installation. You might also need the following packages:

sudo apt install mesa-common-dev libgl1-mesa-dev libglu1-mesa-dev

At this point you should be able to clone the source code for VESC Tool and build it.

git clone https://github.com/vedderb/vesc_tool.git vesc_tool

It is recommended to open the project file from Qt Creator (which you should have after the previous step) and build the project from there. Instructions for building the android version will be added later.

Comments

For those struggling with essay writing, I’ve found an amazing website that provides exceptional writing services. Their professional writers are experienced in various academic fields and can produce essays that are both engaging and well-researched. This 99 papers.com service ensures that your essays are delivered on time and meet all your academic requirements. It’s a fantastic resource for students seeking reliable writing assistance.

However, standing out in a saturated market requires more than just creating great music. I found a service that could be a game-changer for those looking to make an impact on Beatport. https://promosoundgroup.net offers a specialized Beatport Top 100 promotion service that is tailored to elevate your track's visibility. Their approach combines targeted promotion with industry insights, ensuring your music reaches the right audience. By leveraging their services, you can increase your chances of making it into the coveted Top 100 and gaining the recognition you deserve.

Dive into the world of Unblocked Games 76 where every game is a new journey. Experience the luxury of premium gameplay, whether you’re playing with family, classmates, or on your own. Unblocked Games 76 transforms your free time into exhilarating adventures, combining passion and class in every session. Discover excitement like never before with Unblocked Games 76!

Pages