cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Highlighted
Observer
Observer
1,516 Views
Registered: ‎12-11-2017

Breakpoints not working while debugging petalinux kernel

Hi,

 

I am trying to debug the petalinux kernel I compiled following this tutorial. However, the breakpoints are not always working well. I tried these functions using both hardware and regular breakpoint mode:

  • start_kernel: Hit
  • printk: Hit**
  • do_fork: Not working
  • i2c_dev_init: Not working

After a few tries, I found that all the breakpoints became useless after this boot message: (by stepping over from start_kernel)

 

Trying to unpack rootfs image as initramfs...

** The breakpoint I set on printk worked well before this message and after that, it didn't get hit anymore, either.

 

Can someone tell me how to handle this?

 

Thanks!

0 Kudos
10 Replies
Highlighted
Scholar
Scholar
1,488 Views
Registered: ‎02-27-2008

That is pretty ancient now.

 

Are all your tools fixed at the release of ISE and SDK this was written for?

 

If not, then I advise you move into the modern age with Vivado for Zynq rather than struggling with what is now, old tools and flows.

 

 

Austin Lesea
Principal Engineer
Xilinx San Jose
0 Kudos
Highlighted
Observer
Observer
1,483 Views
Registered: ‎12-11-2017

Thanks for your reply and sorry for the confusion. All the tools (Vivado, petalinux and XSDK) I am using are 2017.2 version. I found other tutorials for kernel debugging, such as AR# 67767. Actually, they're talking the same procedure and none of them solved my problem.

0 Kudos
Highlighted
Adventurer
Adventurer
1,270 Views
Registered: ‎05-26-2017

I'm seeing the same problem with 2018.1. Setting  a breakpoint in start_kernel works fine, but a lot of other functions do not.. For instance anfc_probe. Its listed in the symbol table 

 

ffffff800860e7d0 l F .text 0000000000000a70 anfc_probe

 

and the address shows up correctly in the debugger when adding the BP.

 

I'm guessing this has something to do with it being a built-in module. 

0 Kudos
Highlighted
Observer
Observer
989 Views
Registered: ‎01-07-2014

I've hit the same thing in 2018.1 and 2018.2 (Petalinux version == SDK Version == Vivado version).  I can set breakpoints at kernel_start and a few others but a kernel module's _probe function doesn't break.

 

I've modified the module to make sure the function was exported to the kernel.

I've tried making the breakpoint a hardware, instead of software breakpoint.

I've done this with 32-bit targets (Zynq-7000) and 64-bit targets (ZynqSMP) and same results.

The debugging host machine is the same one used to build the Petalinux image.

I booted via JTAG (petalinux-boot --jtag --kernel)

I get an error message when setting the breakpoint indicating the breakpoint was in multiple files.  I verified this is NOT the case at a source code level.

 

Any ideas?

0 Kudos
Highlighted
Moderator
Moderator
947 Views
Registered: ‎12-04-2016

Hi

Can you please try building the kernel by selecting Image packaging configuration to sdcard in petalinux-config? 

 

Best Regards

Shabbir

0 Kudos
Highlighted
Observer
Observer
899 Views
Registered: ‎01-07-2014

No joy packaging for SD card.  I've booted JTAG and from the SD card and nothing.

It worked one time but not again.

 

Any other ideas?

0 Kudos
Highlighted
627 Views
Registered: ‎10-23-2018

Hello,

I'm facing the same problem. I did not use petalinux but compiled kernel myself.

Breakpoints are working for a while, but after some times they do not trigger anymore, even if the instruction is executed.

Did you find any solutions ?

0 Kudos
Highlighted
Adventurer
Adventurer
313 Views
Registered: ‎06-21-2019

Hi,

I experience the same issue (link). Did you find what is the problem and possibly how to fix it?

0 Kudos
Highlighted
Observer
Observer
301 Views
Registered: ‎01-07-2014

I never solved that issue.  I fell back on "printk debugging" to find my bug.

0 Kudos
Highlighted
Adventurer
Adventurer
281 Views
Registered: ‎06-21-2019

@dyessggFYI, I found a solution.

0 Kudos