Skip to content

Commit 68ee408

Browse files
committed
boards: st: nucleo_wb09ke: Optimize power consumption
Optimize power consumption for the Nucleo-WB09KE board by implementing correct pull-up/pull-down configurations when the device enters lower power states. Signed-off-by: Ali Hozhabri <[email protected]>
1 parent 1c30da4 commit 68ee408

File tree

2 files changed

+49
-0
lines changed

2 files changed

+49
-0
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Copyright (c) 2025 STMicroelectronics
2+
#
3+
# SPDX-License-Identifier: Apache-2.0
4+
5+
zephyr_library_sources_ifdef(CONFIG_PM board.c)

boards/st/nucleo_wb09ke/board.c

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
/*
2+
* Copyright (c) 2025 STMicroelectronics
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
#include <zephyr/init.h>
8+
#include "stm32wb0x_ll_pwr.h"
9+
10+
/* Implement the correct Pull-up/pull-down for GPIOA and GPIOB
11+
* to reach the minimum power consumption.
12+
*/
13+
static int board_pupd_init(void)
14+
{
15+
LL_PWR_EnableGPIOPullUp(LL_PWR_GPIO_A,
16+
LL_PWR_GPIO_BIT_0|
17+
LL_PWR_GPIO_BIT_1|
18+
LL_PWR_GPIO_BIT_2|
19+
LL_PWR_GPIO_BIT_3);
20+
21+
LL_PWR_EnableGPIOPullDown(LL_PWR_GPIO_A,
22+
LL_PWR_GPIO_BIT_8|
23+
LL_PWR_GPIO_BIT_9|
24+
LL_PWR_GPIO_BIT_10|
25+
LL_PWR_GPIO_BIT_11);
26+
27+
LL_PWR_EnableGPIOPullDown(LL_PWR_GPIO_B,
28+
LL_PWR_GPIO_BIT_0|
29+
LL_PWR_GPIO_BIT_3|
30+
LL_PWR_GPIO_BIT_6|
31+
LL_PWR_GPIO_BIT_7);
32+
33+
LL_PWR_EnableGPIOPullUp(LL_PWR_GPIO_B,
34+
LL_PWR_GPIO_BIT_1|
35+
LL_PWR_GPIO_BIT_2|
36+
LL_PWR_GPIO_BIT_4|
37+
LL_PWR_GPIO_BIT_5|
38+
LL_PWR_GPIO_BIT_14|
39+
LL_PWR_GPIO_BIT_15);
40+
41+
return 0;
42+
}
43+
44+
SYS_INIT(board_pupd_init, PRE_KERNEL_2, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT);

0 commit comments

Comments
 (0)