Skip to content

Commit 5d6999a

Browse files
committed
Merge branch 'devel'
2 parents 429d703 + 54ad5dc commit 5d6999a

31 files changed

+565
-292
lines changed

.travis.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,13 @@ env:
4545
- CONFIG_BOARD_VERSION=v3.4-48V DEPLOY=v3.4-48V
4646
- CONFIG_BOARD_VERSION=v3.5-24V DEPLOY=v3.5-24V
4747
- CONFIG_BOARD_VERSION=v3.5-48V DEPLOY=v3.5-48V
48+
- CONFIG_BOARD_VERSION=v3.6-24V DEPLOY=v3.6-24V
49+
- CONFIG_BOARD_VERSION=v3.6-56V DEPLOY=v3.6-56V
4850

4951
# Various protocol combinations
50-
- CONFIG_BOARD_VERSION=v3.4-24V CONFIG_USB_PROTOCOL=native-stream CONFIG_UART_PROTOCOL=native
51-
- CONFIG_BOARD_VERSION=v3.4-24V CONFIG_USB_PROTOCOL=stdout CONFIG_UART_PROTOCOL=stdout
52-
- CONFIG_BOARD_VERSION=v3.4-24V CONFIG_USB_PROTOCOL=none CONFIG_UART_PROTOCOL=none
52+
#- CONFIG_BOARD_VERSION=v3.4-24V CONFIG_USB_PROTOCOL=native-stream CONFIG_UART_PROTOCOL=native
53+
#- CONFIG_BOARD_VERSION=v3.4-24V CONFIG_USB_PROTOCOL=stdout CONFIG_UART_PROTOCOL=stdout
54+
#- CONFIG_BOARD_VERSION=v3.4-24V CONFIG_USB_PROTOCOL=none CONFIG_UART_PROTOCOL=none
5355

5456
script:
5557
- "./Firmware/build.sh"

CHANGELOG.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,21 @@
11
# Unreleased Features
22
Please add a note of your changes below this heading if you make a Pull Request.
33

4+
### Added
5+
* A release target for ODrive v3.6
6+
* Communication watchdog feature.
7+
* `encoder.set_linear_count(count)` function.
8+
* Configurable encoder offset calibration distance and speed:`calib_scan_distance` and `calib_scan_omega`
9+
* Encoder offset calibration debug variable `calib_scan_response`
10+
* Lock-in drive feature
11+
* Script to enable using a hall signal as index edge.
12+
13+
### Changed
14+
* Encoder index search now based on the new lock-in drive feature
15+
16+
### Fixed
17+
* Encoder index interrupts now disabled when not searching
18+
419
# Releases
520
## [0.4.8] - 2019-02-25
621
### Added
@@ -15,6 +30,9 @@ Please add a note of your changes below this heading if you make a Pull Request.
1530
* Voltage limit soft clamping instead of ERROR_MODULATION_MAGNITUDE in gimbal motor closed loop.
1631
* Thermal current limit with linear derating.
1732

33+
### Changed
34+
* Unified lockin drive modes. Current for index searching and encoder offset calibration now moved to axis.lockin.current.
35+
1836
### Fixed
1937
* Added required 1.5 cycle phase shift between ADC and PWM, lack thereof caused unstable current controller at high eRPM.
2038

Firmware/.vscode/c_cpp_properties.json

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
"${workspaceRoot}",
77
"${workspaceRoot}/fibre/cpp/include/**",
88
"${workspaceRoot}/MotorControl",
9+
"${workspaceRoot}/communication",
910
"${workspaceRoot}/Drivers/DRV8301",
1011
"${workspaceRoot}/Board/v3/Inc",
1112
"${workspaceRoot}/Board/v3/Drivers/CMSIS/Include",
@@ -16,9 +17,7 @@
1617
"${workspaceRoot}/Board/v3/Middlewares/ST/STM32_USB_Device_Library/Class/CDC/Inc",
1718
"${workspaceRoot}/Board/v3/Middlewares/Third_Party/FreeRTOS/Source/CMSIS_RTOS",
1819
"${workspaceRoot}/Board/v3/Middlewares/Third_Party/FreeRTOS/Source/include",
19-
"${workspaceRoot}/Board/v3/Middlewares/Third_Party/FreeRTOS/Source/portable/GCC/ARM_CM4F",
20-
"${ARM_GCC_ROOT}/arm-none-eabi/include/**",
21-
"${ARM_GCC_ROOT}/lib/gcc/arm-none-eabi/**"
20+
"${workspaceRoot}/Board/v3/Middlewares/Third_Party/FreeRTOS/Source/portable/GCC/ARM_CM4F"
2221
],
2322
"defines": [
2423
"STM32F405xx",
@@ -32,14 +31,7 @@
3231
"__GNUC__"
3332
],
3433
"intelliSenseMode": "clang-x64",
35-
"browse": {
36-
"path": [
37-
"${workspaceRoot}",
38-
"${ARM_GCC_ROOT}"
39-
],
40-
"limitSymbolsToIncludedHeaders": true
41-
},
42-
"compilerPath": "${ARM_GCC_ROOT}/bin/arm-none-eabi-gcc.exe -mthumb -mcpu=cortex-m4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard -specs=nosys.specs -specs=nano.specs -u _printf_float -u _scanf_float",
34+
"compilerPath": "\"${ARM_GCC_ROOT}/bin/arm-none-eabi-gcc.exe\" -mthumb -mcpu=cortex-m4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard -specs=nosys.specs -specs=nano.specs -u _printf_float -u _scanf_float",
4335
"cStandard": "c11",
4436
"cppStandard": "c++14"
4537
},
@@ -49,6 +41,7 @@
4941
"${workspaceRoot}",
5042
"${workspaceRoot}/fibre/cpp/include/**",
5143
"${workspaceRoot}/MotorControl",
44+
"${workspaceRoot}/communication",
5245
"${workspaceRoot}/Drivers/DRV8301",
5346
"${workspaceRoot}/Board/v3/Inc",
5447
"${workspaceRoot}/Board/v3/Middlewares/Third_Party/FreeRTOS/Source/portable/GCC/ARM_CM4F",
@@ -92,6 +85,7 @@
9285
"${workspaceRoot}",
9386
"${workspaceRoot}/fibre/cpp/include/**",
9487
"${workspaceRoot}/MotorControl",
88+
"${workspaceRoot}/communication",
9589
"${workspaceRoot}/Drivers/DRV8301",
9690
"${workspaceRoot}/Board/v3/Inc",
9791
"${workspaceRoot}/Board/v3/Middlewares/Third_Party/FreeRTOS/Source/portable/GCC/ARM_CM4F",

