Trying to instantiate multiple UARTLite cores in a microblaze design using an Arty Board. For some reason, the output of both UARTLite modules is going through the same USB UART port as opposed to the second port I've configured.
/************************** Variable Definitions *****************************/
XUartLite UartLite_0; /* Instance of the UartLite Device */
XUartLite UartLite_1; /* Instance of the UartLite Device */
/*
* The following buffers are used in this example to send and receive data
* with the UartLite.
*/
u8 SendBuffer[TEST_BUFFER_SIZE]; /* Buffer for Transmitting Data */
u8 RecvBuffer[TEST_BUFFER_SIZE]; /* Buffer for Receiving Data */
int main(void) {
int Status;
/*
* Run the UartLite polled example, specify the Device ID that is
* generated in xparameters.h
*/
Status = XUartLite_Initialize(&UartLite_0, UARTLITE_DEVICE_ID_0);
if (Status != XST_SUCCESS) {
return XST_FAILURE;
}
if (Status != XST_SUCCESS) {
xil_printf("Uartlite polled Example Failed\r\n");
return XST_FAILURE;
}
Status = XUartLite_Initialize(&UartLite_1, UARTLITE_DEVICE_ID_1);
if (Status != XST_SUCCESS) {
return XST_FAILURE;
}
if (Status != XST_SUCCESS) {
xil_printf("Uartlite polled Example Failed\r\n");
return XST_FAILURE;
}
xil_printf("Successfully ran Uartlite polled Example\r\n");
//XUartLite_Send(&UartLite_0, SendBuffer, TEST_BUFFER_SIZE);
int temp = 80000;
int simplecounter = 0;
char links[] = "DIGILENT DIGILENT\n\0";
char linksx[] = "ARTY ARTY ARTY ARTY\n\0";
while (1) {
if (1) {
xil_printf("Cha Cha Cha.... %d\r\n", simplecounter++);
XUartLite_Send(&UartLite_0, &links, TEST_BUFFER_SIZE);
XUartLite_Send(&UartLite_1, &linksx, TEST_BUFFER_SIZE);
temp = 80000;
}
}
return XST_SUCCESS;
}
Question
macgyverque
Trying to instantiate multiple UARTLite cores in a microblaze design using an Arty Board. For some reason, the output of both UARTLite modules is going through the same USB UART port as opposed to the second port I've configured.
Any suggestions?
[CONSTRAINTS]
set_property IOSTANDARD LVCMOS33 [get_ports usb_uart_bc127_rxd]
set_property IOSTANDARD LVCMOS33 [get_ports usb_uart_bc127_txd]
set_property PACKAGE_PIN U11 [get_ports usb_uart_bc127_txd]
set_property PACKAGE_PIN V16 [get_ports usb_uart_bc127_rxd]
[SOURCE CODE]
#include "xparameters.h"
#include "xstatus.h"
#include "xuartlite.h"
#include "xil_printf.h"
/************************** Constant Definitions *****************************/
#define UARTLITE_DEVICE_ID_0 XPAR_UARTLITE_0_DEVICE_ID
#define UARTLITE_DEVICE_ID_1 XPAR_UARTLITE_1_DEVICE_ID
#define TEST_BUFFER_SIZE 16
int UartLitePolledExample(u16 DeviceId);
/************************** Variable Definitions *****************************/
XUartLite UartLite_0; /* Instance of the UartLite Device */
XUartLite UartLite_1; /* Instance of the UartLite Device */
/*
* The following buffers are used in this example to send and receive data
* with the UartLite.
*/
u8 SendBuffer[TEST_BUFFER_SIZE]; /* Buffer for Transmitting Data */
u8 RecvBuffer[TEST_BUFFER_SIZE]; /* Buffer for Receiving Data */
int main(void) {
int Status;
/*
* Run the UartLite polled example, specify the Device ID that is
* generated in xparameters.h
*/
Status = XUartLite_Initialize(&UartLite_0, UARTLITE_DEVICE_ID_0);
if (Status != XST_SUCCESS) {
return XST_FAILURE;
}
if (Status != XST_SUCCESS) {
xil_printf("Uartlite polled Example Failed\r\n");
return XST_FAILURE;
}
Status = XUartLite_Initialize(&UartLite_1, UARTLITE_DEVICE_ID_1);
if (Status != XST_SUCCESS) {
return XST_FAILURE;
}
if (Status != XST_SUCCESS) {
xil_printf("Uartlite polled Example Failed\r\n");
return XST_FAILURE;
}
xil_printf("Successfully ran Uartlite polled Example\r\n");
//XUartLite_Send(&UartLite_0, SendBuffer, TEST_BUFFER_SIZE);
int temp = 80000;
int simplecounter = 0;
char links[] = "DIGILENT DIGILENT\n\0";
char linksx[] = "ARTY ARTY ARTY ARTY\n\0";
while (1) {
if (1) {
xil_printf("Cha Cha Cha.... %d\r\n", simplecounter++);
XUartLite_Send(&UartLite_0, &links, TEST_BUFFER_SIZE);
XUartLite_Send(&UartLite_1, &linksx, TEST_BUFFER_SIZE);
temp = 80000;
}
}
return XST_SUCCESS;
}
[XPARAMETERS]
/* Definitions for peripheral AXI_UARTLITE_0 */
#define XPAR_AXI_UARTLITE_0_BASEADDR 0x40600000
#define XPAR_AXI_UARTLITE_0_HIGHADDR 0x4060FFFF
#define XPAR_AXI_UARTLITE_0_DEVICE_ID 0
#define XPAR_AXI_UARTLITE_0_BAUDRATE 9600
#define XPAR_AXI_UARTLITE_0_USE_PARITY 0
#define XPAR_AXI_UARTLITE_0_ODD_PARITY 0
#define XPAR_AXI_UARTLITE_0_DATA_BITS 8
/* Definitions for peripheral AXI_UARTLITE_1 */
#define XPAR_AXI_UARTLITE_1_BASEADDR 0x40610000
#define XPAR_AXI_UARTLITE_1_HIGHADDR 0x4061FFFF
#define XPAR_AXI_UARTLITE_1_DEVICE_ID 1
#define XPAR_AXI_UARTLITE_1_BAUDRATE 9600
#define XPAR_AXI_UARTLITE_1_USE_PARITY 0
#define XPAR_AXI_UARTLITE_1_ODD_PARITY 0
#define XPAR_AXI_UARTLITE_1_DATA_BITS 8
/******************************************************************/
/* Canonical definitions for peripheral AXI_UARTLITE_0 */
#define XPAR_UARTLITE_0_DEVICE_ID XPAR_AXI_UARTLITE_0_DEVICE_ID
#define XPAR_UARTLITE_0_BASEADDR 0x40600000
#define XPAR_UARTLITE_0_HIGHADDR 0x4060FFFF
#define XPAR_UARTLITE_0_BAUDRATE 9600
#define XPAR_UARTLITE_0_USE_PARITY 0
#define XPAR_UARTLITE_0_ODD_PARITY 0
#define XPAR_UARTLITE_0_DATA_BITS 8
/* Canonical definitions for peripheral AXI_UARTLITE_1 */
#define XPAR_UARTLITE_1_DEVICE_ID XPAR_AXI_UARTLITE_1_DEVICE_ID
#define XPAR_UARTLITE_1_BASEADDR 0x40610000
#define XPAR_UARTLITE_1_HIGHADDR 0x4061FFFF
#define XPAR_UARTLITE_1_BAUDRATE 9600
#define XPAR_UARTLITE_1_USE_PARITY 0
#define XPAR_UARTLITE_1_ODD_PARITY 0
#define XPAR_UARTLITE_1_DATA_BITS 8
Link to comment
Share on other sites
6 answers to this question
Recommended Posts
Archived
This topic is now archived and is closed to further replies.