CodeWarrior+USBTAP调试U-Boot
时间:2010-07-15 来源:山行
!# U-Boot 编译调试 ## 请参考Pro_&_Linux_App_Edition_Targeting_Manual.chm
./ltib ## install ltib
$ ./ltib -p u-boot -m prep ## get U-Boot source
$ cd rpm/BUILD/u-boot-1.1.3
$ vim config.mk
DBGFLAGS = -g2 -gdwarf-2
AFLAGS_DEBUG = -Wa,-gdwarf2
OPTFLAGS = -O1
$ vim u-boot-1.1.3/lib_ppc/board.c ## line624: debug => printf
debug ("Now running in RAM - U-Boot at: %08lx\n", dest_addr);
=> printf ("Now running in RAM - U-Boot at: %08lx\n", dest_addr);
$ make ## 编译,最好用 ./ltib -p u-boot -m scbuild
注意: 用ltib 编译,要修改confing/platform/mpc8349itx/.config中CLFAGS参数
编译常用(make distclean ; make MPC8349ITX_config ; make ) 启动linux samba服务,将u-boot目录做共享目录由windows访问
在windows上访问uboot共享目录,打开后右键点击共享目录,映射为磁盘驱动器z 启动CodeWarrior IDE,
@ IDE: File > Open , find and open ELF file: u-boot , click OK
@ IDE: Choose Debugger : CodeWarrior USB TAP , click OK
按照提示选择添加缺少的文件start.S(前提是将源码完全复制),其余会自动添加,不能自动添加的,手动添加。 设置好断点,开发板上电。 加上跳线J22E,利用u-boot烧写u-boot.bin 到 fe700000
=> erase 0xfe70000 0xfe74ffff
=> cp.b $loadaddr 0xfe700000 $filesize
完毕,重启,去掉J22E调试。或flash 烧写u-boot.bin到fe700000 (依据Pro_&_Linux_App_Edition_Targeting_Manual.chm)
上面利用u-boot烧写u-boot.bin到fe700000相当于下面的操作:
去掉J22 A,B,C,E,利用CodeWarrior烧写u-boot.bin到 0xfef0_0000
flash programmer加载配置文件liuby.xml,修改Flash Memory Base Address为fe80_0000
在Erase/Blank_chek窗口不要勾选 All Sectors,鼠标选取 fef00000 <-> fef4_ffff,擦除
在Program/Verify窗口选取u-boot.bin,修改Apply Address Offset: 0xfef00000,烧写。
完毕,插上J22 A,B,C,重启,调试。 调试分为3个阶段:
Debugging U-Boot before the MMU is Enabled
Debugging U-Boot after the MMU is Enabled
Debugging the U-Boot Section in RAM 1. Debugging U-Boot before the MMU is Enabled
遵照<Pro*.chm>选择alternate load address: 0xfef0 0000
不选择Use Target Initialization File
CW -> Debug -> Attach to Process ;break停止,F10单步运行
2. Debugging U-Boot after the MMU is Enabled
遵照<Pro*.chm>,不选择Alternate Load Addr:
不选择Use Target Initialization File
CW -> Debug -> Attach to Process ;break停止,F10单步运行
board_init_f(board.c)函数入口处设置 hardware断点。 随记.
./ltib ## install ltib
$ ./ltib -p u-boot -m prep ## get U-Boot source
$ cd rpm/BUILD/u-boot-1.1.3
$ vim config.mk
DBGFLAGS = -g2 -gdwarf-2
AFLAGS_DEBUG = -Wa,-gdwarf2
OPTFLAGS = -O1
$ vim u-boot-1.1.3/lib_ppc/board.c ## line624: debug => printf
debug ("Now running in RAM - U-Boot at: %08lx\n", dest_addr);
=> printf ("Now running in RAM - U-Boot at: %08lx\n", dest_addr);
$ make ## 编译,最好用 ./ltib -p u-boot -m scbuild
注意: 用ltib 编译,要修改confing/platform/mpc8349itx/.config中CLFAGS参数
编译常用(make distclean ; make MPC8349ITX_config ; make ) 启动linux samba服务,将u-boot目录做共享目录由windows访问
在windows上访问uboot共享目录,打开后右键点击共享目录,映射为磁盘驱动器z 启动CodeWarrior IDE,
@ IDE: File > Open , find and open ELF file: u-boot , click OK
@ IDE: Choose Debugger : CodeWarrior USB TAP , click OK
按照提示选择添加缺少的文件start.S(前提是将源码完全复制),其余会自动添加,不能自动添加的,手动添加。 设置好断点,开发板上电。 加上跳线J22E,利用u-boot烧写u-boot.bin 到 fe700000
=> erase 0xfe70000 0xfe74ffff
=> cp.b $loadaddr 0xfe700000 $filesize
完毕,重启,去掉J22E调试。或flash 烧写u-boot.bin到fe700000 (依据Pro_&_Linux_App_Edition_Targeting_Manual.chm)
上面利用u-boot烧写u-boot.bin到fe700000相当于下面的操作:
去掉J22 A,B,C,E,利用CodeWarrior烧写u-boot.bin到 0xfef0_0000
flash programmer加载配置文件liuby.xml,修改Flash Memory Base Address为fe80_0000
在Erase/Blank_chek窗口不要勾选 All Sectors,鼠标选取 fef00000 <-> fef4_ffff,擦除
在Program/Verify窗口选取u-boot.bin,修改Apply Address Offset: 0xfef00000,烧写。
完毕,插上J22 A,B,C,重启,调试。 调试分为3个阶段:
Debugging U-Boot before the MMU is Enabled
Debugging U-Boot after the MMU is Enabled
Debugging the U-Boot Section in RAM 1. Debugging U-Boot before the MMU is Enabled
遵照<Pro*.chm>选择alternate load address: 0xfef0 0000
不选择Use Target Initialization File
CW -> Debug -> Attach to Process ;break停止,F10单步运行
2. Debugging U-Boot after the MMU is Enabled
遵照<Pro*.chm>,不选择Alternate Load Addr:
不选择Use Target Initialization File
CW -> Debug -> Attach to Process ;break停止,F10单步运行
board_init_f(board.c)函数入口处设置 hardware断点。 随记.
相关阅读 更多 +
排行榜 更多 +

