CodeWarrior Debug Support for Power using SDK 2.0?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

CodeWarrior Debug Support for Power using SDK 2.0?

1,295 Views
mindchasers
Contributor III

I'm not finding CodeWarrior Debugging support in SDK2.0  for Power ( T1040 ). 

 

I don't see it listed as an option under Kernel Hacking in menuconfig, and I don't see CONFIG_DEBUG_CW in the source. 

 

Please advise on how to set up debugging for Power QorIQ using the SDK2.0 and / or provide a kernel patch. 

 

Thank you

 

Bob

Labels (1)
0 Kudos
Reply
7 Replies

1,002 Views
mindchasers
Contributor III

I probably should have pointed out that I'm working from the SDK2.0 source ISO and not one of the prebuilt cache archives.

0 Kudos
Reply

1,002 Views
addiyi
NXP Employee
NXP Employee

Do you have "Compile the kernel with debug info" option in under Kernel Hacking in menuconfig? If yes, use that option for building the linux image.

Adrian

0 Kudos
Reply

1,002 Views
mindchasers
Contributor III

Thank you for the reply Adrian,

If I run CodeWarrior with "Compile the kernel with debug info" set, then I do see some debug functionality, but it seems unstable (e.g., kernel oops, illegal instruction reported on the console, breakpoints can't be set in the debug shell, etc. ). 

In the CodeWarrior Infocenter documentation->CodeWarrior Development Studio for Power Architecture Technology->Configuring the Linux Kernel, there is instruction to

Select Kernel hacking.
Select Include CodeWarrior kernel debugging by pressing Y. Enabling this option allows the CodeWarrior debugger to debug the target.

In previous releases, I know that selecting "CodeWarrior kernel debugging" would define the CONFIG_DEBUG_CW flag, and this flag would enable various source lines to set things like MSR_DE for the MSR register and prevent ppc_md.power_save() from being called during idle. 

Can you please confirm that the current documentation in the infocenter is wrong and that the CONFIG_DEBUG_CW flag ( and associated kernel patch ) is no longer required?  If this is the case, I'll have to figure out why debugging seems unstable and may require additional help. 

Thank you

Bob

PS, I'm debugging with a T1040RDB and using CW 10.5.2 on Ubuntu 14.04 & SDK2.0. 

0 Kudos
Reply

1,002 Views
addiyi
NXP Employee
NXP Employee

It is possible that current documentation from infocenter to be wrong.If using "Compile the kernel with debug info" is unstable, try to not use optimization when build kernel.

Adrian

0 Kudos
Reply

1,002 Views
mindchasers
Contributor III

Hi Adrian,

You wrote "It is possible that current documentation from infocenter to be wrong." 

Is the documentation in the infocenter wrong? 

In prior releases of the SDK kernel for Power, setting "CodeWarrior kernel debugging" in kernel hacking would properly set the flags:  (CFLAGS += -g2 -gdwarf-2, AFLAGS_KERNEL += -Wa,-gdwarf2)

Unless you confirm that the infocenter documentation is wrong, I'm still wondering whether the SDK2.0 kernel is missing a patch.

Thank you

Bob

0 Kudos
Reply

1,002 Views
yipingwang
NXP TechSupport
NXP TechSupport

Hello Rob,

There is no need for CW_DEBUG flag
A short overview:

  • for e500v2 you must use CW_DEBUG to enable external debug flags from MSR. There no way you can Debug with probe without these flags set.
  • for e500mc and e5500: you can fully debug the target with CW_DEBUG disabled
  • for e6500: you can debug the target with CW_DEBUG disabled, except the case where the target enters in idle mode (PW20 state I guess). From this state, due to HW design limitation, you can not use external debug.
    Therefore, if there is a way to disable this state from Linux, you should be able to debug e6500 without CW_DEBUG.


Have a great day,
Yiping

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos
Reply

1,002 Views
mindchasers
Contributor III

Thank you for the insight Yiping and this does seem to match my own testing.

I still use a p1010rdb to work with Linux mainline, and I do apply my own maintained codewarrior (CW_DEBUG) patch to the mainline source so I can use CodeWarrior.   I realize that p1010rdb is no longer supported in SDK2.0; however, e500v2 is still supported in the SDK2.0 yocto machine configuration files (e.g., meta-freescale/machine/include/e500v2.inc ), so I'm thinking the CW_DEBUG patch should be available in SDK2.0.  

Also, I want to point out that the infocenter documentation on codewarrior debugging does need to be updated. 

Thanks again

Bob

0 Kudos
Reply