Jump to content
  • 0

SDK Debugger Not Stopping at Main ZYBO


swimteam

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?

Link to comment
Share on other sites

10 answers to this question

Recommended Posts

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...