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: 
Participant perencia-wc
Participant
273 Views
Registered: ‎10-03-2017

FSBL attach to target debug

Jump to solution

Is there any way to debug FSBL attaching to target from the SDK or XSCT while in SD boot mode ? If I create the FSBL from the SDK and debug it I'm unable to reproduce the same problem. I've already enabled the debug traces, but I need to dig deeper and I don't want to put lots of traces. 

0 Kudos
1 Solution

Accepted Solutions
Xilinx Employee
Xilinx Employee
256 Views
Registered: ‎02-01-2008

Re: FSBL attach to target debug

Jump to solution

A quick way is to add a delay loop to the beginning of main() and attach while this loop is running. Then you can place cursor after loop and right click->move to line. Add the delay loop on entry to stage 2. This way, psu_init/ps7_init will already have ran. Another method is to add a 'ticker' which outputs a char every second and waits for uart input before continuing.

Three more things:

  1. There is an AR that describes how to disable Link Time Optimization (LTO) in order to make sence of single stepping through code
  2. If mpsoc, there is another AR that describes the writes needed to enable jtag (3 or 4 register writes)
  3. If debuging drivers (BSP src), add -O0 to extra compiler flags

But beware that disabling optimizations will cause the FSBL to grow larger and possibly not fit in memory anymore. xfsbl_config.h contain defines that you can turn off/on to reduce FSBL functionallity and therfore decrease memory footprint.

#include "sleep.h"

main()

....

for(int i=0; i<100000; i++) {

sleep(1);

}

View solution in original post

2 Replies
Xilinx Employee
Xilinx Employee
257 Views
Registered: ‎02-01-2008

Re: FSBL attach to target debug

Jump to solution

A quick way is to add a delay loop to the beginning of main() and attach while this loop is running. Then you can place cursor after loop and right click->move to line. Add the delay loop on entry to stage 2. This way, psu_init/ps7_init will already have ran. Another method is to add a 'ticker' which outputs a char every second and waits for uart input before continuing.

Three more things:

  1. There is an AR that describes how to disable Link Time Optimization (LTO) in order to make sence of single stepping through code
  2. If mpsoc, there is another AR that describes the writes needed to enable jtag (3 or 4 register writes)
  3. If debuging drivers (BSP src), add -O0 to extra compiler flags

But beware that disabling optimizations will cause the FSBL to grow larger and possibly not fit in memory anymore. xfsbl_config.h contain defines that you can turn off/on to reduce FSBL functionallity and therfore decrease memory footprint.

#include "sleep.h"

main()

....

for(int i=0; i<100000; i++) {

sleep(1);

}

View solution in original post

Moderator
Moderator
242 Views
Registered: ‎09-12-2007

Re: FSBL attach to target debug

Jump to solution

Yuou can attach to a running target in SDK debug configurations and add your symbol information. You can then reboot and stop at main. 

 

However, as John mentioned, you need to remove opt