Debugging Linux Kernel (2.6.x) using CodeWarrior Development Studio

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

Debugging Linux Kernel (2.6.x) using CodeWarrior Development Studio

10,943 次查看
flobo
Contributor I
Hi all,

I was wondering whether someone can assist me in debugging a Linux kernel using CodeWarrior IDE.
The board is connected using a CodeWarrior USB TAP.

During normal operation the kernel is booted using U-Boot.
U-Boot, Kernel and initial ramdisk are usually loaded from ROM.
(which does work fine)

I am not quite sure how the debugger, boot loader, kernel and ramdisk fit together.
What is the usual process a developer has to take that all parts are properly setup and are ready for debug (at least kernel).

I took the following steps:
- Loaded vmlinux in CW by drag-and-drop
- Chose USB TAP for debugging interface
- Modified PIC address to reflect 0x01000000
- Modified target settings
- Used some BSP-supplied configuration script that initializes board
- Set entry point
- Hit debug button (board init, vmlinux download followed)

E.g. single stepping through board initialization does not work properly. Sometimes CW completely gets unresponsive and/or crashes.
I feel that I am missing a step, e.g. running U-Boot first and then continue to load kernel in CW.
But how?

U-Boot was configured to allow CW-debugging.

The documentation stops explaining details after the board is supplied with ramdisk, kernel, ... using e.g. TFTP.

Any suggestions?

Thanks in advance.

Regards,

Florian
标签 (1)
标记 (1)
0 项奖励
回复
9 回复数

2,693 次查看
marc_paquette
Contributor V

Enclosed is a PDF containing a note I received from technical support. Let me know if it helps.

Marc.

0 项奖励
回复

2,693 次查看
flobo
Contributor I
Looks like it is the information I am missing.

However my CodeWarrior installation doesn't contain the folder "KernelDebug_Settings" described in step "Configure the kernel project".

Can I download those XMLs somewhere?

Perhaps I got an outdated version of the BSP.
The README says:

-----------------------------------------
Included on this CD is a Freescale Embedded Linux System
Tools Suite Board Support Package for the Freescale MPC8548CDS
board BSP released on 02/24/2006.

---------------

BSP Details:
* Tool Chain Version: Gcc3.4-e500, Glibc2.3.4, Binutils 2.15 supporting DPFP
* U-Boot Version: 1.1.3
* Kernel Version: 2.6.11

-----------------------------------------



The Freescale/Metrowerks site seems to not list any BSPs for MPC8548CDS.

Thanks,

Florian
0 项奖励
回复

2,693 次查看
marc_paquette
Contributor V

Are you using CW EPPC Linux v2.6 build 60213? Check the CodeWarrior version and build by looking at one of the xml files
in:

CodeWarriorIDE/CodeWarrior/CodeWarrior_Plugins/Support/Products

If you have not installed this version and build, then follow these steps:

1. Uninstall CodeWarrior

/usr/local/Freescale/_unist/unstiller.bin
rm -rf /usr/local/Freescale
rm -rf /home/<user_name>/.Codewarrior
rm -rf /root/.Codewarrior

2. Download and install CW EPPC Linux v2.6 from:

http://www.freescale.com/webapp/sps/site/overview.jsp?nodeId=01272600612247

----------------------------
CWX-PPC-LLPLT-EX
Evaluation for CodeWarrior Development Studio for PowerPC ISA, Linux
Platform Edition Version 2.6 (Linux Host) 
----------------------------

3. Rename the attached license file to license.dat and copy it to

/usr/local/Freescale/CodeWarriorIDE/CodeWarrior

4. Follow the instructions in the kernel debugging howto.

Let me know if these steps fix the problem.

Marc.

0 项奖励
回复

2,693 次查看
flobo
Contributor I
Thanks for your response.
My current build environment is Windows-based.

I found the following file:
C:\Programme\CodeWarrior PowerPC Comm V8.7\bin\Plugins\Support\Products\CW_PowerPC_8xx.xml

That contains:
CW Dev Studio, PPC ISA, Comms Processors Edition, v8.7, Build 60221

Is "CWX-PPC-LLAPP-EX
Evaluation for CodeWarrior Development Studio for PowerPC ISA, Linux Applications Edition Version 2.6 (Windows Hosted)" the appropriate solution?

Thanks.

Florian
0 项奖励
回复

2,693 次查看
marc_paquette
Contributor V

I apologize for the confusion. To debug a Linux kernel, you must use a Linux-hosted CodeWarrior tool set:

http://www.freescale.com/webapp/sps/site/overview.jsp?nodeId=01272600612247

------------
CWX-PPC-LLPLT-EX
Evaluation for CodeWarrior Development Studio for PowerPC ISA, Linux
Platform Edition Version 2.6 (Linux Host) 
------------

I'll send a license file to your email address.

Marc.

0 项奖励
回复

2,693 次查看
flobo
Contributor I
Alright, thank you very much.

Cheers,

Florian
0 项奖励
回复

2,693 次查看
flobo
Contributor I
For the sake of completeness CWX-PPC-LLAPP-EX also didn't contain the required functionality (At least it didn't support USB TAP).

Florian
0 项奖励
回复

2,693 次查看
marc_paquette
Contributor V

Which product and version of CodeWarrior Development Studio are you using?

Thanks.

Marc.

0 项奖励
回复

2,693 次查看
flobo
Contributor I
It's a MPC8548CDS board.
Metrowerks CodeWarrior IDE v5.7.0 Build 1962.

Florian
0 项奖励
回复