Firmware/Board/v3/Src/freertos.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@
6060
#include "usb_device.h"
6161
extern PCD_HandleTypeDef hpcd_USB_OTG_FS;
6262
int odrive_main(void);
63+
int load_configuration(void);
6364
/* USER CODE END Includes */
6465

6566
/* Private typedef -----------------------------------------------------------*/
@@ -187,6 +188,9 @@ void MX_FREERTOS_Init(void) {
187188
sem_usb_tx = osSemaphoreCreate(osSemaphore(sem_usb_tx), 1);
188189

189190
init_deferred_interrupts();
191+
192+
// Load persistent configuration (or defaults)
193+
load_configuration();
190194
/* USER CODE END RTOS_SEMAPHORES */
191195

192196
/* USER CODE BEGIN RTOS_TIMERS */

Firmware/Board/v3/Src/stm32f4xx_it.c

Lines changed: 23 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -91,22 +91,34 @@ void NMI_Handler(void)
9191
/* USER CODE END NonMaskableInt_IRQn 1 */
9292
}
9393

94+
void get_regs(void** stack_ptr) {
95+
void* volatile r0 __attribute__((unused)) = stack_ptr[0];
96+
void* volatile r1 __attribute__((unused)) = stack_ptr[1];
97+
void* volatile r2 __attribute__((unused)) = stack_ptr[2];
98+
void* volatile r3 __attribute__((unused)) = stack_ptr[3];
99+
100+
void* volatile r12 __attribute__((unused)) = stack_ptr[4];
101+
void* volatile lr __attribute__((unused)) = stack_ptr[5]; // Link register
102+
void* volatile pc __attribute__((unused)) = stack_ptr[6]; // Program counter
103+
void* volatile psr __attribute__((unused)) = stack_ptr[7]; // Program status register
104+
105+
volatile bool stay_looping = true;
106+
while(stay_looping);
107+
}
108+
94109
/**
95110
* @brief This function handles Hard fault interrupt.
96111
*/
112+
__attribute__((naked))
97113
void HardFault_Handler(void)
98114
{
99-
/* USER CODE BEGIN HardFault_IRQn 0 */
100-
101-
/* USER CODE END HardFault_IRQn 0 */
102-
while (1)
103-
{
104-
/* USER CODE BEGIN W1_HardFault_IRQn 0 */
105-
/* USER CODE END W1_HardFault_IRQn 0 */
106-
}
107-
/* USER CODE BEGIN HardFault_IRQn 1 */
108-
109-
/* USER CODE END HardFault_IRQn 1 */
115+
__asm(
116+
" tst lr, #4 \n\t"
117+
" ite eq \n\t"
118+
" mrseq r0, msp \n\t"
119+
" mrsne r0, psp \n\t"
120+
" b get_regs \n\t"
121+
);
110122
}
111123

112124
/**

Firmware/Makefile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,10 @@ erase:
4040
erase_config:
4141
$(OPENOCD) -c init -c reset\ halt -c flash\ erase_address\ 0x80C0000\ 0x40000 -c reset\ init -c reset\ run -c exit
4242

43+
# Sometimes the STM32 will get it's protection bits set for unknown reasons. Unlock it with this command
44+
unlock:
45+
$(OPENOCD) -c init -c reset\ halt -c stm32f2x\ unlock\ 0
46+
4347
# The one-time programmable memory stores the board version
4448
# has the following format:
4549
# - OTP format version (0xFE: version 1)

0 commit comments

Comments
 (0)