• 0
swimteam

SDK Debugger Not Stopping at Main ZYBO

Question

I am trying to debug an simple program for the ZYBO board. I cannot get the SDK (2016) debugger to stop at main.

The configure file has the "stop at main" box checked. I have a breakpoint at "main."

Anyone know what's wrong?

Share this post


Link to post
Share on other sites

10 answers to this question

Recommended Posts

  • 0

Thanks for the thread.

Clean the project? I'll try that tonight. I am using System Debugger. Not GDB. I also noticed that the pre_ps7_init box has to be checked. Otherwise, an error comes back as complains about the DDR. The post_ps7_,.. is not checked. On the Applications tab the reset box is checked and at the top Stop at Main is checked.

One time I turned on all the power, board, computer etc and then ran Vivado and SDK and it did stop at main. So I know the debugger can do it. I tried duplicating all my steps but no luck.

Share this post


Link to post
Share on other sites
  • 0

Here is my entire code. It's only one file.

 

/* Borrowed from ZynqBook Tutorials */

/* Include Files */
#include "xparameters.h"
#include "xgpio.h"
#include "xstatus.h"
#include "xil_printf.h"

/* Definitions */
#define GPIO_DEVICE_ID  XPAR_AXI_GPIO_0_DEVICE_ID    /* GPIO device that LEDs are connected to */
#define LED 0x03                                    /* Initial LED value - 00XX */
#define LED_DELAY 70000000                            /* Software delay length */
#define LED_CHANNEL 1                                /* GPIO port for LEDs */
#define printf xil_printf                            /* smaller, optimized printf */

XGpio Gpio;                                            /* GPIO Device driver instance */

/* Main function. */
int main(void){

    int Status;

    /* Execute the LED output. */
    Status = LEDOutputExample();
    if (Status != XST_SUCCESS) {
        xil_printf("GPIO output to the LEDs failed!\r\n");
    }

    return 0;
}

int LEDOutputExample(void)
{

    volatile int Delay;
    int Status;
    int led = LED; /* Hold current LED value. Initialize to LED definition */
    int count = 0;

        /* GPIO driver initialization */
        Status = XGpio_Initialize(&Gpio, GPIO_DEVICE_ID);
        if (Status != XST_SUCCESS) {
            return XST_FAILURE;
        }

        /*Set the direction for the LEDs to output. */
        XGpio_SetDataDirection(&Gpio, LED_CHANNEL, 0x00);

        /* Loop forever blinking the LED. */
            while (1) {
                /* Write output to the LEDs. */
                XGpio_DiscreteWrite(&Gpio, LED_CHANNEL, led);

                /* Flip LEDs. */
                //led = ~led;
                ++count;
                led = count & 0x03;

                /* Wait a small amount of time so that the LED blinking is visible. */
                for (Delay = 0; Delay < LED_DELAY; Delay++);
            }

        return XST_SUCCESS; /* Ideally unreachable */
}

 

The code runs OK. It's when I try to debug. It just says (running) all the time. If I suspend the assembly code is always a loop.

I put another break-point in the LED code. Does NOT stop there. SDK does not recognize breakpoints.

When it's suspended the address is always 0x00000008. Seems SDK is not getting past initialization with such a low PC address.

Edited by swimteam
More info

Share this post


Link to post
Share on other sites
  • 0

Please check whether ZYNQ is configured correctly.

You can check this for example in the clock configuration:

clock.JPG.8537ceca0dd0bd5c67867594c6e3c29b.JPG

The clock should be configured to 50 MHz for the ZYBO.

If not, remove ZYNQ and re-add it, then "Run Block Automation".
block_automation.JPG.ebf46f2f128fab2b1d39675d00964cbd.JPG

Edited by Rainer
Diagnosis and possible solution in correct order

Share this post


Link to post
Share on other sites
  • 0

I'll do this first thing after work.

 

I did not read anywhere that I have to configure the ZYBO!  These easy start tutorials mention nothing about that. They simply say

put the Zynq processor in the block design.

 

Why the 50 MHz? Is that the oscillator on the board? Is that the fastest the ZYBO board can run? I read where the ARM cores can run at either 650 MHz or 450 MHz.

I would like to know to understand these settings.

Share this post


Link to post
Share on other sites
  • 0

Rainer:

 

I owe you a cup of coffee. 

Those people who put those getting started video and even Xilinx tutorials videos really need to get some learning. They are sloppy.

Share this post


Link to post
Share on other sites
  • 0

@swimteam @Rainer

I am not certain, but it looks like the board files we provide on Github (installation tutorial here) take care of setting this clock frequency for our Zynq boards. Jon and I rarely use a Vivado installation without these files installed, so this may explain some of the confusion here.

Share this post


Link to post
Share on other sites
  • 0

Hi @swimteam @Rainer,

@artvvb is correct. We typically use the board files for our projects. Glad you were able to get the issue resolved. I would also suggest to look at our resource page for the Zybo here. The resource page has some tutorials, examples, schematic and the Reference Manual.

cheers,

Jon 

Share this post


Link to post
Share on other sites
  • 0

Well, I should have read the manual first. It's also my fault too. I installed those before I started but they don't alter the Zynq processor frequency. I had to change that from 33.33 MHz to 50 MHz as suggested. Debugger immediately worked and even the UART worked. Those videos did not say anything about setting up the Zynq for your board. All they said was to set up the GPIO. Oh well, lesson learned. 

 

Thanks all for your suggestions and help,

Swimteam

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now