Why does xil_printf cause a stack overflow, but does XUartLite_SendByte not? Can someone explain this? The commented section (XUartLite_SendByte) works fine, but in the end I would like to call the function on me and return the result using xil_printf.
The code is shown below.
microblaze using xilinx sdk
#include <stdio.h>
#include "xil_cache.h"
#include "xparameters.h"
#include "xutil.h"
#include "xuartlite_i.h"
#define UART_ADDR 0x40600000
int main()
{
Xil_ICacheEnable();
Xil_DCacheEnable();
print("---Entering main---\n\r");
Xuint16 i;
while(1==1)
{
while(XUartLite_IsReceiveEmpty(UART_ADDR));
i = XUartLite_RecvByte(UART_ADDR);
xil_printf("%c ", i);
}
print("---Exiting main---\n\r");
Xil_DCacheDisable();
Xil_ICacheDisable();
return 0;
}
source
share