<img preview="http://pic.pdowncc.com/uploadimg/ico/2025/0523/1747993424374100.png" width="32" height="32" src="http://pic.pdowncc.com/uploadimg/ico/2025/0523/1747993424374100.png" alt="弓箭勇者最新版" />
飞行射击 下载
<img preview="http://pic.pdowncc.com/uploadimg/ico/2025/0523/1747993424374100.png" width="32" height="32" src="http://pic.pdowncc.com/uploadimg/ico/2025/0523/1747993424374100.png" alt="弓箭勇者最新版" />
飞行射击 下载
<img preview="http://pic.pdowncc.com/uploadimg/ico/2025/0523/1747993424374100.png" width="32" height="32" src="http://pic.pdowncc.com/uploadimg/ico/2025/0523/1747993424374100.png" alt="弓箭勇者最新版" />
飞行射击 下载- 4 <img preview="http://pic.pdowncc.com/uploadimg/ico/2025/0523/1747993424374100.png" width="32" height="32" src="http://pic.pdowncc.com/uploadimg/ico/2025/0523/1747993424374100.png" alt="弓箭勇者最新版" />下载73.78MB · 95℃
1970-01-01
- 5 <img preview="http://pic.pdowncc.com/uploadimg/ico/2025/0523/1747993424374100.png" width="32" height="32" src="http://pic.pdowncc.com/uploadimg/ico/2025/0523/1747993424374100.png" alt="弓箭勇者最新版" />下载43.7 MB · 94℃
1970-01-01
- 6 <img preview="http://pic.pdowncc.com/uploadimg/ico/2025/0523/1747993424374100.png" width="32" height="32" src="http://pic.pdowncc.com/uploadimg/ico/2025/0523/1747993424374100.png" alt="弓箭勇者最新版" />下载110.69MB · 93℃
1970-01-01