From cc287d7a48bd5b2c09870d0594ab22e90c4b66b0 Mon Sep 17 00:00:00 2001 From: Oskar Weigl Date: Sun, 4 Mar 2018 01:57:29 -0800 Subject: [PATCH 1/9] add include-fixed to VSCode include --- Firmware/.vscode/c_cpp_properties.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Firmware/.vscode/c_cpp_properties.json b/Firmware/.vscode/c_cpp_properties.json index 150b7c96..b337bc20 100644 --- a/Firmware/.vscode/c_cpp_properties.json +++ b/Firmware/.vscode/c_cpp_properties.json @@ -20,6 +20,7 @@ "c:/program files (x86)/gnu tools arm embedded/6 2017-q1-update/arm-none-eabi/include/c++/6.3.1/arm-none-eabi", "c:/program files (x86)/gnu tools arm embedded/6 2017-q1-update/arm-none-eabi/include/c++/6.3.1/backward", "c:/program files (x86)/gnu tools arm embedded/6 2017-q1-update/lib/gcc/arm-none-eabi/6.3.1/include", + "c:/program files (x86)/gnu tools arm embedded/6 2017-q1-update/lib/gcc/arm-none-eabi/6.3.1/include-fixed", "c:/program files (x86)/gnu tools arm embedded/6 2017-q1-update/arm-none-eabi/include" ], "defines": [ @@ -76,7 +77,7 @@ } }, { - "name": "MacOS", + "name": "Mac", "includePath": [ "${workspaceRoot}", "${workspaceRoot}/Middlewares/Third_Party/FreeRTOS/Source/portable/GCC/ARM_CM4F", From 37ebf8fbce40614baa0260b83c2bae2bae7cbca1 Mon Sep 17 00:00:00 2001 From: Oskar Weigl Date: Sun, 4 Mar 2018 02:05:41 -0800 Subject: [PATCH 2/9] update Readme of release --- Firmware/CHANGELOG.md | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/Firmware/CHANGELOG.md b/Firmware/CHANGELOG.md index 7c9738c1..fd6fb20b 100644 --- a/Firmware/CHANGELOG.md +++ b/Firmware/CHANGELOG.md @@ -1,16 +1,20 @@ -## UNRELEASED -Please add a note of your changes below this heading if you make a PR +# Unreleased Features +Please add a note of your changes below this heading if you make a Pull Request. + +# Releases + +## [0.3.5] - 2018-03-04 ### Added * Reporting error if your encoder CPR is incorrect +* Ability to start anticogging calibration over USB protocol * Reporting of DRV status/control registers and fault codes * DRV status read script * Microsecond delay function -* Ability to start anticogging calibration over USB protocol * Travis-CI ### Changed -* Build system is now tup instead of make +* Build system is now tup instead of make. Please check the [Readme](README.md#installing-prerequisites) for installation instructions. ## [0.3.4] - 2018-02-13 From 4e4d1ae49137e3ea507a09faa4a57a9308632a2e Mon Sep 17 00:00:00 2001 From: Oskar Weigl Date: Sun, 4 Mar 2018 02:24:16 -0800 Subject: [PATCH 3/9] Update .travis.yml --- .travis.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index 531bce18..ccbd6015 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,10 +3,10 @@ language: c sudo: false -addons: - apt: - packages: - libc6-i386 +addons: + apt: + packages: + libc6-i386 cache: directories: From 01aedc2eea14aa87ce001113af30400d3d1c3a77 Mon Sep 17 00:00:00 2001 From: Oskar Weigl Date: Mon, 5 Mar 2018 17:34:12 -0800 Subject: [PATCH 4/9] Update commands.cpp --- Firmware/MotorControl/commands.cpp | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/Firmware/MotorControl/commands.cpp b/Firmware/MotorControl/commands.cpp index 22d08a6c..2de98a46 100644 --- a/Firmware/MotorControl/commands.cpp +++ b/Firmware/MotorControl/commands.cpp @@ -298,6 +298,19 @@ const Endpoint endpoints[] = { Endpoint::make_function("set_current_setpoint", &motors_1_set_current_setpoint_func), Endpoint::make_property("current_setpoint", &motors[1].set_current_setpoint_args.current_setpoint), Endpoint::close_tree(), + Endpoint::make_object("timing_log"), + Endpoint::make_property("TIMING_LOG_GENERAL", &motors[1].timing_log[TIMING_LOG_GENERAL]), + Endpoint::make_property("TIMING_LOG_ADC_CB_M0_I", &motors[1].timing_log[TIMING_LOG_ADC_CB_M0_I]), + Endpoint::make_property("TIMING_LOG_ADC_CB_M0_DC", &motors[1].timing_log[TIMING_LOG_ADC_CB_M0_DC]), + Endpoint::make_property("TIMING_LOG_ADC_CB_M1_I", &motors[1].timing_log[TIMING_LOG_ADC_CB_M1_I]), + Endpoint::make_property("TIMING_LOG_ADC_CB_M1_DC", &motors[1].timing_log[TIMING_LOG_ADC_CB_M1_DC]), + Endpoint::make_property("TIMING_LOG_MEAS_R", &motors[1].timing_log[TIMING_LOG_MEAS_R]), + Endpoint::make_property("TIMING_LOG_MEAS_L", &motors[1].timing_log[TIMING_LOG_MEAS_L]), + Endpoint::make_property("TIMING_LOG_ENC_CALIB", &motors[1].timing_log[TIMING_LOG_ENC_CALIB]), + Endpoint::make_property("TIMING_LOG_IDX_SEARCH", &motors[1].timing_log[TIMING_LOG_IDX_SEARCH]), + Endpoint::make_property("TIMING_LOG_FOC_VOLTAGE", &motors[1].timing_log[TIMING_LOG_FOC_VOLTAGE]), + Endpoint::make_property("TIMING_LOG_FOC_CURRENT", &motors[1].timing_log[TIMING_LOG_FOC_CURRENT]), + Endpoint::close_tree(), Endpoint::close_tree(), // motor1 Endpoint::make_function("save_configuration", &save_configuration), // no arguments @@ -308,19 +321,6 @@ const Endpoint endpoints[] = { Endpoint::make_function("reboot", &NVIC_SystemReset), // no arguments Endpoint::close_tree(), - Endpoint::make_object("timing_log"), - Endpoint::make_property("TIMING_LOG_GENERAL", &motors[1].timing_log[TIMING_LOG_GENERAL]), - Endpoint::make_property("TIMING_LOG_ADC_CB_M0_I", &motors[1].timing_log[TIMING_LOG_ADC_CB_M0_I]), - Endpoint::make_property("TIMING_LOG_ADC_CB_M0_DC", &motors[1].timing_log[TIMING_LOG_ADC_CB_M0_DC]), - Endpoint::make_property("TIMING_LOG_ADC_CB_M1_I", &motors[1].timing_log[TIMING_LOG_ADC_CB_M1_I]), - Endpoint::make_property("TIMING_LOG_ADC_CB_M1_DC", &motors[1].timing_log[TIMING_LOG_ADC_CB_M1_DC]), - Endpoint::make_property("TIMING_LOG_MEAS_R", &motors[1].timing_log[TIMING_LOG_MEAS_R]), - Endpoint::make_property("TIMING_LOG_MEAS_L", &motors[1].timing_log[TIMING_LOG_MEAS_L]), - Endpoint::make_property("TIMING_LOG_ENC_CALIB", &motors[1].timing_log[TIMING_LOG_ENC_CALIB]), - Endpoint::make_property("TIMING_LOG_IDX_SEARCH", &motors[1].timing_log[TIMING_LOG_IDX_SEARCH]), - Endpoint::make_property("TIMING_LOG_FOC_VOLTAGE", &motors[1].timing_log[TIMING_LOG_FOC_VOLTAGE]), - Endpoint::make_property("TIMING_LOG_FOC_CURRENT", &motors[1].timing_log[TIMING_LOG_FOC_CURRENT]), - Endpoint::close_tree(), }; // clang-format on From 6474f279d7d48e79407b9cf1b127cca5a13b232a Mon Sep 17 00:00:00 2001 From: Quincy Jones Date: Mon, 5 Mar 2018 19:50:33 -0600 Subject: [PATCH 5/9] Fix microsecond timer delay code. --- Firmware/Board/v3.3/Inc/main.h | 2 ++ Firmware/MotorControl/utils.c | 8 ++++---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/Firmware/Board/v3.3/Inc/main.h b/Firmware/Board/v3.3/Inc/main.h index a9650093..ddba7ca8 100644 --- a/Firmware/Board/v3.3/Inc/main.h +++ b/Firmware/Board/v3.3/Inc/main.h @@ -69,6 +69,8 @@ #define TIM_APB1_CLOCK_HZ 84000000 #define TIM_APB1_PERIOD_CLOCKS 4096 #define TIM_APB1_DEADTIME_CLOCKS 40 +#define TIM_BASE_TIMER TIM14 + #define M0_nCS_Pin GPIO_PIN_13 #define M0_nCS_GPIO_Port GPIOC diff --git a/Firmware/MotorControl/utils.c b/Firmware/MotorControl/utils.c index 032a996a..2782b517 100644 --- a/Firmware/MotorControl/utils.c +++ b/Firmware/MotorControl/utils.c @@ -187,13 +187,13 @@ uint32_t timeout_to_deadline(uint32_t timeout_ms) { // @brief: Returns number of microseconds since system startup uint32_t micros(void) { - uint32_t usTicks = HAL_RCC_GetSysClockFreq() / 1000000; register uint32_t ms, cycle_cnt; do { ms = HAL_GetTick(); - cycle_cnt = SysTick->VAL; - } while (ms != HAL_GetTick()); - return (ms * 1000) + (usTicks * 1000 - cycle_cnt) / usTicks; + cycle_cnt = TIM_BASE_TIMER->CNT; + } while (ms != HAL_GetTick()); + + return (ms * 1000) + cycle_cnt; } // @brief: Busy wait delay for given amount of microseconds (us) From 56c7557007321c2407e753e3e2b5e72123adf008 Mon Sep 17 00:00:00 2001 From: Oskar Weigl Date: Mon, 5 Mar 2018 18:09:54 -0800 Subject: [PATCH 6/9] Update main.h --- Firmware/Board/v3.3/Inc/main.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Firmware/Board/v3.3/Inc/main.h b/Firmware/Board/v3.3/Inc/main.h index ddba7ca8..75bd2260 100644 --- a/Firmware/Board/v3.3/Inc/main.h +++ b/Firmware/Board/v3.3/Inc/main.h @@ -69,7 +69,7 @@ #define TIM_APB1_CLOCK_HZ 84000000 #define TIM_APB1_PERIOD_CLOCKS 4096 #define TIM_APB1_DEADTIME_CLOCKS 40 -#define TIM_BASE_TIMER TIM14 +#define TIM_TIME_BASE TIM14 #define M0_nCS_Pin GPIO_PIN_13 From 8d27dd443f0364c494d82631dff6845216ecc953 Mon Sep 17 00:00:00 2001 From: Oskar Weigl Date: Mon, 5 Mar 2018 18:10:23 -0800 Subject: [PATCH 7/9] Update utils.c --- Firmware/MotorControl/utils.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Firmware/MotorControl/utils.c b/Firmware/MotorControl/utils.c index 2782b517..a6a02a5a 100644 --- a/Firmware/MotorControl/utils.c +++ b/Firmware/MotorControl/utils.c @@ -190,7 +190,7 @@ uint32_t micros(void) { register uint32_t ms, cycle_cnt; do { ms = HAL_GetTick(); - cycle_cnt = TIM_BASE_TIMER->CNT; + cycle_cnt = TIM_TIME_BASE->CNT; } while (ms != HAL_GetTick()); return (ms * 1000) + cycle_cnt; @@ -203,4 +203,4 @@ void delay_us(uint32_t us) while (micros() - start < (uint32_t) us) { __ASM("nop"); } -} \ No newline at end of file +} From 5e44ca8ecf6ee41ea07310e060552f35b7a95709 Mon Sep 17 00:00:00 2001 From: Oskar Weigl Date: Mon, 5 Mar 2018 20:48:47 -0800 Subject: [PATCH 8/9] Update .travis.yml --- .travis.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.travis.yml b/.travis.yml index ccbd6015..2fdc962e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,5 +1,10 @@ # adapted from https://github.com/andysworkshop/stm32plus/blob/master/.travis.yml +branches: + only: + - master + - devel + language: c sudo: false From 7dfb41eb5a572cee9d77248ebed2fbe0df4e70ee Mon Sep 17 00:00:00 2001 From: Oskar Weigl Date: Mon, 5 Mar 2018 21:50:08 -0800 Subject: [PATCH 9/9] Update CHANGELOG.md --- Firmware/CHANGELOG.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Firmware/CHANGELOG.md b/Firmware/CHANGELOG.md index 0c581bc3..304a193b 100644 --- a/Firmware/CHANGELOG.md +++ b/Firmware/CHANGELOG.md @@ -1,12 +1,13 @@ # Unreleased Features Please add a note of your changes below this heading if you make a Pull Request. +* **Storing of configuration parameters to Non Volatile Memory** + # Releases ## [0.3.5] - 2018-03-04 ### Added -* **Storing of configuration parameters to Non Volatile Memory** * Reporting error if your encoder CPR is incorrect * Ability to start anticogging calibration over USB protocol * Reporting of DRV status/control registers and fault codes