design:

  when uboot load kerne failed,we can switch to stanbdy system;

how to realize:

  when boot fail, we can let uboot env bootKenrelFailCount++, then save to uboot_env partiton.

    watchdog timeout will trigger cpu reset, when bootKernelFailCount bigger than a fixed number

  we can realize switch to stanbdy system

reference code:

void bootKernelFailProcess(){

char buf[100]=0;

char *s;

int bootKernelFailCount =0;

s=getenv("bootKernelFailCount");

bootKernelFailCount =++atoi(s);

sprintf(buf,"setenv bootKernelFailCount %d", bootKernelFailCount);

run_command(buf,0);

run_command("saveenv",0);

}

void changeBootslotFunction(){

char buf[100]=0;

int bootslot=0;

s=getenv("bootslot");

bootslot=atoi(s)^1;

sprintf(buf,"setenv bootslot %d",bootslot);

run_command(buf,0);

run_command("saveenv",0);

}

void bootKernelFailCountDetect(){

if( atoi(getenv("bootKernelfailCount ")) > 2 ){

run_command("setenv bootKernelFailCount  0",0);

changeBootslotFunction();

}

}

learning uboot auto switch to stanbdy system in qca4531 cpu的更多相关文章

  1. learning uboot how to set ddr parameter in qca4531 cpu

    DDR工作频率  在600MHZ. include/configs/board953x.h #define CFG_PLL_FREQ            CFG_PLL_650_600_200 #d ...

  2. auto switch HTTP protocol Chrome Extension

    auto switch HTTP protocol Chrome Extension HTTPS auto switch to HTTP VPN https://chrome.google.com/w ...

  3. learning uboot switch to standby system using button

    pseudocode: If(reset_button was pressed ) { Change  uboot env bootslot^1 }

  4. learning uboot test command

    uboot commad test test - minimal test like /bin/sh so we can use test command to some judge for exam ...

  5. learning uboot distro design in am335x-evm board

    reference: uboot_dir/doc/README.distro Linux distributions are faced with supporting a variety of bo ...

  6. learning uboot how to enable watchdog in qca4531 cpu

    find cpu datasheet , watchdog relate registers: 0x18060008 watchdong timer control 0x1806000c watchd ...

  7. learning uboot enable protect console

    reference :https://github.com/lentinj/u-boot/blob/master/doc/README.autoboot how to enable protect s ...

  8. learning uboot bootargs panic parameter

    By passing the kernel panic parameter, the system automatically resets after 3 seconds when kernel p ...

  9. learning uboot source command

    reference: http://www.denx.de/wiki/DULG/UBootCmdGroupExec => help source source - run script from ...

随机推荐

  1. 三星核S5PV210AH-A0 SAMSUNG

    三星S5PV210AH-A0 S5PV210又名“蜂鸟”(Hummingbird),是三星推出的一款适用于智能手机和平板电脑等多媒体设备的应用处理器,S5PV210和S5PC110功能一样,110小封 ...

  2. 洛谷 P2056 采花 - 莫队算法

    萧芸斓是 Z国的公主,平时的一大爱好是采花. 今天天气晴朗,阳光明媚,公主清晨便去了皇宫中新建的花园采花.花园足够大,容纳了 n 朵花,花有 c 种颜色(用整数 1-c 表示) ,且花是排成一排的,以 ...

  3. git如何生成指定两个commit之间的补丁

    答:git format-patch <base commit id>..<latest commit id> 如git log输出以下内容: commit 2222222 y ...

  4. uboot启动提示Error, wrong i2c adapter 0 max 0 possible后卡住了怎么办

    答:这个与i2c驱动有关,应该使能i2c驱动相关的配置项

  5. Java命令使用 jmap,jps,jstack,jstat,jhat,jinfo

    Jmap:可以获得运行中的jvm的堆的快照,从而可以离线分析堆,以检查内存泄漏,检查一些严重影响性能的大对象的创建,检查系统中什么对象最多,各种对象所占内存的大小等等 Jmap是一个可以输出所有内存中 ...

  6. 【域名配置】Tomcat外网发布域名配置

    1.修改端口 首先,访问服务器时默认的是80端口,tomcat中的server.xml文件直接修改,这里要说明的是如果一个服务器上有多个tomcat的话,修改端口需要注意的是要修改 <Serve ...

  7. FAST Hello World - Preparation for software's running environment

    Ubuntu 14.04 安装 libpcap-1.1.1 & libpnet-1.1.4 & NMAC function lib 参考: NetMagic.org yacc: com ...

  8. BZOJ 1003: [ZJOI2006]物流运输(spfa+dp)

    http://www.lydsy.com/JudgeOnline/problem.php?id=1003 题意: 思路: 首先用spfa计算一下任意两天之内的最短路,dis[a][b]表示的就是在第a ...

  9. [转]python新手必碰到的问题---encode与decode,中文乱码--转载

    edu.codepub.com/2009/1029/17037.php 这个问题在python3.0里已经解决了. 这有篇很好的文章,可以明白这个问题: 为什么会报错“UnicodeEncodeErr ...

  10. python 集合元素添加

    #A new empty set color_set = set() color_set.add("Red") print(color_set) #Add multiple ite ...