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

推荐订阅源

D
Darknet – Hacking Tools, Hacker News & Cyber Security
V
Vulnerabilities – Threatpost
Cloudbric
Cloudbric
G
GRAHAM CLULEY
S
Securelist
Schneier on Security
Schneier on Security
Help Net Security
Help Net Security
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
Project Zero
Project Zero
Spread Privacy
Spread Privacy
P
Privacy International News Feed
C
Cyber Attacks, Cyber Crime and Cyber Security
Cisco Talos Blog
Cisco Talos Blog
T
Tailwind CSS Blog
博客园_首页
有赞技术团队
有赞技术团队
Simon Willison's Weblog
Simon Willison's Weblog
Stack Overflow Blog
Stack Overflow Blog
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
Latest news
Latest news
T
Tor Project blog
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
Attack and Defense Labs
Attack and Defense Labs
www.infosecurity-magazine.com
www.infosecurity-magazine.com
O
OpenAI News
J
Java Code Geeks
T
Tenable Blog
K
Kaspersky official blog
AWS News Blog
AWS News Blog
S
Security @ Cisco Blogs
The GitHub Blog
The GitHub Blog
T
Threatpost
月光博客
月光博客
H
Heimdal Security Blog
Security Latest
Security Latest
The Hacker News
The Hacker News
Y
Y Combinator Blog
A
Arctic Wolf
Apple Machine Learning Research
Apple Machine Learning Research
C
Cisco Blogs
美团技术团队
Microsoft Security Blog
Microsoft Security Blog
Hugging Face - Blog
Hugging Face - Blog
T
The Blog of Author Tim Ferriss
C
CERT Recently Published Vulnerability Notes
D
Docker
Google Online Security Blog
Google Online Security Blog
D
DataBreaches.Net
V
Visual Studio Blog
H
Help Net Security

博客园 - 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