From b0a1f4fc2bb368ceed8383d7ecea68fbf13b7f33 Mon Sep 17 00:00:00 2001 From: YunHorn Technology Date: Thu, 21 Mar 2024 16:49:25 +0800 Subject: [PATCH 01/15] disable DBinit --- Core/Src/sys_app.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Core/Src/sys_app.c b/Core/Src/sys_app.c index 705ba80..aeb505e 100644 --- a/Core/Src/sys_app.c +++ b/Core/Src/sys_app.c @@ -100,7 +100,7 @@ void SystemApp_Init(void) UTIL_TIMER_Init(); SYS_TimerInitialisedFlag = 1; /* Initializes the SW probes pins and the monitor RF pins via Alternate Function */ - DBG_Init(); + //DBG_Init(); /*Initialize the terminal */ UTIL_ADV_TRACE_Init(); From 4271392e5dfe988921cbb01ed6955a570d37a5fa Mon Sep 17 00:00:00 2001 From: YunHorn Technology Date: Thu, 21 Mar 2024 16:56:25 +0800 Subject: [PATCH 02/15] .. --- Core/Inc/sys_conf.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Core/Inc/sys_conf.h b/Core/Inc/sys_conf.h index 1f15237..1d72723 100644 --- a/Core/Inc/sys_conf.h +++ b/Core/Inc/sys_conf.h @@ -52,7 +52,7 @@ extern "C" { /** * @brief Enable trace logs */ -#define APP_LOG_ENABLED 1 +#define APP_LOG_ENABLED 0 /** * @brief Activate monitoring (probes) of some internal RF signals for debug purpose From aebafc0d8c1163e18fbf9164387b8a94ba29f7d4 Mon Sep 17 00:00:00 2001 From: YunHorn Technology Date: Thu, 21 Mar 2024 17:08:30 +0800 Subject: [PATCH 03/15] DISABLE USART2_RX to analog --- Core/Inc/sys_conf.h | 2 +- Core/Src/usart.c | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/Core/Inc/sys_conf.h b/Core/Inc/sys_conf.h index 1d72723..16d0145 100644 --- a/Core/Inc/sys_conf.h +++ b/Core/Inc/sys_conf.h @@ -47,7 +47,7 @@ extern "C" { /** * @brief Verbose level for all trace logs */ -#define VERBOSE_LEVEL VLEVEL_M +#define VERBOSE_LEVEL VLEVEL_OFF /** * @brief Enable trace logs diff --git a/Core/Src/usart.c b/Core/Src/usart.c index bf9fd2b..62e4a98 100644 --- a/Core/Src/usart.c +++ b/Core/Src/usart.c @@ -100,13 +100,18 @@ void HAL_UART_MspInit(UART_HandleTypeDef* uartHandle) PA3 ------> USART2_RX PA2 ------> USART2_TX */ - GPIO_InitStruct.Pin = USARTx_RX_Pin|USARTx_TX_Pin; + GPIO_InitStruct.Pin = USARTx_TX_Pin; GPIO_InitStruct.Mode = GPIO_MODE_AF_PP; GPIO_InitStruct.Pull = GPIO_NOPULL; GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH; GPIO_InitStruct.Alternate = GPIO_AF7_USART2; HAL_GPIO_Init(GPIOA, &GPIO_InitStruct); + GPIO_InitStruct.Pin = USARTx_RX_Pin; + GPIO_InitStruct.Mode = GPIO_MODE_ANALOG; + GPIO_InitStruct.Pull = GPIO_NOPULL; + HAL_GPIO_Init(GPIOA, &GPIO_InitStruct); + /* USART2 DMA Init */ /* USART2_TX Init */ hdma_usart2_tx.Instance = DMA1_Channel5; From fcd5f8b310c2f2c3a0e41e6f9afc9bf26c1b029a Mon Sep 17 00:00:00 2001 From: YunHorn Technology Date: Mon, 25 Mar 2024 10:22:03 +0800 Subject: [PATCH 04/15] add battery level and PA0 state to uplink message --- LoRaWAN/App/lora_app.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LoRaWAN/App/lora_app.c b/LoRaWAN/App/lora_app.c index 0eabe19..553e8d2 100644 --- a/LoRaWAN/App/lora_app.c +++ b/LoRaWAN/App/lora_app.c @@ -446,7 +446,7 @@ void HAL_GPIO_EXTI_Callback(uint16_t GPIO_Pin) { case BUT1_Pin: /* Note: when "EventType == TX_ON_TIMER" this GPIO is not initialized */ - if (EventType == TX_ON_EVENT) + //if (EventType == TX_ON_EVENT) { UTIL_SEQ_SetTask((1 << CFG_SEQ_Task_LoRaSendOnTxTimerOrButtonEvent), CFG_SEQ_Prio_0); } From aa2cbe27094cf0ef29dde1b4f7b0a00a28e652a2 Mon Sep 17 00:00:00 2001 From: YunHorn Technology Date: Mon, 25 Mar 2024 10:52:11 +0800 Subject: [PATCH 05/15] fixed normal open 1.6uA, closed, 90uA --- Core/Src/gpio.c | 21 ++++++++++++++++++--- Core/Src/stm32_lpm_if.c | 3 +++ LoRaWAN/App/lora_app.c | 4 ++-- 3 files changed, 23 insertions(+), 5 deletions(-) diff --git a/Core/Src/gpio.c b/Core/Src/gpio.c index 7cda6a6..4dd4cfe 100644 --- a/Core/Src/gpio.c +++ b/Core/Src/gpio.c @@ -49,6 +49,21 @@ void MX_GPIO_Init(void) __HAL_RCC_GPIOC_CLK_ENABLE(); __HAL_RCC_GPIOA_CLK_ENABLE(); + GPIO_InitStruct.Pin = GPIO_PIN_All; + GPIO_InitStruct.Mode = GPIO_MODE_ANALOG; + GPIO_InitStruct.Pull = GPIO_NOPULL; + HAL_GPIO_Init(GPIOB, &GPIO_InitStruct); + HAL_GPIO_Init(GPIOC, &GPIO_InitStruct); + HAL_GPIO_Init(GPIOA, &GPIO_InitStruct); + __HAL_RCC_GPIOB_CLK_ENABLE(); + __HAL_RCC_GPIOC_CLK_ENABLE(); + + GPIO_InitStruct.Pin = BUT1_Pin; + GPIO_InitStruct.Mode = GPIO_MODE_IT_FALLING; + GPIO_InitStruct.Pull = GPIO_PULLUP; + HAL_GPIO_Init(GPIOA, &GPIO_InitStruct); + +#if 0 /*Configure GPIO pin Output Level */ HAL_GPIO_WritePin(GPIOB, LED1_Pin|LED2_Pin|PROB2_Pin|PROB1_Pin |LED3_Pin, GPIO_PIN_RESET); @@ -78,17 +93,17 @@ void MX_GPIO_Init(void) GPIO_InitStruct.Mode = GPIO_MODE_IT_FALLING; GPIO_InitStruct.Pull = GPIO_PULLUP; HAL_GPIO_Init(BUT3_GPIO_Port, &GPIO_InitStruct); - +#endif /* EXTI interrupt init*/ HAL_NVIC_SetPriority(EXTI0_IRQn, 0, 0); HAL_NVIC_EnableIRQ(EXTI0_IRQn); - +#if 0 HAL_NVIC_SetPriority(EXTI1_IRQn, 0, 0); HAL_NVIC_EnableIRQ(EXTI1_IRQn); HAL_NVIC_SetPriority(EXTI9_5_IRQn, 0, 0); HAL_NVIC_EnableIRQ(EXTI9_5_IRQn); - +#endif } /* USER CODE BEGIN 2 */ diff --git a/Core/Src/stm32_lpm_if.c b/Core/Src/stm32_lpm_if.c index 8b623ee..f358f2d 100644 --- a/Core/Src/stm32_lpm_if.c +++ b/Core/Src/stm32_lpm_if.c @@ -94,6 +94,9 @@ void PWR_EnterStopMode(void) /* USER CODE BEGIN EnterStopMode_1 */ /* USER CODE END EnterStopMode_1 */ + //HAL_GPIO_WritePin(GPIOB, GPIO_PIN_All, GPIO_PIN_RESET); + //HAL_GPIO_WritePin(GPIOC, GPIO_PIN_All, GPIO_PIN_RESET); + //HAL_GPIO_WritePin(GPIOA, GPIO_PIN_All, GPIO_PIN_RESET); HAL_SuspendTick(); /* Clear Status Flag before entering STOP/STANDBY Mode */ LL_PWR_ClearFlag_C1STOP_C1STB(); diff --git a/LoRaWAN/App/lora_app.c b/LoRaWAN/App/lora_app.c index 553e8d2..91208f1 100644 --- a/LoRaWAN/App/lora_app.c +++ b/LoRaWAN/App/lora_app.c @@ -610,8 +610,8 @@ static void SendTxData(void) { AppData.Buffer[i++] = 0; AppData.Buffer[i++] = 0; - AppData.Buffer[i++] = 0; - AppData.Buffer[i++] = 0; + AppData.Buffer[i++] = (uint8_t)(99*GetBatteryLevel()/255); /* 1 (very low) to 254 (fully charged) */ + AppData.Buffer[i++] = HAL_GPIO_ReadPin(GPIOA,GPIO_PIN_0); } else { From 85a9fe722f830d69bf406b0913840bba018af75b Mon Sep 17 00:00:00 2001 From: YunHorn Technology Date: Mon, 25 Mar 2024 12:00:26 +0800 Subject: [PATCH 06/15] try send changed status to uplink message --- Core/Src/gpio.c | 4 ++-- Core/Src/stm32_lpm_if.c | 4 ++-- LoRaWAN/App/lora_app.c | 19 ++++++++++++++----- 3 files changed, 18 insertions(+), 9 deletions(-) diff --git a/Core/Src/gpio.c b/Core/Src/gpio.c index 4dd4cfe..9cd7e13 100644 --- a/Core/Src/gpio.c +++ b/Core/Src/gpio.c @@ -59,8 +59,8 @@ void MX_GPIO_Init(void) __HAL_RCC_GPIOC_CLK_ENABLE(); GPIO_InitStruct.Pin = BUT1_Pin; - GPIO_InitStruct.Mode = GPIO_MODE_IT_FALLING; - GPIO_InitStruct.Pull = GPIO_PULLUP; + GPIO_InitStruct.Mode = GPIO_MODE_IT_RISING_FALLING; + GPIO_InitStruct.Pull = GPIO_NOPULL; HAL_GPIO_Init(GPIOA, &GPIO_InitStruct); #if 0 diff --git a/Core/Src/stm32_lpm_if.c b/Core/Src/stm32_lpm_if.c index f358f2d..f174631 100644 --- a/Core/Src/stm32_lpm_if.c +++ b/Core/Src/stm32_lpm_if.c @@ -94,9 +94,9 @@ void PWR_EnterStopMode(void) /* USER CODE BEGIN EnterStopMode_1 */ /* USER CODE END EnterStopMode_1 */ - //HAL_GPIO_WritePin(GPIOB, GPIO_PIN_All, GPIO_PIN_RESET); + HAL_GPIO_WritePin(GPIOB, GPIO_PIN_All, GPIO_PIN_RESET); //HAL_GPIO_WritePin(GPIOC, GPIO_PIN_All, GPIO_PIN_RESET); - //HAL_GPIO_WritePin(GPIOA, GPIO_PIN_All, GPIO_PIN_RESET); + HAL_GPIO_WritePin(GPIOA, ~GPIO_PIN_0, GPIO_PIN_RESET); HAL_SuspendTick(); /* Clear Status Flag before entering STOP/STANDBY Mode */ LL_PWR_ClearFlag_C1STOP_C1STB(); diff --git a/LoRaWAN/App/lora_app.c b/LoRaWAN/App/lora_app.c index 91208f1..fcc4c65 100644 --- a/LoRaWAN/App/lora_app.c +++ b/LoRaWAN/App/lora_app.c @@ -342,7 +342,7 @@ static UTIL_TIMER_Object_t JoinLedTimer; /* Exported functions ---------------------------------------------------------*/ /* USER CODE BEGIN EF */ - +volatile uint8_t door_status=0, door_changed_flag=0, door_previous_status=0; /* USER CODE END EF */ void LoRaWAN_Init(void) @@ -666,12 +666,21 @@ static void SendTxData(void) static void OnTxTimerEvent(void *context) { /* USER CODE BEGIN OnTxTimerEvent_1 */ - + door_status = HAL_GPIO_ReadPin(GPIOA,GPIO_PIN_0); + if (door_status != door_previous_status) + { + door_changed_flag = 1; + door_previous_status = door_status; + } /* USER CODE END OnTxTimerEvent_1 */ - UTIL_SEQ_SetTask((1 << CFG_SEQ_Task_LoRaSendOnTxTimerOrButtonEvent), CFG_SEQ_Prio_0); + if (door_changed_flag ==1 ) + { + door_changed_flag = 0; + UTIL_SEQ_SetTask((1 << CFG_SEQ_Task_LoRaSendOnTxTimerOrButtonEvent), CFG_SEQ_Prio_0); - /*Wait for next tx slot*/ - UTIL_TIMER_Start(&TxTimer); + /*Wait for next tx slot*/ + UTIL_TIMER_Start(&TxTimer); + } /* USER CODE BEGIN OnTxTimerEvent_2 */ /* USER CODE END OnTxTimerEvent_2 */ From 7adb1031ee9ca1a70be85ad494553d7b5c43a99f Mon Sep 17 00:00:00 2001 From: YunHorn Technology Date: Mon, 25 Mar 2024 12:58:57 +0800 Subject: [PATCH 07/15] improved only send changed status up, --- Core/Src/gpio.c | 2 +- LoRaWAN/App/lora_app.c | 32 +++++++++++++++++++++++++++++++- STM32CubeIDE/WL55JC_AS923.launch | 1 + 3 files changed, 33 insertions(+), 2 deletions(-) diff --git a/Core/Src/gpio.c b/Core/Src/gpio.c index 9cd7e13..8234296 100644 --- a/Core/Src/gpio.c +++ b/Core/Src/gpio.c @@ -60,7 +60,7 @@ void MX_GPIO_Init(void) GPIO_InitStruct.Pin = BUT1_Pin; GPIO_InitStruct.Mode = GPIO_MODE_IT_RISING_FALLING; - GPIO_InitStruct.Pull = GPIO_NOPULL; + GPIO_InitStruct.Pull = GPIO_PULLUP; HAL_GPIO_Init(GPIOA, &GPIO_InitStruct); #if 0 diff --git a/LoRaWAN/App/lora_app.c b/LoRaWAN/App/lora_app.c index fcc4c65..49697fb 100644 --- a/LoRaWAN/App/lora_app.c +++ b/LoRaWAN/App/lora_app.c @@ -448,6 +448,7 @@ void HAL_GPIO_EXTI_Callback(uint16_t GPIO_Pin) /* Note: when "EventType == TX_ON_TIMER" this GPIO is not initialized */ //if (EventType == TX_ON_EVENT) { + door_changed_flag =1; UTIL_SEQ_SetTask((1 << CFG_SEQ_Task_LoRaSendOnTxTimerOrButtonEvent), CFG_SEQ_Prio_0); } break; @@ -557,6 +558,22 @@ static void SendTxData(void) sensor_t sensor_data; UTIL_TIMER_Time_t nextTxIn = 0; + door_status = HAL_GPIO_ReadPin(GPIOA,GPIO_PIN_0); + door_changed_flag = 0; + if (door_status != door_previous_status) + { + door_previous_status = door_status; + } + +#if 0 + if (door_changed_flag ==1 ) + { + door_changed_flag = 0; + UTIL_SEQ_SetTask((1 << CFG_SEQ_Task_LoRaSendOnTxTimerOrButtonEvent), CFG_SEQ_Prio_0); + UTIL_TIMER_Start(&TxTimer); + } +#endif + if (LmHandlerIsBusy() == false) { #ifdef CAYENNE_LPP @@ -611,7 +628,7 @@ static void SendTxData(void) AppData.Buffer[i++] = 0; AppData.Buffer[i++] = 0; AppData.Buffer[i++] = (uint8_t)(99*GetBatteryLevel()/255); /* 1 (very low) to 254 (fully charged) */ - AppData.Buffer[i++] = HAL_GPIO_ReadPin(GPIOA,GPIO_PIN_0); + AppData.Buffer[i++] = door_status; } else { @@ -666,6 +683,7 @@ static void SendTxData(void) static void OnTxTimerEvent(void *context) { /* USER CODE BEGIN OnTxTimerEvent_1 */ +#if 0 door_status = HAL_GPIO_ReadPin(GPIOA,GPIO_PIN_0); if (door_status != door_previous_status) { @@ -681,6 +699,18 @@ static void OnTxTimerEvent(void *context) /*Wait for next tx slot*/ UTIL_TIMER_Start(&TxTimer); } +#endif + door_status = HAL_GPIO_ReadPin(GPIOA,GPIO_PIN_0); + door_changed_flag = 0; + if (door_status != door_previous_status) + { + door_previous_status = door_status; + + + UTIL_SEQ_SetTask((1 << CFG_SEQ_Task_LoRaSendOnTxTimerOrButtonEvent), CFG_SEQ_Prio_0); + UTIL_TIMER_Start(&TxTimer); + + } /* USER CODE BEGIN OnTxTimerEvent_2 */ /* USER CODE END OnTxTimerEvent_2 */ diff --git a/STM32CubeIDE/WL55JC_AS923.launch b/STM32CubeIDE/WL55JC_AS923.launch index 9c1e726..4ffa9b7 100644 --- a/STM32CubeIDE/WL55JC_AS923.launch +++ b/STM32CubeIDE/WL55JC_AS923.launch @@ -78,5 +78,6 @@ + From 1140aa9a1926668b52324d567176278e019247ca Mon Sep 17 00:00:00 2001 From: YunHorn Technology Date: Mon, 25 Mar 2024 13:29:34 +0800 Subject: [PATCH 08/15] 1.8uA at open state and 20 uA at closed for a few seconds --- Core/Src/stm32_lpm_if.c | 4 +++- LoRaWAN/App/lora_app.c | 7 ++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/Core/Src/stm32_lpm_if.c b/Core/Src/stm32_lpm_if.c index f174631..2b3bfd4 100644 --- a/Core/Src/stm32_lpm_if.c +++ b/Core/Src/stm32_lpm_if.c @@ -96,7 +96,8 @@ void PWR_EnterStopMode(void) /* USER CODE END EnterStopMode_1 */ HAL_GPIO_WritePin(GPIOB, GPIO_PIN_All, GPIO_PIN_RESET); //HAL_GPIO_WritePin(GPIOC, GPIO_PIN_All, GPIO_PIN_RESET); - HAL_GPIO_WritePin(GPIOA, ~GPIO_PIN_0, GPIO_PIN_RESET); + HAL_GPIO_WritePin(GPIOA, GPIO_PIN_All, GPIO_PIN_RESET); + HAL_GPIO_DeInit(GPIOA,GPIO_PIN_0); HAL_SuspendTick(); /* Clear Status Flag before entering STOP/STANDBY Mode */ LL_PWR_ClearFlag_C1STOP_C1STB(); @@ -123,6 +124,7 @@ void PWR_ExitStopMode(void) SRAM ctrls, DMAx, DMAMux, AES, RNG, HSEM */ /* Resume not retained USARTx and DMA */ + MX_GPIO_Init(); vcom_Resume(); /* USER CODE BEGIN ExitStopMode_2 */ diff --git a/LoRaWAN/App/lora_app.c b/LoRaWAN/App/lora_app.c index 49697fb..e584b2d 100644 --- a/LoRaWAN/App/lora_app.c +++ b/LoRaWAN/App/lora_app.c @@ -36,7 +36,7 @@ #include "flash_if.h" /* USER CODE BEGIN Includes */ - +#include "gpio.h" /* USER CODE END Includes */ /* External variables ---------------------------------------------------------*/ @@ -700,9 +700,10 @@ static void OnTxTimerEvent(void *context) UTIL_TIMER_Start(&TxTimer); } #endif + MX_GPIO_Init(); door_status = HAL_GPIO_ReadPin(GPIOA,GPIO_PIN_0); - door_changed_flag = 0; - if (door_status != door_previous_status) + //door_changed_flag = 0; + //if (door_status != door_previous_status) { door_previous_status = door_status; From f25c396a8dd9eba037c05da49ac23b1a5fe5587d Mon Sep 17 00:00:00 2001 From: YunHorn Technology Date: Tue, 26 Mar 2024 17:34:22 +0800 Subject: [PATCH 09/15] with debug, door open/close, three lines... --- Core/Inc/sys_conf.h | 6 +- Core/Inc/utilities_def.h | 2 +- Core/Src/gpio.c | 4 +- Core/Src/stm32_lpm_if.c | 8 +- LoRaWAN/App/lora_app.c | 77 +++++++------------ .../.settings/stm32cubeide.project.prefs | 6 +- STM32CubeIDE/STM32WL55JCIX_FLASH.ld | 10 +-- 7 files changed, 45 insertions(+), 68 deletions(-) diff --git a/Core/Inc/sys_conf.h b/Core/Inc/sys_conf.h index 16d0145..de8c96a 100644 --- a/Core/Inc/sys_conf.h +++ b/Core/Inc/sys_conf.h @@ -47,12 +47,12 @@ extern "C" { /** * @brief Verbose level for all trace logs */ -#define VERBOSE_LEVEL VLEVEL_OFF +#define VERBOSE_LEVEL VLEVEL_M /** * @brief Enable trace logs */ -#define APP_LOG_ENABLED 0 +#define APP_LOG_ENABLED 1 /** * @brief Activate monitoring (probes) of some internal RF signals for debug purpose @@ -75,7 +75,7 @@ extern "C" { * @brief Enable/Disable MCU Debugger pins (dbg serial wires) * @note by HW serial wires are ON by default, need to put them OFF to save power */ -#define DEBUGGER_ENABLED 0 +#define DEBUGGER_ENABLED 1 /** * @brief Disable Low Power mode diff --git a/Core/Inc/utilities_def.h b/Core/Inc/utilities_def.h index bcf7700..f28e621 100644 --- a/Core/Inc/utilities_def.h +++ b/Core/Inc/utilities_def.h @@ -80,7 +80,7 @@ typedef enum CFG_SEQ_Task_LoRaStoreContextEvent, CFG_SEQ_Task_LoRaStopJoinEvent, /* USER CODE BEGIN CFG_SEQ_Task_Id_t */ - + CFG_SEQ_Task_YunhornSTSP1CheckingEvent, /* USER CODE END CFG_SEQ_Task_Id_t */ CFG_SEQ_Task_NBR } CFG_SEQ_Task_Id_t; diff --git a/Core/Src/gpio.c b/Core/Src/gpio.c index 8234296..578c5fe 100644 --- a/Core/Src/gpio.c +++ b/Core/Src/gpio.c @@ -55,8 +55,8 @@ void MX_GPIO_Init(void) HAL_GPIO_Init(GPIOB, &GPIO_InitStruct); HAL_GPIO_Init(GPIOC, &GPIO_InitStruct); HAL_GPIO_Init(GPIOA, &GPIO_InitStruct); - __HAL_RCC_GPIOB_CLK_ENABLE(); - __HAL_RCC_GPIOC_CLK_ENABLE(); + __HAL_RCC_GPIOB_CLK_DISABLE(); + __HAL_RCC_GPIOC_CLK_DISABLE(); GPIO_InitStruct.Pin = BUT1_Pin; GPIO_InitStruct.Mode = GPIO_MODE_IT_RISING_FALLING; diff --git a/Core/Src/stm32_lpm_if.c b/Core/Src/stm32_lpm_if.c index 2b3bfd4..7ca55e6 100644 --- a/Core/Src/stm32_lpm_if.c +++ b/Core/Src/stm32_lpm_if.c @@ -25,7 +25,7 @@ #include "usart_if.h" /* USER CODE BEGIN Includes */ - +#include "gpio.h" /* USER CODE END Includes */ /* External variables ---------------------------------------------------------*/ @@ -96,8 +96,8 @@ void PWR_EnterStopMode(void) /* USER CODE END EnterStopMode_1 */ HAL_GPIO_WritePin(GPIOB, GPIO_PIN_All, GPIO_PIN_RESET); //HAL_GPIO_WritePin(GPIOC, GPIO_PIN_All, GPIO_PIN_RESET); - HAL_GPIO_WritePin(GPIOA, GPIO_PIN_All, GPIO_PIN_RESET); - HAL_GPIO_DeInit(GPIOA,GPIO_PIN_0); + HAL_GPIO_WritePin(GPIOA, ~GPIO_PIN_0, GPIO_PIN_RESET); + HAL_SuspendTick(); /* Clear Status Flag before entering STOP/STANDBY Mode */ LL_PWR_ClearFlag_C1STOP_C1STB(); @@ -124,7 +124,7 @@ void PWR_ExitStopMode(void) SRAM ctrls, DMAx, DMAMux, AES, RNG, HSEM */ /* Resume not retained USARTx and DMA */ - MX_GPIO_Init(); + //MX_GPIO_Init(); vcom_Resume(); /* USER CODE BEGIN ExitStopMode_2 */ diff --git a/LoRaWAN/App/lora_app.c b/LoRaWAN/App/lora_app.c index e584b2d..89495b7 100644 --- a/LoRaWAN/App/lora_app.c +++ b/LoRaWAN/App/lora_app.c @@ -215,6 +215,7 @@ static void OnPingSlotPeriodicityChanged(uint8_t pingSlotPeriodicity); static void OnSystemReset(void); /* USER CODE BEGIN PFP */ +static void OnYunhornSTSP1CheckingEvent(void); /** * @brief LED Tx timer callback function @@ -300,7 +301,7 @@ static UTIL_TIMER_Object_t TxTimer; /** * @brief Tx Timer period */ -static UTIL_TIMER_Time_t TxPeriodicity = APP_TX_DUTYCYCLE; +static UTIL_TIMER_Time_t TxPeriodicity = 1000; /** * @brief Join Timer period @@ -404,7 +405,7 @@ void LoRaWAN_Init(void) UTIL_SEQ_RegTask((1 << CFG_SEQ_Task_LoRaSendOnTxTimerOrButtonEvent), UTIL_SEQ_RFU, SendTxData); UTIL_SEQ_RegTask((1 << CFG_SEQ_Task_LoRaStoreContextEvent), UTIL_SEQ_RFU, StoreContext); UTIL_SEQ_RegTask((1 << CFG_SEQ_Task_LoRaStopJoinEvent), UTIL_SEQ_RFU, StopJoin); - + UTIL_SEQ_RegTask((1 << CFG_SEQ_Task_YunhornSTSP1CheckingEvent),UTIL_SEQ_RFU, OnYunhornSTSP1CheckingEvent); /* Init Info table used by LmHandler*/ LoraInfo_Init(); @@ -446,9 +447,10 @@ void HAL_GPIO_EXTI_Callback(uint16_t GPIO_Pin) { case BUT1_Pin: /* Note: when "EventType == TX_ON_TIMER" this GPIO is not initialized */ - //if (EventType == TX_ON_EVENT) + UTIL_SEQ_SetTask((1 << CFG_SEQ_Task_YunhornSTSP1CheckingEvent), CFG_SEQ_Prio_0); + APP_LOG(TS_OFF,VLEVEL_M,"... BUT1............. \r\n"); + if (EventType == TX_ON_EVENT) { - door_changed_flag =1; UTIL_SEQ_SetTask((1 << CFG_SEQ_Task_LoRaSendOnTxTimerOrButtonEvent), CFG_SEQ_Prio_0); } break; @@ -467,7 +469,20 @@ void HAL_GPIO_EXTI_Callback(uint16_t GPIO_Pin) /* Private functions ---------------------------------------------------------*/ /* USER CODE BEGIN PrFD */ +static void OnYunhornSTSP1CheckingEvent(void) +{ + + door_status = HAL_GPIO_ReadPin(GPIOA,GPIO_PIN_0); + APP_LOG(TS_OFF,VLEVEL_M,"\r\nDOOR_STATUS= %u \r\n",door_status); + if (door_status != door_previous_status) + { + door_previous_status = door_status; + door_changed_flag = 1; + UTIL_SEQ_SetTask((1 << CFG_SEQ_Task_LoRaSendOnTxTimerOrButtonEvent), CFG_SEQ_Prio_0); + } + +} /* USER CODE END PrFD */ static void OnRxData(LmHandlerAppData_t *appData, LmHandlerRxParams_t *params) @@ -558,22 +573,6 @@ static void SendTxData(void) sensor_t sensor_data; UTIL_TIMER_Time_t nextTxIn = 0; - door_status = HAL_GPIO_ReadPin(GPIOA,GPIO_PIN_0); - door_changed_flag = 0; - if (door_status != door_previous_status) - { - door_previous_status = door_status; - } - -#if 0 - if (door_changed_flag ==1 ) - { - door_changed_flag = 0; - UTIL_SEQ_SetTask((1 << CFG_SEQ_Task_LoRaSendOnTxTimerOrButtonEvent), CFG_SEQ_Prio_0); - UTIL_TIMER_Start(&TxTimer); - } -#endif - if (LmHandlerIsBusy() == false) { #ifdef CAYENNE_LPP @@ -589,10 +588,10 @@ static void SendTxData(void) #endif /* CAYENNE_LPP */ EnvSensors_Read(&sensor_data); - +#if 0 APP_LOG(TS_ON, VLEVEL_M, "VDDA: %d\r\n", batteryLevel); APP_LOG(TS_ON, VLEVEL_M, "temp: %d\r\n", (int16_t)(sensor_data.temperature)); - +#endif AppData.Port = LORAWAN_USER_APP_PORT; #ifdef CAYENNE_LPP @@ -683,34 +682,12 @@ static void SendTxData(void) static void OnTxTimerEvent(void *context) { /* USER CODE BEGIN OnTxTimerEvent_1 */ -#if 0 - door_status = HAL_GPIO_ReadPin(GPIOA,GPIO_PIN_0); - if (door_status != door_previous_status) - { - door_changed_flag = 1; - door_previous_status = door_status; - } - /* USER CODE END OnTxTimerEvent_1 */ - if (door_changed_flag ==1 ) - { - door_changed_flag = 0; - UTIL_SEQ_SetTask((1 << CFG_SEQ_Task_LoRaSendOnTxTimerOrButtonEvent), CFG_SEQ_Prio_0); - - /*Wait for next tx slot*/ - UTIL_TIMER_Start(&TxTimer); - } -#endif - MX_GPIO_Init(); - door_status = HAL_GPIO_ReadPin(GPIOA,GPIO_PIN_0); - //door_changed_flag = 0; - //if (door_status != door_previous_status) - { - door_previous_status = door_status; - - - UTIL_SEQ_SetTask((1 << CFG_SEQ_Task_LoRaSendOnTxTimerOrButtonEvent), CFG_SEQ_Prio_0); - UTIL_TIMER_Start(&TxTimer); - + UTIL_SEQ_SetTask((1 << CFG_SEQ_Task_YunhornSTSP1CheckingEvent), CFG_SEQ_Prio_0); + if (door_changed_flag ==1) + { + door_changed_flag =0; + UTIL_SEQ_SetTask((1 << CFG_SEQ_Task_LoRaSendOnTxTimerOrButtonEvent), CFG_SEQ_Prio_0); + UTIL_TIMER_Start(&TxTimer); } /* USER CODE BEGIN OnTxTimerEvent_2 */ diff --git a/STM32CubeIDE/.settings/stm32cubeide.project.prefs b/STM32CubeIDE/.settings/stm32cubeide.project.prefs index 481391e..e052a6a 100644 --- a/STM32CubeIDE/.settings/stm32cubeide.project.prefs +++ b/STM32CubeIDE/.settings/stm32cubeide.project.prefs @@ -1,4 +1,4 @@ -2F62501ED4689FB349E356AB974DBE57=95112E708683D54F6AC1ADC68D917C29 -8DF89ED150041C4CBC7CB9A9CAA90856=95112E708683D54F6AC1ADC68D917C29 -DC22A860405A8BF2F2C095E5B6529F12=708FD40520C1EE5CFD2122309291F653 +2F62501ED4689FB349E356AB974DBE57=E4D60684DA61280BD06389F4CFDF2587 +8DF89ED150041C4CBC7CB9A9CAA90856=E4D60684DA61280BD06389F4CFDF2587 +DC22A860405A8BF2F2C095E5B6529F12=74CD6EB106FB50B767E4FE71225C7638 eclipse.preferences.version=1 diff --git a/STM32CubeIDE/STM32WL55JCIX_FLASH.ld b/STM32CubeIDE/STM32WL55JCIX_FLASH.ld index d45d121..48c962e 100644 --- a/STM32CubeIDE/STM32WL55JCIX_FLASH.ld +++ b/STM32CubeIDE/STM32WL55JCIX_FLASH.ld @@ -91,13 +91,13 @@ SECTIONS . = ALIGN(8); } >FLASH - .ARM.extab : { + .ARM.extab(READONLY) : { . = ALIGN(8); *(.ARM.extab* .gnu.linkonce.armextab.*) . = ALIGN(8); } >FLASH - .ARM : { + .ARM(READONLY) : { . = ALIGN(8); __exidx_start = .; *(.ARM.exidx*) @@ -105,7 +105,7 @@ SECTIONS . = ALIGN(8); } >FLASH - .preinit_array : + .preinit_array(READONLY) : { . = ALIGN(8); PROVIDE_HIDDEN (__preinit_array_start = .); @@ -114,7 +114,7 @@ SECTIONS . = ALIGN(8); } >FLASH - .init_array : + .init_array(READONLY) : { . = ALIGN(8); PROVIDE_HIDDEN (__init_array_start = .); @@ -124,7 +124,7 @@ SECTIONS . = ALIGN(8); } >FLASH - .fini_array : + .fini_array(READONLY) : { . = ALIGN(8); PROVIDE_HIDDEN (__fini_array_start = .); From 764e5a9d91b203e1da4e80ed97abc955b4ca1b82 Mon Sep 17 00:00:00 2001 From: YunHorn Technology Date: Wed, 27 Mar 2024 13:00:18 +0800 Subject: [PATCH 10/15] improve door open/close logic with timer --- LoRaWAN/App/lora_app.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/LoRaWAN/App/lora_app.c b/LoRaWAN/App/lora_app.c index 89495b7..43dc765 100644 --- a/LoRaWAN/App/lora_app.c +++ b/LoRaWAN/App/lora_app.c @@ -344,6 +344,7 @@ static UTIL_TIMER_Object_t JoinLedTimer; /* Exported functions ---------------------------------------------------------*/ /* USER CODE BEGIN EF */ volatile uint8_t door_status=0, door_changed_flag=0, door_previous_status=0; +volatile uint32_t checking_sn=0; /* USER CODE END EF */ void LoRaWAN_Init(void) @@ -424,7 +425,7 @@ void LoRaWAN_Init(void) if (EventType == TX_ON_TIMER) { /* send every time timer elapses */ - UTIL_TIMER_Create(&TxTimer, TxPeriodicity, UTIL_TIMER_ONESHOT, OnTxTimerEvent, NULL); + UTIL_TIMER_Create(&TxTimer, TxPeriodicity, UTIL_TIMER_PERIODIC, OnTxTimerEvent, NULL); UTIL_TIMER_Start(&TxTimer); } else @@ -447,8 +448,9 @@ void HAL_GPIO_EXTI_Callback(uint16_t GPIO_Pin) { case BUT1_Pin: /* Note: when "EventType == TX_ON_TIMER" this GPIO is not initialized */ + door_changed_flag = 1; UTIL_SEQ_SetTask((1 << CFG_SEQ_Task_YunhornSTSP1CheckingEvent), CFG_SEQ_Prio_0); - APP_LOG(TS_OFF,VLEVEL_M,"... BUT1............. \r\n"); + if (EventType == TX_ON_EVENT) { UTIL_SEQ_SetTask((1 << CFG_SEQ_Task_LoRaSendOnTxTimerOrButtonEvent), CFG_SEQ_Prio_0); @@ -474,14 +476,15 @@ static void OnYunhornSTSP1CheckingEvent(void) door_status = HAL_GPIO_ReadPin(GPIOA,GPIO_PIN_0); - APP_LOG(TS_OFF,VLEVEL_M,"\r\nDOOR_STATUS= %u \r\n",door_status); + if (door_status != door_previous_status) { door_previous_status = door_status; door_changed_flag = 1; - UTIL_SEQ_SetTask((1 << CFG_SEQ_Task_LoRaSendOnTxTimerOrButtonEvent), CFG_SEQ_Prio_0); + APP_LOG(TS_OFF,VLEVEL_M,"\r\n----- Door Status Changed-------------\r\n"); } + //UTIL_SEQ_SetTask((1 << CFG_SEQ_Task_LoRaSendOnTxTimerOrButtonEvent), CFG_SEQ_Prio_0); } /* USER CODE END PrFD */ @@ -687,7 +690,7 @@ static void OnTxTimerEvent(void *context) { door_changed_flag =0; UTIL_SEQ_SetTask((1 << CFG_SEQ_Task_LoRaSendOnTxTimerOrButtonEvent), CFG_SEQ_Prio_0); - UTIL_TIMER_Start(&TxTimer); + //UTIL_TIMER_Start(&TxTimer); } /* USER CODE BEGIN OnTxTimerEvent_2 */ From 7f3e94cfafcb483b4143916f85776541d030b547 Mon Sep 17 00:00:00 2001 From: YunHorn Technology Date: Wed, 27 Mar 2024 13:13:58 +0800 Subject: [PATCH 11/15] disable debug/log console output with open 1.8uA, closed 81uA --- Core/Inc/sys_conf.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Core/Inc/sys_conf.h b/Core/Inc/sys_conf.h index de8c96a..16d0145 100644 --- a/Core/Inc/sys_conf.h +++ b/Core/Inc/sys_conf.h @@ -47,12 +47,12 @@ extern "C" { /** * @brief Verbose level for all trace logs */ -#define VERBOSE_LEVEL VLEVEL_M +#define VERBOSE_LEVEL VLEVEL_OFF /** * @brief Enable trace logs */ -#define APP_LOG_ENABLED 1 +#define APP_LOG_ENABLED 0 /** * @brief Activate monitoring (probes) of some internal RF signals for debug purpose @@ -75,7 +75,7 @@ extern "C" { * @brief Enable/Disable MCU Debugger pins (dbg serial wires) * @note by HW serial wires are ON by default, need to put them OFF to save power */ -#define DEBUGGER_ENABLED 1 +#define DEBUGGER_ENABLED 0 /** * @brief Disable Low Power mode From 25da5701d201c9ce15068b0c995f0a405b1a4eed Mon Sep 17 00:00:00 2001 From: YunHorn Technology Date: Wed, 3 Apr 2024 18:32:29 +0800 Subject: [PATCH 12/15] closed: 110uA, open 2-3uA --- Core/Src/gpio.c | 2 +- Core/Src/rtc.c | 4 ++-- Core/Src/stm32_lpm_if.c | 4 ++-- Core/Src/stm32wlxx_it.c | 4 ++-- Core/Src/sys_app.c | 2 +- STM32CubeIDE/.settings/language.settings.xml | 4 ++-- 6 files changed, 10 insertions(+), 10 deletions(-) diff --git a/Core/Src/gpio.c b/Core/Src/gpio.c index 578c5fe..f51ed30 100644 --- a/Core/Src/gpio.c +++ b/Core/Src/gpio.c @@ -62,7 +62,7 @@ void MX_GPIO_Init(void) GPIO_InitStruct.Mode = GPIO_MODE_IT_RISING_FALLING; GPIO_InitStruct.Pull = GPIO_PULLUP; HAL_GPIO_Init(GPIOA, &GPIO_InitStruct); - + __HAL_RCC_GPIOA_CLK_DISABLE(); #if 0 /*Configure GPIO pin Output Level */ HAL_GPIO_WritePin(GPIOB, LED1_Pin|LED2_Pin|PROB2_Pin|PROB1_Pin diff --git a/Core/Src/rtc.c b/Core/Src/rtc.c index 04a8214..918ceaf 100644 --- a/Core/Src/rtc.c +++ b/Core/Src/rtc.c @@ -65,7 +65,7 @@ void MX_RTC_Init(void) { Error_Handler(); } - +#if 0 /** Enable the Alarm A */ sAlarm.BinaryAutoClr = RTC_ALARMSUBSECONDBIN_AUTOCLR_NO; @@ -78,7 +78,7 @@ void MX_RTC_Init(void) Error_Handler(); } /* USER CODE BEGIN RTC_Init 2 */ - +#endif /* USER CODE END RTC_Init 2 */ } diff --git a/Core/Src/stm32_lpm_if.c b/Core/Src/stm32_lpm_if.c index 7ca55e6..66c1338 100644 --- a/Core/Src/stm32_lpm_if.c +++ b/Core/Src/stm32_lpm_if.c @@ -95,8 +95,8 @@ void PWR_EnterStopMode(void) /* USER CODE END EnterStopMode_1 */ HAL_GPIO_WritePin(GPIOB, GPIO_PIN_All, GPIO_PIN_RESET); - //HAL_GPIO_WritePin(GPIOC, GPIO_PIN_All, GPIO_PIN_RESET); HAL_GPIO_WritePin(GPIOA, ~GPIO_PIN_0, GPIO_PIN_RESET); + vcom_DeInit(); HAL_SuspendTick(); /* Clear Status Flag before entering STOP/STANDBY Mode */ @@ -125,7 +125,7 @@ void PWR_ExitStopMode(void) /* Resume not retained USARTx and DMA */ //MX_GPIO_Init(); - vcom_Resume(); + //vcom_Resume(); /* USER CODE BEGIN ExitStopMode_2 */ /* USER CODE END ExitStopMode_2 */ diff --git a/Core/Src/stm32wlxx_it.c b/Core/Src/stm32wlxx_it.c index 66231ac..bfc2186 100644 --- a/Core/Src/stm32wlxx_it.c +++ b/Core/Src/stm32wlxx_it.c @@ -227,7 +227,7 @@ void EXTI0_IRQHandler(void) /* USER CODE END EXTI0_IRQn 1 */ } - +#if 0 /** * @brief This function handles EXTI Line 1 Interrupt. */ @@ -283,7 +283,7 @@ void USART2_IRQHandler(void) /* USER CODE END USART2_IRQn 1 */ } - +#endif /** * @brief This function handles RTC Alarms (A and B) Interrupt. */ diff --git a/Core/Src/sys_app.c b/Core/Src/sys_app.c index aeb505e..42d7e5d 100644 --- a/Core/Src/sys_app.c +++ b/Core/Src/sys_app.c @@ -122,7 +122,7 @@ void SystemApp_Init(void) UTIL_LPM_Init(); /* Disable Stand-by mode */ UTIL_LPM_SetOffMode((1 << CFG_LPM_APPLI_Id), UTIL_LPM_DISABLE); - + UTIL_LPM_SetOffMode((1 << CFG_LPM_UART_TX_Id), UTIL_LPM_ENABLE); #if defined (LOW_POWER_DISABLE) && (LOW_POWER_DISABLE == 1) /* Disable Stop Mode */ UTIL_LPM_SetStopMode((1 << CFG_LPM_APPLI_Id), UTIL_LPM_DISABLE); diff --git a/STM32CubeIDE/.settings/language.settings.xml b/STM32CubeIDE/.settings/language.settings.xml index 8480e85..24fc8ca 100644 --- a/STM32CubeIDE/.settings/language.settings.xml +++ b/STM32CubeIDE/.settings/language.settings.xml @@ -5,7 +5,7 @@ - + @@ -16,7 +16,7 @@ - + From 0b430cba4eb873b15bf38fb78d331b31b98c3f84 Mon Sep 17 00:00:00 2001 From: YunHorn Technology Date: Wed, 3 Apr 2024 19:07:30 +0800 Subject: [PATCH 13/15] try standby mode --- Core/Src/stm32_lpm_if.c | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/Core/Src/stm32_lpm_if.c b/Core/Src/stm32_lpm_if.c index 66c1338..9d98b45 100644 --- a/Core/Src/stm32_lpm_if.c +++ b/Core/Src/stm32_lpm_if.c @@ -78,14 +78,30 @@ const struct UTIL_LPM_Driver_s UTIL_PowerDriver = void PWR_EnterOffMode(void) { /* USER CODE BEGIN EnterOffMode_1 */ + /* Enable Power Clock */ + HAL_SuspendTick(); + /* Disable all used wakeup sources: Pin1(PA.0) */ + HAL_PWR_DisableWakeUpPin(PWR_WAKEUP_PIN1|PWR_WAKEUP_PIN2|PWR_WAKEUP_PIN3); + + /* Clear all related wakeup flags */ + __HAL_PWR_CLEAR_FLAG(PWR_FLAG_WU); + + /* Re-enable all used wakeup sources: Pin1(PA.0) */ + HAL_PWR_EnableWakeUpPin(PWR_WAKEUP_PIN1); + + /*## Enter Standby Mode ####################################################*/ + /* Request to enter STANDBY mode */ + HAL_PWR_EnterSTANDBYMode(); /* USER CODE END EnterOffMode_1 */ } void PWR_ExitOffMode(void) { /* USER CODE BEGIN ExitOffMode_1 */ - + //HAL_ResumeTick(); + __HAL_PWR_CLEAR_FLAG(PWR_FLAG_WU); + __HAL_PWR_CLEAR_FLAG(PWR_FLAG_SB); /* USER CODE END ExitOffMode_1 */ } From ddc748de52bbee94af880a40acc0829603de2793 Mon Sep 17 00:00:00 2001 From: YunHorn Technology Date: Sun, 7 Apr 2024 10:48:48 +0800 Subject: [PATCH 14/15] try standby --- STM32CubeIDE/.settings/language.settings.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/STM32CubeIDE/.settings/language.settings.xml b/STM32CubeIDE/.settings/language.settings.xml index 24fc8ca..8480e85 100644 --- a/STM32CubeIDE/.settings/language.settings.xml +++ b/STM32CubeIDE/.settings/language.settings.xml @@ -5,7 +5,7 @@ - + @@ -16,7 +16,7 @@ - + From 068153dfa56519222f25039aee3ffbe47306ff32 Mon Sep 17 00:00:00 2001 From: YunHorn Technology Date: Wed, 19 Jun 2024 14:57:15 +0800 Subject: [PATCH 15/15] initial WL55JC --- .gitignore | 87 ++++++++++++++++++++ STM32CubeIDE/.settings/language.settings.xml | 4 +- STM32CubeIDE/WL55JC_AS923.cfg | 46 +++++++++++ 3 files changed, 135 insertions(+), 2 deletions(-) create mode 100644 .gitignore create mode 100644 STM32CubeIDE/WL55JC_AS923.cfg diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..bdc3590 --- /dev/null +++ b/.gitignore @@ -0,0 +1,87 @@ +# ---> C +# Prerequisites +*.d + +# Object files +*.o +*.ko +*.obj +*.e1f +*.axf +*.de +*.cyclo +*.list +*.mk +*.settings.xml +*.mk +# Linker output +*.ilk +*.map +*.exp +*.list +*.su + +# Precompiled Headers +*.gch +*.pch + +# Libraries +*.lib +*.a +*.la +*.lo + +# Shared objects (inc. Windows DLLs) +*.dll +*.so +*.so.* +*.dylib + + +# Executables +*.exe +*.out +*.app +*.i*86 +*.x86_64 +*.dep +*.d +*.o +*.dp +*.lst +*.elf +*.build_log +*.build_log.htm + + +# Debug files +*.dSYM/ +*.su +*.idb +*.pdb +*.dbgconf +*.uvguix.lenovo +*.uvoptx +*.uvprojx +*.build_log.htm +*.htm +*.map +*.lnp +*.sct +*.crf +*.lst + + +# Kernel Module Compile Results +*.mod* +*.cmd +*.htm +*.html +.tmp_versions/ +modules.order +Module.symvers +Mkfile.old +dkms.conf +*.cyclo +*.settings.* + diff --git a/STM32CubeIDE/.settings/language.settings.xml b/STM32CubeIDE/.settings/language.settings.xml index 8480e85..816e149 100644 --- a/STM32CubeIDE/.settings/language.settings.xml +++ b/STM32CubeIDE/.settings/language.settings.xml @@ -5,7 +5,7 @@ - + @@ -16,7 +16,7 @@ - + diff --git a/STM32CubeIDE/WL55JC_AS923.cfg b/STM32CubeIDE/WL55JC_AS923.cfg new file mode 100644 index 0000000..a32bf98 --- /dev/null +++ b/STM32CubeIDE/WL55JC_AS923.cfg @@ -0,0 +1,46 @@ +# This is an NUCLEO-WL55JC1 board with a single STM32WL55JCIx chip +# +# Generated by STM32CubeIDE +# Take care that such file, as generated, may be overridden without any early notice. Please have a look to debug launch configuration setup(s) + +source [find interface/stlink-dap.cfg] + +st-link backend tcp + +set WORKAREASIZE 0x8000 + +transport select "dapdirect_swd" + +set CHIPNAME STM32WL55JCIx +set BOARDNAME NUCLEO-WL55JC1 + +# Enable debug when in low power modes +set ENABLE_LOW_POWER 1 + +# Stop Watchdog counters when halt +set STOP_WATCHDOG 1 + +# STlink Debug clock frequency +set CLOCK_FREQ 8000 + +# Reset configuration +# use hardware reset, connect under reset +# connect_assert_srst needed if low power mode application running (WFI...) +reset_config srst_only srst_nogate connect_assert_srst +set CONNECT_UNDER_RESET 1 +set CORE_RESET 0 + +# ACCESS PORT NUMBER +set AP_NUM 0 +# GDB PORT +set GDB_PORT 3333 + + + + +set DUAL_CORE 1 + +# BCTM CPU variables + +source [find target/stm32wlx.cfg] +