Firmware download

1. Firmware download using ST-Link

English
Korean

Supported boards

Make sure you select your board in conf_general.h​
In case of VESCular6 and VESCuino board, we pre-define the "HW_SOURCE" and "HW_HEADER" value using macro command (Board Select Here!!!) as below.
1
#ifndef CONF_GENERAL_H_
2
#define CONF_GENERAL_H_
3
​
4
// Firmware version
5
#define FW_VERSION_MAJOR 5
6
#define FW_VERSION_MINOR 02
7
// Set to 0 for building a release and iterate during beta test builds
8
#define FW_TEST_VERSION_NUMBER 0
9
​
10
#include "datatypes.h"
11
​
12
//cdi - Board Select Here!!!
13
#define HW60_IS_VESCULAR // HW60_IS_VESCULAR, HW60_IS_VESCUINO
14
//#define HW60_IS_VESCUINO
15
​
16
#ifdef HW60_IS_VESCULAR
17
/////////////////////////// HW60_IS_VESCULAR /////////////////////////////////
18
#define HW_SOURCE "hw_60_openrobot_vescular.c"
19
#define HW_HEADER "hw_60_openrobot_vescular.h"
20
#include "hw.h"
21
​
22
// app setting custom precompilation
23
#include "openrobot/appconf_openrobot.h"
24
#define APP_CUSTOM_TO_USE "openrobot/app_openrobot.c"
25
​
26
// motor setting custom precompilation
27
#include "openrobot/mc_header_custom/kitech_motor_ifdef_id_14.h"
28
​
29
//#define USE_CUSTOM_ABI_ENCODER_AT_SPI // If it is enabled, Arduino SPI Communication impossible
30
////////////////////////////////////////////////////////////////////////////////
31
#elif defined(HW60_IS_VESCUINO)
32
#define HW_SOURCE "hw_60_openrobot_vescuino.c"
33
#define HW_HEADER "hw_60_openrobot_vescuino.h"
34
#include "hw.h"
35
​
36
// app setting custom precompilation
37
#include "openrobot/appconf_openrobot.h"
38
#define APP_CUSTOM_TO_USE "openrobot/app_openrobot.c"
39
​
40
// motor setting custom precompilation
41
//#include "openrobot/mc_header_custom/kitech_motor_ifdef_id_14.h"
42
​
43
//#define USE_VESCUINO_UART2
44
#define USE_VESCUINO_ARDUINO_SPI
45
#define USE_I2C_FAST_400KHZ_MODE
46
​
47
// Custom ABI Encoder with HALL/ENC Hybrid commutation using HW SPI Port.
48
// Initial Commutation is done by Hall Sensor and change the commutation to encoder just after index found
49
// Use SPI_MISO(A5):ENC_A, SPI_MOSI(A6):ENC_B, SPI_nCS(A4):ENC_I (VESCUINO VER0.1)
50
// Use SPI_SCK(A5):ENC_A, SPI_MISO(A6):ENC_B, SPI_nCS(A4):ENC_I (VESCUINO VER0.1A, VER0.2)
51
// USE VESC-Tool Setting:
52
// General - Sensor Port Mode (Hall Sensors), General - ABI Encoder Counts (4μ±„λ°°λœ Pulse),
53
// FOC - General - Sensor Mode (Auto Change from Hall to Encoder after index found), FOC - Encoder - Offset & ratio μ„ΈνŒ…λ˜μ–΄μžˆμ–΄μ•Όν•¨.
54
#define USE_CUSTOM_ABI_ENCODER_AT_SPI // If it is enabled, Arduino SPI Communication impossible
55
//#define USE_ENC_CALCULATION_THREAD
56
#endif
57
​
58
// Settings and parameters to override
59
//#define VIN_R1 33000.0
60
//#define VIN_R1 39200.0
61
//#define VIN_R2 2200.0
62
//#define CURRENT_AMP_GAIN 10.0
63
//#define CURRENT_SHUNT_RES 0.005
64
//#define WS2811_ENABLE 1
65
//#define WS2811_TEST 1
66
//#define CURR1_DOUBLE_SAMPLE 0
67
//#define CURR2_DOUBLE_SAMPLE 0
68
//#define AS5047_USE_HW_SPI_PINS 1
69
​
70
// Disable hardware limits on configuration parameters
71
//#define DISABLE_HW_LIMITS
72
​
73
/*
74
* Select only one hardware version, if it is not passed
75
* as an argument.
76
*/
77
#if !defined(HW_SOURCE) && !defined(HW_HEADER)
78
//#define HW_SOURCE "hw_40.c"
79
//#define HW_HEADER "hw_40.h"
80
​
81
//#define HW_SOURCE "hw_45.c"
82
//#define HW_HEADER "hw_45.h"
83
​
84
//#define HW_SOURCE "hw_46.c" // Also for 4.7
85
//#define HW_HEADER "hw_46.h" // Also for 4.7
86
​
87
//#define HW_SOURCE "hw_48.c"
88
//#define HW_HEADER "hw_48.h"
89
​
90
//#define HW_SOURCE "hw_49.c"
91
//#define HW_HEADER "hw_49.h"
92
​
93
//#define HW_SOURCE "hw_410.c" // Also for 4.11 and 4.12
94
//#define HW_HEADER "hw_410.h" // Also for 4.11 and 4.12
95
​
96
// Benjamins first HW60 PCB with PB5 and PB6 swapped
97
//#define HW60_VEDDER_FIRST_PCB
98
​
99
// Mark3 version of HW60 with power switch and separate NRF UART.
100
//#define HW60_IS_MK3
101
//#define HW60_IS_MK4
102
#define HW60_IS_MK5
103
​
104
#define HW_SOURCE "hw_60.c"
105
#define HW_HEADER "hw_60.h"
106
​
107
//#define HW_SOURCE "hw_r2.c"
108
//#define HW_HEADER "hw_r2.h"
109
​
110
//#define HW_SOURCE "hw_victor_r1a.c"
111
//#define HW_HEADER "hw_victor_r1a.h"
112
​
113
//#define HW_SOURCE "hw_das_rs.c"
114
//#define HW_HEADER "hw_das_rs.h"
115
​
116
//#define HW_SOURCE "hw_axiom.c"
117
//#define HW_HEADER "hw_axiom.h"
118
​
119
//#define HW_SOURCE "hw_luna_bbshd.c"
120
//#define HW_HEADER "hw_luna_bbshd.h"
121
​
122
//#define HW_SOURCE "hw_rh.c"
123
//#define HW_HEADER "hw_rh.h"
124
​
125
//#define HW_SOURCE "hw_tp.c"
126
//#define HW_HEADER "hw_tp.h"
127
​
128
// Benjamins first HW75_300 PCB with different LED pins and motor temp error
129
//#define HW75_300_VEDDER_FIRST_PCB
130
​
131
// Second revision with separate UART for NRF51
132
//#define HW75_300_REV_2
133
#define HW75_300_REV_3
134
​
135
//#define HW_SOURCE "hw_75_300.c"
136
//#define HW_HEADER "hw_75_300.h"
137
​
138
//#define HW_SOURCE "hw_mini4.c"
139
//#define HW_HEADER "hw_mini4.h"
140
​
141
//#define HW_SOURCE "hw_das_mini.c"
142
//#define HW_HEADER "hw_das_mini.h"
143
​
144
//#define HW_SOURCE "hw_uavc_qcube.c"
145
//#define HW_HEADER "hw_uavc_qcube.h"
146
​
147
//#define HW_SOURCE "hw_uavc_omega.c"
148
//#define HW_HEADER "hw_uavc_omega.h"
149
​
150
//#define HW_SOURCE "hw_binar_v1.c"
151
//#define HW_HEADER "hw_binar_v1.h"
152
​
153
//#define HW_SOURCE "hw_hd60.c"
154
//#define HW_HEADER "hw_hd60.h"
155
​
156
//#define HW_SOURCE "hw_hd75.c"
157
//#define HW_HEADER "hw_hd75.h"
158
​
159
//#define HW_SOURCE "hw_a200s_v2.c"
160
//#define HW_HEADER "hw_a200s_v2.h"
161
​
162
//#define HW_SOURCE "hw_rd2.c"
163
//#define HW_HEADER "hw_rd2.h"
164
​
165
//#define HW_SOURCE "hw_100_250.c"
166
//#define HW_HEADER "hw_100_250.h"
167
​
168
//#define HW_SOURCE "hw_unity.c"
169
//#define HW_HEADER "hw_unity.h"
170
​
171
//#define HW_SOURCE "hw_uxv_sr.c"
172
//#define HW_HEADER "hw_uxv_sr.h"
173
​
174
//#define HW_DUAL_CONFIG_PARALLEL
175
//#define HW_SOURCE "hw_stormcore_100d.c"
176
//#define HW_HEADER "hw_stormcore_100d.h"
177
​
178
//#define HW_VER_IS_60D_PLUS
179
//#define HW_SOURCE "hw_stormcore_60d.c"
180
//#define HW_HEADER "hw_stormcore_60d.h"
181
​
182
//#define HW_SOURCE "hw_stormcore_100s.c"
183
//#define HW_HEADER "hw_stormcore_100s.h"
184
​
185
//#define HW_SOURCE "hw_Cheap_FOCer_2.c"
186
//#define HW_HEADER "hw_Cheap_FOCer_2.h"
187
​
188
//#define HW_SOURCE "hw_140_300.c"
189
//#define HW_HEADER "hw_140_300.h"
190
​
191
//#define HW_SOURCE "hw_es19.c"
192
//#define HW_HEADER "hw_es19.h"
193
​
194
//#define HW_SOURCE "hw_Little_FOCer.c"
195
//#define HW_HEADER "hw_Little_FOCer.h"
196
#endif
197
​
198
#ifndef HW_SOURCE
199
#error "No hardware source file set"
200
#endif
201
​
202
#ifndef HW_HEADER
203
#error "No hardware header file set"
204
#endif
205
​
206
#ifdef USER_MC_CONF
207
#include USER_MC_CONF
208
#endif
209
​
210
#ifdef USER_APP_CONF
211
#include USER_APP_CONF
212
#endif
Copied!
There are also many other options that can be changed in conf_general.h

