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

推荐订阅源

量子位
S
Securelist
MyScale Blog
MyScale Blog
Jina AI
Jina AI
罗磊的独立博客
The Cloudflare Blog
美团技术团队
博客园 - 叶小钗
阮一峰的网络日志
阮一峰的网络日志
博客园 - 三生石上(FineUI控件)
月光博客
月光博客
雷峰网
雷峰网
小众软件
小众软件
aimingoo的专栏
aimingoo的专栏
大猫的无限游戏
大猫的无限游戏
博客园 - Franky
博客园 - 聂微东
Y
Y Combinator Blog
酷 壳 – CoolShell
酷 壳 – CoolShell
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
MongoDB | Blog
MongoDB | Blog
T
Tailwind CSS Blog
Attack and Defense Labs
Attack and Defense Labs
博客园_首页
Latest news
Latest news
Apple Machine Learning Research
Apple Machine Learning Research
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
The Hacker News
The Hacker News
G
GRAHAM CLULEY
Simon Willison's Weblog
Simon Willison's Weblog
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
P
Proofpoint News Feed
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
U
Unit 42
D
Docker
Webroot Blog
Webroot Blog
N
Netflix TechBlog - Medium
T
Tor Project blog
C
Cyber Attacks, Cyber Crime and Cyber Security
L
LINUX DO - 最新话题
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
The Last Watchdog
The Last Watchdog
B
Blog
Recent Announcements
Recent Announcements
GbyAI
GbyAI
Microsoft Azure Blog
Microsoft Azure Blog
Security Latest
Security Latest
V2EX - 技术
V2EX - 技术
N
News | PayPal Newsroom
Microsoft Security Blog
Microsoft Security Blog

博客园 - 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 uboot中各种memory读写命令 uboot nand flash dump 环境变量 + 制作环境变量分区 + 代码结构详解 uboot bootm代码详解图 Beyond Compare 进行二进制文档的比对时,怎么去对齐(转载) notepad++分析log小技巧 使用继电器控制开发板上下电 uboot debug小技巧
使用lauterbach debug uboot之重定位
midhillzhou · 2025-06-03 · via 博客园 - midhillzhou

1.首先运行cmm脚本,attach cpu,让cpu停在romcode阶段

当运行完cmm脚本后,观察下右下角lauterbach的状态栏变化,最终状态是stopped。

power down -> Running -> stopped

cmm脚本内容如下

 1 RESet
 2 SYStem.RESET
 3 SYStem.config SWDP ON
 4 SYStem.CPU CortexA7MPCORE
 5 SYStem.CONFIG CoreNumber 4.
 6 system.resetout
 7 CORE.NUMber 4.
 8 
 9 SYStem.CONFIG DEBUGACCESSPORT 0.
10 SYStem.CONFIG APBACCESSPORT 0.
11 SYStem.CONFIG MEMORYACCESSPORT 1.
12 SYStem.CONFIG AXIACCESSPORT 1.
13 
14 SYStem.CONFIG COREDEBUG Base DAP:0x80030000 DAP:0x80032000 ;DAP:0x80014000 DAP:0x80710000
15 SYStem.CONFIG BMC       Base DAP:0x80031000 DAP:0x80033000 ;DAP:0x80630000 DAP:0x80730000
16 
17 SYStem.JtagClock 2MHz
18 
19 SYStem.CONFIG.DEBUGPORTTYPE SWD
20 
21 SYStem.Mode Attach
22 break
23 
24 ENDDO

2.加载spl elf,完成ddr的初始化

2.1可以选中文件直接拖进来,也可以输入以下命令。

Data.LOAD.Elf Y:\sdk\SDK_2024\boot\bl1\spl\spl.elf

2.2 设置断点到uboot的第一条指令

从代码里面可以看到spl跳到uboot执行的地址是 0x50000400

2.3 点击go,完成ddr的初始化

 3. 加载uboot.bin到ddr地址0x50000400

Data.LOAD.Binary Y:\sdk\SDK_2024\boot\uboot\u-boot-2020.04\u-boot.bin 0x50000400

并加载对应的elf文件到lauterbach

Data.LOAD Y:\sdk\SDK_2024\boot\uboot\u-boot-2020.04\u-boot /nocode

4.做源代码路径转换

sYmbol.SourcePATH.Translate "/home/zhongshan" "Y:\"

我是把虚拟机ubuntu里面的/home/zhongshan通过samba服务器映射为windows上的Y盘

5.设置断点并查看reloc_off值

5.1 setup_reloc

5.2 点击go

5.3 查看reloc_off值

 6.用offset重新加载对应的elf文件到lauterbach

Data.LOAD Y:\sdk\SDK_2024\boot\uboot\u-boot-2020.04\u-boot 0x2ff09c00 /nocode

7.在重定位后的board_init_r打断点(一定要删除重定位前打的断点,不然会出现错误)

 点击go,观察串口输出

8.在启动linux kernel的do_bootm_states打断点

打完断点后,点击go,查看串口log

注1:参考网上的两个图片