UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

cancel
Showing results for 
Search instead for 
Did you mean: 
Observer chenhao_7
Observer
876 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
6 Replies
Scholar austin
Scholar
848 Views
Registered: ‎02-27-2008

Re: Breakpoints not working while debugging petalinux kernel

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
Observer chenhao_7
Observer
843 Views
Registered: ‎12-11-2017

Re: Breakpoints not working while debugging petalinux kernel

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
Adventurer
Adventurer
630 Views
Registered: ‎05-26-2017

Re: Breakpoints not working while debugging petalinux kernel

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
Visitor dyessgg
Visitor
349 Views
Registered: ‎01-07-2014

Re: Breakpoints not working while debugging petalinux kernel

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
Moderator
Moderator
307 Views
Registered: ‎12-04-2016

Re: Breakpoints not working while debugging petalinux kernel

Hi

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

 

Best Regards

Shabbir

0 Kudos
Visitor dyessgg
Visitor
259 Views
Registered: ‎01-07-2014

Re: Breakpoints not working while debugging petalinux kernel

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