Prerequisites

On Ubuntu

Install the gcc-arm-embedded toolchain
1
sudo add-apt-repository ppa:team-gcc-arm-embedded/ppa
2
sudo apt update
3
sudo apt install gcc-arm-embedded
Copied!
Add udev rules to use the stlink v2 programmer without being root
1
wget vedder.se/Temp/49-stlinkv2.rules
2
sudo mv 49-stlinkv2.rules /etc/udev/rules.d/
3
sudo udevadm trigger
Copied!

On MacOS

Go to the GNU ARM embedded toolchain downloads Website and select the mac version, download it and extract it to your user directory.
Append the bin directory to your $PATH. For example:
1
export PATH="$PATH:/Users/your-name/gcc-arm-none-eabi-8-2019-q3-update/bin/"
Copied!
Install stlink and openocd
1
brew install stlink
2
brew install openocd
Copied!

Build

Build and flash the bootloader first
Clone and build the firmware
1
git clone https://github.com/vedderb/bldc.git vesc_firmware
2
cd vesc_firmware
3
make
Copied!
Flash it using an STLink SWD debugger
1
make upload
Copied!
​

2. Firmware upgrade to multiple VESCular6 at once using VESC-Tool

Firmware upgrade to multiple VESCular6 at once using VESC-Tool
​
Last modified 7mo ago