A lot of trouble when trying to debug c code on MicroBlaze

If I use XMD - Software debugger or debugging by SDK the debugger seams to go out of scope when I am about to enter a function, but this happends quite randomly. It is not at a particular function.

An other problem I have is with the UartLite drivers. I have tried to make myself some higher level drivers on my own. My driver: typedef struct { Xuint32 RegBaseAddress; // Base address of registers // Xuint16 DeviceID; // Unique ID of device // Xuint32 *StatusReg; // pointer to the statusregister // Xuint32 *ControlReg; // pointer to the controlregister // } RUartLite; And one of the functions to the driver: void RUartLite_Recv(RUartLite *Ptr, Xuint8 *DataBufferPtr, unsigned int NumBytes) { Xuint8 Temp; // remove when driver works. unsigned int i; for(i=0; iRegBaseAddress); DataBufferPtr[i] = Temp; } }

In the function main() { RUartLite Uart; // Creating driver for a device. Uart.RegBaseAddress = XPAR_RS232_BASEADDR;// Setting the baseadress Uart.DeviceID = XPAR_RS232_DEVICE_ID; // Filling in the deviceID. ... code ...

// Using the driver waiting for a 'g' on the uart // if(GOTDATA) { Xuint8 RXData;

// 2 different ways of reseiving data // RUartLite_Recv(&Uart, &RXData, 1); // DOES NOT WORK RXData = XUartLite_RecvByte(Uart.RegBaseAddress); // WORK

... code ... }

When I use my driver the variable Temp gets the value 1 (desimalvalue) When I'm not RXData get the right value ('g').

What can be wrong with my debugger and c-code?

Raymond

Reply to
Raymond Bakken
Loading thread data ...

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.