[N32L4xx] N32L403进入LR RUN模式后功耗没有变化依然是2ma

[复制链接]
45|0
Urada 发表于 2026-4-10 21:14 | 显示全部楼层 |阅读模式
, ST, rc, ma, N32L403,
各位大佬好 我尝试用例程代码测试芯片进入LR RUN模式时的功耗 以便后续康康能不能用cr12系列纽扣电池为它供电 但是进入LR RUN之后功耗似乎和run模式下相比没有变化 依然是2ma 我另外测试了standby和stop2模式, 在standby模式下电流1ua stop2模式下电流2ua 都符合datasheet的描述, 板上除了l403之外没有其他的电路和外部晶振 供电是从CMSIS DAP引出的 通过一个电流计连接到MCU 电流计应该没有问题, 毕竟standby能测出1ua的电流, 另外在LR RUN期间芯片也没有跑飞 能正常翻转gpio 使用swd进入调试会有无法连接 芯片可能处于休眠模式之类的提示. 之后我又进行了很多测试, 比如尝试显式禁用所有外设 把gpio都设置为模拟输入 flash设置为低功耗模式 但是都没有帮助, 电流最高2.2ma, 最低时也有1.9ma. 但是根据手册L403在LR RUN模式 flash低功耗模式下电流应该低至200ua才对. 以下是最初的测试代码:

  1. #include "main.h"

  2. #include <stdio.h>

  3. #include <stdint.h>

  4. #include "n32l40x.h"



  5. void delay(vu32 nCount)

  6. {

  7.     vu32 index = 0;

  8.     for (index = (34000 * nCount); index != 0; index--)

  9.     {

  10.     }

  11. }



  12. void SetSysClock_MSI(void)

  13. {

  14.     if(RESET == RCC_GetFlagStatus(RCC_CTRLSTS_FLAG_MSIRD))

  15.     {

  16.         /* Enable MSI and Config Clock */

  17.         RCC_ConfigMsi(RCC_MSI_ENABLE, RCC_MSI_RANGE_4M);

  18.         /* Waits for MSI start-up */

  19.         while(SUCCESS != RCC_WaitMsiStable());

  20.     }



  21.     /* Enable Prefetch Buffer */

  22.     FLASH_PrefetchBufSet(FLASH_PrefetchBuf_EN);



  23.     /* Select MSI as system clock source */

  24.     RCC_ConfigSysclk(RCC_SYSCLK_SRC_MSI);



  25.     /* Wait till MSI is used as system clock source */

  26.     while (RCC_GetSysclkSrc() != 0x00)

  27.     {

  28.         /* If this bits are always not set,

  29.         it means system clock select MSI failed,

  30.         user can add here some code to deal with this error */

  31.     }



  32.     /* HCLK = SYSCLK */

  33.     RCC_ConfigHclk(RCC_SYSCLK_DIV1);



  34.     /* PCLK2 = HCLK */

  35.     RCC_ConfigPclk2(RCC_HCLK_DIV1);



  36.     /* PCLK1 = HCLK */

  37.     RCC_ConfigPclk1(RCC_HCLK_DIV1);

  38. }



  39. /**

  40. * [url=/u/brief]@brief[/url]  Main program.

  41. */

  42. int main(void)

  43. {

  44.     /* Enable PWR Clock */

  45.     RCC_EnableAPB1PeriphClk(RCC_APB1_PERIPH_PWR, ENABLE);



  46.                 /* Before entering LP RUN mode, you must make sure that the system clock is less

  47.                 than or equal to 4MHz. This project takes configuring MSI (4MHz) as an example,

  48.                 and users can configure other clock sources as system clock as needed */

  49.                 SetSysClock_MSI();

  50.                 /* Request to enter LP RUN mode sysclock switch to MSI*/

  51.                 PWR_EnterLowPowerRunMode();



  52.            while(1)

  53.     {

  54.     }

  55. }


您需要登录后才可以回帖 登录 | 注册

本版积分规则

1

主题

1

帖子

0

粉丝
快速回复 在线客服 返回列表 返回顶部
0