杰发科技AC7840/AC7843——standby模式保留ram数据

7840 ram地址分配

7840 standby低功耗下ram数据保留

keil的sct中配置如下

代码调用

cpp 复制代码
uint8 g_standbyTest __attribute__((section(".uinit_ram1fff"), zero_init));
uint8 g_standbyTestv1 __attribute__((section(".uinit_ram1400"), zero_init));

在休眠之前定义

退出休眠后

发现数据保留了

7843 ram地址分配

7843 standby低功耗下ram数据保留

sct链接文件修改

变量定义

cpp 复制代码
uint8 g_standbyTest __attribute__((section(".uinit_ram1fff"), zero_init));
uint8 g_standbyTestv1 __attribute__((section(".uinit_ram2000"), zero_init));
uint8 g_standbyTestBuff[3]  __attribute__ ((section(".uinit_ram1fff"),zero_init));

测试代码

cpp 复制代码
int main(void)
{
    Spm_Reg_SelectLVDThreshold(SPM_LOW);    /* 设置低电压检测阈值: SPM_LOW对应3.3V供电系统, SPM_HIGH对应5V供电系统 */

    Ckgen_Hal_InitClk(&g_clockGenCfg);
    Ckgen_Hal_DistributeClk(&g_clkDistributeCfg);

    OsIf_Init();
    Debug_Init();

    GPIO_KeyInit();
    GPIO_LedInit();
	
    Spm_Hal_Init(&Spm_UserConfig);

    Debug_Printf("GPIO Basic Test-----------------\r\n");
	
		spmWakeupStatus = Spm_Hal_GetStandbyWakeupStatus();
		Debug_Printf("spmWakeupStatus = %x\r\n",spmWakeupStatus);
	
		resetStatus = Rcm_Hal_GetResetStatus();
		Debug_Printf("resetStatus = %x\r\n",resetStatus);
	
	
		Debug_Printf("standbyTest = %d\r\n",g_standbyTest);
        Debug_Printf("standbyTestv1 = %d\r\n",g_standbyTestv1);
		Debug_Printf("g_standbyTestBuff = %d\r\n",g_standbyTestBuff[0]);
	
		g_standbyTest = 100;                         /*standbyTest   赋值后 Standby 唤醒后SRAM中保持为0x64*/
        g_standbyTestv1 = 100;                       
		g_standbyTestBuff[0] = 100;

		OsIf_UDelay(1000000);
		
		Rcm_Hal_ClearResetStatus();
		
		
    while (1)
    {
        LED_Toggle_Task();

        if (FALSE != Get_Key1_Status())
        {
						Spm_Hal_SetPowerMode(SPM_MODE_STANDBY);
            LED1_TOGGLE;
            LED2_TOGGLE;
        }
    }
}
相关推荐
BBNbQKHXygfU1 天前
基于遗传算法优化BP神经网络的时间序列预测探索
mcu
想放学的刺客1 天前
单片机嵌入式试题(第30期)全局变量“满天飞“!!!局限性和影响有哪些,什么情况下才不得不使用?
单片机·嵌入式硬件·mcu·物联网·51单片机
网易独家音乐人Mike Zhou1 天前
【RealMCU】瑞昱官方LOG信息保存及解析,DebugAnalyzer自动化接收脚本(不需要用到ROM.trace文件)
单片机·mcu·物联网·自动化·嵌入式·iot·瑞昱
AIR-IT1 天前
国产ZYJ服务器RAID 5重建完整流程
服务器·国产·raid·浪潮
郝亚军4 天前
获取libiec61850和如何编译iec61850库
mcu·tcp/ip
liu_endong4 天前
杰发科技AC7840——打印所有GPIO的PORT配置寄存器
mcu·算法·杰发科技·autochips·车规芯片
想放学的刺客4 天前
单片机嵌入式系统试题(第28期)flash芯片各引脚作用?低功耗设计估算电池续航时间是多少?如何优化低功耗等项目经验
stm32·单片机·嵌入式硬件·mcu·物联网·51单片机
MickyCode6 天前
嵌入式开发调试之Traceback
arm开发·stm32·单片机·mcu
wotaifuzao7 天前
【Keil 5安装】keil 5最新版本安装+环境配置+下载百度资源分享(安装包,注册机等)
stm32·单片机·嵌入式硬件·mcu·学习·keil5·最新keil
帅次7 天前
系统分析师-信息物理系统分析与设计
stm32·单片机·嵌入式硬件·mcu·物联网·iot·rtdbs