learning uboot auto switch to stanbdy system in qca4531 cpu
design:
when uboot load kerne failed,we can switch to stanbdy system;
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的更多相关文章
- 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 ...
- auto switch HTTP protocol Chrome Extension
auto switch HTTP protocol Chrome Extension HTTPS auto switch to HTTP VPN https://chrome.google.com/w ...
- learning uboot switch to standby system using button
pseudocode: If(reset_button was pressed ) { Change uboot env bootslot^1 }
- learning uboot test command
uboot commad test test - minimal test like /bin/sh so we can use test command to some judge for exam ...
- learning uboot distro design in am335x-evm board
reference: uboot_dir/doc/README.distro Linux distributions are faced with supporting a variety of bo ...
- learning uboot how to enable watchdog in qca4531 cpu
find cpu datasheet , watchdog relate registers: 0x18060008 watchdong timer control 0x1806000c watchd ...
- learning uboot enable protect console
reference :https://github.com/lentinj/u-boot/blob/master/doc/README.autoboot how to enable protect s ...
- learning uboot bootargs panic parameter
By passing the kernel panic parameter, the system automatically resets after 3 seconds when kernel p ...
- learning uboot source command
reference: http://www.denx.de/wiki/DULG/UBootCmdGroupExec => help source source - run script from ...
随机推荐
- 20145322 Exp5 利用nmap扫描
20145322 Exp5 利用nmap扫描 实验过程 使用命令创建一个msf所需的数据库 service postgresql start msfdb start 使用命令msfconsole开启m ...
- startActivityForResult( )用法
一.与startActivity( )的不同之处 1, startActivity( ) 仅仅是跳转到目标页面,若是想跳回当前页面,则必须再使用一次startActivity( ). 2, start ...
- Notepad++7.5.4 设置主题,使用插件
首先官网下载 Notepad++7.5.4 默认英文转换成中文 下面设置主题: 设置-->语言格式设置 选择主题Obsidian,字体选择等宽字体Consolas,大小为11,选择全局字体,使用 ...
- Zookeeper一致性协议原理Zab
ZooKeeper为高可用的一致性协调框架,自然的ZooKeeper也有着一致性算法的实现,ZooKeeper使用的是ZAB协议作为数据一致性的算法, ZAB(ZooKeeper Atomic Bro ...
- UVA 10462 Is There A Second Way Left?(次小生成树&Prim&Kruskal)题解
思路: Prim: 这道题目中有重边 Prim可以先加一个sec数组来保存重边的次小边,这样不会影响到最小生成树,在算次小生成树时要同时判断次小边(不需判断是否在MST中) Kruskal: Krus ...
- 51nod 1413 权势二进制
本来刚开始还是想用每一位 -1的个数 然后再乘以10 不断累加 后来发现 完全不是这回事啊 因为本身就是0 和 1 所以只要记录出现的最大的数字 就是答案 因为 n >= 1 // 所以不 ...
- Java DateUtil,日期整理
import java.text.DateFormat; import java.text.ParseException; import java.text.SimpleDateFormat; imp ...
- MVC ---- 增删改成 EF6
1.MVC EF6的增删改成小练习 namespace T4Demo { public partial class Form1 : Form { NBEntities nb = new NBEntit ...
- MongoVUE的Collections数据不显示的解决方法
问题描述: 使用 mongoDB数据库, 数据添加成功了,使用命令行能查询出来,但在MongoVUE 中数据却不显示 (我使用的是 mongoDB 3.4 的版本) 原因:引擎问题,只要降到2.X版 ...
- html 画圆
<html> <head> <script type = "text/javascript" src = "https://d3js.org ...