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. 20145337 《网络对抗技术》Web基础

    20145337 <网络对抗技术>Web基础 一.实验后回答问题 什么是表单? 表单是HTML的一个重要部分,主要用于将用户输入的信息提交到服务器.如果是普通的HTML页面,则当浏览器提出 ...

  2. python判断结构总结

    1.判断结构是允许程序针对不同情况执行不同指令序列的控制结构. 2.判断在Python中用if语句实现.简单的判断是用一个简单的if来实现的.两路判断通常使用if-else.多路判断用if-elif- ...

  3. 获取mips32机器的各数据类型的取值范围

    一.背景: 使用的mips 32bit机器,32bit的vxworks操作系统(各机器带来的范围都不一样,与操作系统也有关联) 二.验证类型的范围: 2.1 unsigned long: void m ...

  4. User-Defined Table Types 用户自定义表类型

    Location 数据库--可编程性--类型--用户定义表类型 select one database--> programmability-->types-->user--defi ...

  5. C#调用系统蜂鸣(需要发出警告时挺好用的 即使没有声卡)

    http://heavenslv.iteye.com/blog/1033870 // 声明 public class BeepUp { /// <param name="iFreque ...

  6. Sass常用写法

    Sass使用变量,变量以$开头 $bgcolor:#f40; background-color:$bgcolor; 如果变量需要嵌套在字符串当中,就需要写在#{}之中 $direction:left; ...

  7. springmvc的声明式事务管理类型讲解

    以方法为单位,进行事务控制:抛出异常,事务回滚.   最小的执行单位为方法.决定执行成败是通过是否抛出异常来判断的,抛出异常即执行失败   中文名 声明式事务 外文名 declarative tran ...

  8. 关于express项目的创建与启动

    没有经常用,所以经常搞错, 创建express项目,需要新建一个文件夹名,这个文件名就是用来承载express的内容的, 好了.打开终端,cd至创建的文件夹之下. 也可以直接这样,如以下,admin为 ...

  9. Goroutines和Channels(二)

    网络编程是并发大显身手的一个领域,由于服务器是最典型的需要同时处理很多连接的程序,这些连接一般来自于彼此独立的客户端. 本小节,我们会讲解go语言的net包,这个包提供编写一个网络客户端或者服务器程序 ...

  10. Windows 2003 server下载

    http://www.downza.cn/soft/182837.html或http://www.imsdn.cn/operating-systems/windows-server-2003/