惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

T
The Blog of Author Tim Ferriss
Know Your Adversary
Know Your Adversary
P
Palo Alto Networks Blog
D
Darknet – Hacking Tools, Hacker News & Cyber Security
K
Kaspersky official blog
L
LINUX DO - 热门话题
P
Proofpoint News Feed
P
Privacy & Cybersecurity Law Blog
Google DeepMind News
Google DeepMind News
Attack and Defense Labs
Attack and Defense Labs
Cisco Talos Blog
Cisco Talos Blog
AI
AI
L
LINUX DO - 最新话题
H
Heimdal Security Blog
Hacker News: Ask HN
Hacker News: Ask HN
Webroot Blog
Webroot Blog
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
The GitHub Blog
The GitHub Blog
I
Intezer
Blog — PlanetScale
Blog — PlanetScale
有赞技术团队
有赞技术团队
S
Securelist
博客园_首页
IT之家
IT之家
Schneier on Security
Schneier on Security
博客园 - 叶小钗
罗磊的独立博客
WordPress大学
WordPress大学
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
MongoDB | Blog
MongoDB | Blog
P
Proofpoint News Feed
阮一峰的网络日志
阮一峰的网络日志
A
Arctic Wolf
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
W
WeLiveSecurity
The Register - Security
The Register - Security
D
DataBreaches.Net
S
Security @ Cisco Blogs
Security Archives - TechRepublic
Security Archives - TechRepublic
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
腾讯CDC
Recorded Future
Recorded Future
NISL@THU
NISL@THU
N
News and Events Feed by Topic
T
Tailwind CSS Blog
N
News and Events Feed by Topic
Cyberwarzone
Cyberwarzone
T
Tor Project blog
www.infosecurity-magazine.com
www.infosecurity-magazine.com

博客园 - midhillzhou

windows 11关闭防火墙 以使得 外部的开发板可以主动发起ping通电脑 uboot中调试景略以太网phy JL3111A2-NA windows上excel运行macro之后出现错误 在linux上移植sgdisk 在linux上移植phytool + 调试tja1103 以太网phy 使用gdb调试user程序 之 某个线程的调用栈 在uboot中修改tja 1103以太网phy from slave to master porting perf性能观测工具 porting 开源memtester uboot 2020版本下gpio命令的使用 + linux下的libgpiod lib库的移植使用 ubi文件系统的 制作 + 挂载 + 若干问题 i2c指令使用 + 仿照开源i2ctransfer实现的自己的i2ctransfer windows下outlook 撤回邮件 安装repo 使用lauterbach debug uboot之重定位 uboot nand flash dump 环境变量 + 制作环境变量分区 + 代码结构详解 uboot bootm代码详解图 Beyond Compare 进行二进制文档的比对时,怎么去对齐(转载) notepad++分析log小技巧 使用继电器控制开发板上下电 uboot debug小技巧
uboot中各种memory读写命令
midhillzhou · 2025-05-26 · via 博客园 - midhillzhou

1.按byte写ddr memory

mw.b 0x42000000 0x00 0x80000          //从ddr地址0x42000000开始,填充0x00, 写的长度是0x80000

0x42000000: ddr地址        0x00:填充的内容          0x80000:填充的长度

2.按byte读ddr memory                         
md.b 0x42000000 0x80000       //从ddr地址0x42000000开始,dump内容到串口,dump的长度为0x80000

0x42000000: ddr地址      0x80000:dump的长度

3.将mtd分区读取到ddr

mtd read spl 0x42000000           将分区spl从nand flash读取到ddr地址0x42000000

4.nand 读(nand flash->ddr)

nand read 0x42000000 0x00100000 0x00400000

0x42000000:放到的ddr地址      0x00100000:nand flash中的偏移      0x00400000:大小

5.nand读(nand flash->直接打印到串口)

nand dump 0x00100000 0x10
0x00100000:nand flash中的偏移        0x10:大小
注意这个命令只会dump出来所在的page的整个内容

6.tftpput传输到电脑上

tftpput 0x42000000 0x80000 dump.bin      //从ddr地址0x42000000开始,通过tftpput将文件传输到pc,传输的长度为0x80000

如果tftpput命令不支持,需要打开宏

CONFIG_NET_TFTP_VARS=y
CONFIG_CMD_TFTPPUT=y

然后重启编译uboot

7.怎么在ddr里面寻找一块可以存放nand flash里面读取的内容的地址,即上面的0x42000000

一方面:先通过bdinfo得到ddr所占据的地址空间

另一方面:在启动过程中会把kernel和dtb放到ddr,比如下,所以我们可以临时先用这一部分


tftpboot 0x41000000 os_kernel
tftpboot 0x42000000 os.dtb

或者

boot cmd is :bootm 0x40008400 - 0x48008400

注:三个使用实例如下

注1:通过mtd将某个分区读取出来,并通过tftp传输到电脑

mw.b 0x42000000 0x00 0x80000 从ddr地址0x42000000开始,填充0x00, 写的长度是0x80000
mtd read spl 0x42000000 将分区spl从nand flash读取到ddr地址0x42000000
tftpput 0x42000000 0x80000 dump.bin 从ddr地址0x42000000开始,通过tftpput将文件传输到pc,传输的长度为0x80000

注2:上面是通过mtd读出来,这里通过更底层的nand接口读出来,交叉验证,读出来的结果

nand read 0x100000000 0x500000 0x800

md.b 0x100000000 0x800

注3:由于这两者都是把nand flash的先读取到ddr, ddr的地址可能会选择的不太对, 不太对是指被其他程序使用了,所以也可以先直接dump个header出来看看,交叉验证注1,注2

如果头是不一致的,建议更换注1,注2中的ddr地址

nand dump 0x500000 0x48