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: 
Adventurer
Adventurer
941 Views
Registered: ‎10-11-2017

SDK debug:can't stop at main()

Jump to solution

Hello everyone!

I creat block design include Microblaze,AXI QUAD SPI and AXI GPIO.When I debug my code in SDK,I found a strange problem.Here is my code.

 

#include "xparameters.h"
#include"xspi.h"
#include "xspi_l.h"
#include"xgpio.h"

#define SPI_MASTER_ID XPAR_SPI_0_DEVICE_ID
#define LED_ID XPAR_GPIO_0_DEVICE_ID
#define LED_CHANNEL 1
#define LED 1

int main(void)
{
XSpi spi_master;
XGpio led;
u32 ControlReg;
u32 StatusReg;
u32 GlobalIntrReg;
int Status;

XSpi_Config *ConfigPtr;
ConfigPtr = XSpi_LookupConfig(SPI_MASTER_ID);
if(ConfigPtr==NULL){
return XST_FAILURE;
}

Status = XSpi_CfgInitialize(&spi_master, ConfigPtr,ConfigPtr->BaseAddress);
if (Status != XST_SUCCESS) {
return XST_FAILURE;
}

/************GPIO***************/
Status=XGpio_Initialize(&led,XPAR_GPIO_0_DEVICE_ID);
if (Status != XST_SUCCESS) {
return XST_FAILURE;
}
XGpio_SetDataDirection(&led,LED_CHANNEL,~LED);
XGpio_DiscreteWrite(&led,LED_CHANNEL,LED);
return XST_SUCCESS;
}

 

When I debug my code,I found it don't stop at main(),It stops at :

4.png

This scentence is in the founction XSpi_InterruptHandler(...),But I didn't call this function in my code.I don't konw why this is happen.

However.when I delete the scentence:

Status = XSpi_CfgInitialize(&spi_master, ConfigPtr,ConfigPtr->BaseAddress);

It can stop at main(...) normally.I don't know what's wrong with this scentence.

Can anybody help me?

0 Kudos
1 Solution

Accepted Solutions
Highlighted
Adventurer
Adventurer
1,380 Views
Registered: ‎10-11-2017

回复: SDK debug:can't stop at main()

Jump to solution
I have solved it.

I found that when configure Microblaze without check 'Use Instruction and Data Caches',it will work normally.

But I don't konw why.
0 Kudos
2 Replies
Highlighted
Adventurer
Adventurer
1,381 Views
Registered: ‎10-11-2017

回复: SDK debug:can't stop at main()

Jump to solution
I have solved it.

I found that when configure Microblaze without check 'Use Instruction and Data Caches',it will work normally.

But I don't konw why.
0 Kudos
Xilinx Employee
Xilinx Employee
891 Views
Registered: ‎02-01-2008

回复: SDK debug:can't stop at main()

Jump to solution

I responded to your other thread that includes a block diag. I expect you are running your application from LMB bram so you want to make sure that the microblaze cache controller address range does not include the address range of LMB.

 

And as mentioned on the other thread, you do not have QSPI XIP enabled and you do not have axi4 bram controller or DDR in your design so there is no reason to have cache enabled.

0 Kudos