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. Visual Leak Detector简明使用教程

    Visual Leak Detector是一款内存泄漏检测软件,主要的作用就是检测可能或者是存在内存泄露的地方,具体的功能的话,可以百度下,今天主要简单介绍下怎么使用 首先下载Visual Leak ...

  2. Open Source Log Management

    https://www.elastic.co/solutions/logging The Elastic Stack (sometimes known as the ELK Stack) is the ...

  3. BZOJ4887: [Tjoi2017]可乐 矩阵快速幂

    Description 加里敦星球的人们特别喜欢喝可乐.因而,他们的敌对星球研发出了一个可乐机器人,并且 放在了加里敦星球的1号城市上.这个可乐机器人有三种行为:停在原地,去下一个相邻的 城市,自爆. ...

  4. java的基本数据类型默认值

    这里就举int类型 默认值在类实例化,也就是对象中才有默认值0,或者是静态变量. 1.先看局部变量使用(不行,报错) 2.静态变量 3.类非静态属性

  5. 03_Spark集群部署

    [安装前的环境准备] Hadoop:2.6.1Java:jdk-1.7.0Spark: spark-1.6.0-bin-hadoop2.6.tgzScala: scala-2.11.4.tgz虚拟机: ...

  6. Codeforces Beta Round #94 div 1 D Numbers map+思路

    D. Numbers time limit per test 2 seconds memory limit per test 256 megabytes input standard input ou ...

  7. rostopic 命令

    rostopic bw display bandwidth used by topic// rostopic delay display delay for topic which has heade ...

  8. shell :

    示例一.(用作注释,占位)#!/bin/bash : this is single line comment : 'this is a multiline comment, second line e ...

  9. Windows系统下在Eclipse中集成Python

    我现在偶尔开发代码,已经不用Eclipse了,主要原因是查看Jar包中的代码反编译十分不便,项目加载的时候卡,偶尔还会崩溃 用Intellij IDEA和PyCharm 原来的笔记如何在Eclipse ...

  10. Android TableLayout中的使用说明

    TableLayout特点: 1)TableLayout和我们平时在网页上见到的Table有所不同,TableLayout没有边框的 2)它是由多个TableRow对象组成,每个TableRow可以有 ...