From 7f2ae34b59594e1374b34e678d5bf9ffbef368aa Mon Sep 17 00:00:00 2001 From: Mallikarjun SE <49279505+MallikarjunSE@users.noreply.github.com> Date: Thu, 26 Dec 2024 14:22:09 +0530 Subject: [PATCH 1/5] Support 16mhz HSE --- Mcu/l431/Src/peripherals.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Mcu/l431/Src/peripherals.c b/Mcu/l431/Src/peripherals.c index 8df92324..7f4bfe70 100644 --- a/Mcu/l431/Src/peripherals.c +++ b/Mcu/l431/Src/peripherals.c @@ -66,9 +66,12 @@ void SystemClock_Config(void) LL_RCC_HSE_Enable(); #if HSE_VALUE == 24000000 LL_RCC_PLL_ConfigDomain_SYS(LL_RCC_PLLSOURCE_HSE, LL_RCC_PLLM_DIV_3, 20, LL_RCC_PLLR_DIV_2); +#elif HSE_VALUE == 16000000 + LL_RCC_PLL_ConfigDomain_SYS(LL_RCC_PLLSOURCE_HSE, LL_RCC_PLLM_DIV_2, 20, LL_RCC_PLLR_DIV_2); #else #error "Unsupported HSE_VALUE" #endif +#endif #else LL_RCC_MSI_Enable(); From fc2f2916cb6a953bc994b2043f4f1847a96b976b Mon Sep 17 00:00:00 2001 From: Mallikarjun SE <49279505+MallikarjunSE@users.noreply.github.com> Date: Thu, 26 Dec 2024 14:26:36 +0530 Subject: [PATCH 2/5] Update Sierra-Pulse1 target --- Inc/targets.h | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/Inc/targets.h b/Inc/targets.h index ce8465f0..cdfc3ca7 100644 --- a/Inc/targets.h +++ b/Inc/targets.h @@ -124,10 +124,15 @@ #define FIRMWARE_NAME "SierraPulse1" #define FILE_NAME "SIERRA_PULSE1_L431_CAN" #define DRONECAN_SUPPORT 1 -#define DEAD_TIME 45 +#define USE_HSE +#undef HSE_VALUE +#define HSE_VALUE 16000000 +#define DEAD_TIME 120 #define HARDWARE_GROUP_L4_C -#define TARGET_VOLTAGE_DIVIDER 100 -#define MILLIVOLT_PER_AMP 100 +#define TARGET_VOLTAGE_DIVIDER 210 +#define MILLIVOLT_PER_AMP 10 +#define RAMP_SPEED_LOW_RPM 1 +#define RAMP_SPEED_HIGH_RPM 1 #define USE_SERIAL_TELEMETRY #endif From 18e7de5eb1faad30f8608d6ee308829e7a7fac07 Mon Sep 17 00:00:00 2001 From: Mallikarjun SE <49279505+MallikarjunSE@users.noreply.github.com> Date: Thu, 26 Dec 2024 15:12:51 +0530 Subject: [PATCH 3/5] Add 16MHz HSE for L431 --- Mcu/l431/Src/peripherals.c | 1 - 1 file changed, 1 deletion(-) diff --git a/Mcu/l431/Src/peripherals.c b/Mcu/l431/Src/peripherals.c index 7f4bfe70..7c096ace 100644 --- a/Mcu/l431/Src/peripherals.c +++ b/Mcu/l431/Src/peripherals.c @@ -71,7 +71,6 @@ void SystemClock_Config(void) #else #error "Unsupported HSE_VALUE" #endif -#endif #else LL_RCC_MSI_Enable(); From 428b9c3900432492812631ef21960e8a02e4cd1c Mon Sep 17 00:00:00 2001 From: MallikarjunSE Date: Mon, 30 Dec 2024 12:28:55 +0530 Subject: [PATCH 4/5] update sierra-pulse1 target --- Inc/targets.h | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/Inc/targets.h b/Inc/targets.h index ce8465f0..cdfc3ca7 100644 --- a/Inc/targets.h +++ b/Inc/targets.h @@ -124,10 +124,15 @@ #define FIRMWARE_NAME "SierraPulse1" #define FILE_NAME "SIERRA_PULSE1_L431_CAN" #define DRONECAN_SUPPORT 1 -#define DEAD_TIME 45 +#define USE_HSE +#undef HSE_VALUE +#define HSE_VALUE 16000000 +#define DEAD_TIME 120 #define HARDWARE_GROUP_L4_C -#define TARGET_VOLTAGE_DIVIDER 100 -#define MILLIVOLT_PER_AMP 100 +#define TARGET_VOLTAGE_DIVIDER 210 +#define MILLIVOLT_PER_AMP 10 +#define RAMP_SPEED_LOW_RPM 1 +#define RAMP_SPEED_HIGH_RPM 1 #define USE_SERIAL_TELEMETRY #endif From 2ea438ed367ee7673e8bc3ffc5515ee3306fdea0 Mon Sep 17 00:00:00 2001 From: MallikarjunSE Date: Mon, 30 Dec 2024 12:29:43 +0530 Subject: [PATCH 5/5] add 16mhz hse for l431 --- Mcu/l431/Src/peripherals.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Mcu/l431/Src/peripherals.c b/Mcu/l431/Src/peripherals.c index 8df92324..7c096ace 100644 --- a/Mcu/l431/Src/peripherals.c +++ b/Mcu/l431/Src/peripherals.c @@ -66,6 +66,8 @@ void SystemClock_Config(void) LL_RCC_HSE_Enable(); #if HSE_VALUE == 24000000 LL_RCC_PLL_ConfigDomain_SYS(LL_RCC_PLLSOURCE_HSE, LL_RCC_PLLM_DIV_3, 20, LL_RCC_PLLR_DIV_2); +#elif HSE_VALUE == 16000000 + LL_RCC_PLL_ConfigDomain_SYS(LL_RCC_PLLSOURCE_HSE, LL_RCC_PLLM_DIV_2, 20, LL_RCC_PLLR_DIV_2); #else #error "Unsupported HSE_VALUE" #endif