Skip to content

Improve sf32lb52 low power mode stability.#364

Merged
gmarull merged 4 commits into
coredevices:mainfrom
cameled:deepsleep
Nov 3, 2025
Merged

Improve sf32lb52 low power mode stability.#364
gmarull merged 4 commits into
coredevices:mainfrom
cameled:deepsleep

Conversation

@cameled
Copy link
Copy Markdown
Contributor

@cameled cameled commented Oct 15, 2025

This improve the sf32lb52 low power mode stability.

Low power current on big board is mainly from the blue led, nearly 2 mA. Also find current leak on HR pin, about 150uA. Current low power performance as below. (still have some IO leak?)

Screenshot from 2025-10-20 01-49-48

In deepsleep mode, HXT48 clock should be enable. its effective the LCPU/BLE and wakeup time. After HXT48 clock enable, BLE worked (not full tested), and wakeup time drop to 1ms.

Remain work:

  1. Should add button to AON wakeup source, or the UI response is slow.

@cameled cameled added the DNM Do Not Merge label Oct 15, 2025
@cameled cameled force-pushed the deepsleep branch 2 times, most recently from e2fede0 to f7fc0ea Compare October 19, 2025 12:38
@cameled cameled changed the title [DNM] stop mode power consume checking Improve sf32lb52 low power mode stability. Oct 26, 2025
@cameled cameled removed the DNM Do Not Merge label Oct 26, 2025
// Reset HR pin, clear IE, PE
hwp_pinmux1->PAD_PA09 &= ~((1 << 6) | (1 << 4));
hwp_pinmux1->PAD_PA20 &= ~((1 << 6) | (1 << 4));
hwp_pinmux1->PAD_PA25 &= ~((1 << 6) | (1 << 4));
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Leak is from PA09 or PA20(forget which one). As I tested, after reset that pin, current drop 150uA.

@gmarull
Copy link
Copy Markdown
Member

gmarull commented Oct 28, 2025

Measured average current when connected to a phone (blue led is desoldered):

image

I observe display turning randomly to black, so something's broken there, like if it is being disabled or something, can you check? (using BB2)

@cameled
Copy link
Copy Markdown
Contributor Author

cameled commented Oct 28, 2025

Original performance data is measured without hxt48 change. Looks hxt48 enable is a new point we get, but not the final.

@gmarull
Copy link
Copy Markdown
Member

gmarull commented Oct 28, 2025

Original performance data is measured without hxt48 change. Looks hxt48 enable is a new point we get, but not the final.

Could you also check display problems?

@cameled cameled force-pushed the deepsleep branch 2 times, most recently from 940e724 to 6d53569 Compare October 29, 2025 09:23
@cameled
Copy link
Copy Markdown
Contributor Author

cameled commented Oct 29, 2025

Original performance data is measured without hxt48 change. Looks hxt48 enable is a new point we get, but not the final.

Could you also check display problems?

black or dim? I see it will enter dim state.

@gmarull
Copy link
Copy Markdown
Member

gmarull commented Oct 30, 2025

please rebase

The AON IRQ pending issue have been fixed, also add a ipc queue idle
check to avoid LCPU enter incorrect state.

The unstable wakeup time issue still remain, sometimes need nearly 8ms
to wakeup.

Thanks for xiaoming's support.

Signed-off-by: HaiLong Yang <cameled@outlook.com>
Use enabled flag to avoid stop mode counter inconsistent.

Signed-off-by: HaiLong Yang <cameled@outlook.com>
Signed-off-by: HaiLong Yang <cameled@outlook.com>
Set RC32K as LP clock, which will reduce the deepsleep wakeup time.

Signed-off-by: HaiLong Yang <cameled@outlook.com>
@cameled
Copy link
Copy Markdown
Contributor Author

cameled commented Nov 2, 2025

@gmarull The black issue fixed.

@gmarull
Copy link
Copy Markdown
Member

gmarull commented Nov 3, 2025

@gmarull The black issue fixed.

I can see firmware is stable now, average current is:

image

@gmarull gmarull merged commit 985ab14 into coredevices:main Nov 3, 2025
21 checks passed
@cameled cameled deleted the deepsleep branch November 4, 2025 00:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants