cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
bunrector
Visitor
Visitor
6,666 Views
Registered: ‎05-19-2008

StdOut and RS232_DCE(uart-lite)

I am working with the s3e starter kit. I recently added a uart lite to my existing design, hooked up the pins in the ucf, and made the connections in the mss file.  However, all I get is -- Entering Main() --, and I do not get any data from my xil_printf() calls.  I'm sure it's something easy, but I have been reading through docs, and even did a hardware clean/build with no luck.  I am beginning to wonder if the dce is attached to the debugger.

 

I changed stdin and out in Software->software platform settings to my RS232_DCE instance of the uart lite, I also made sure that the stub was hooked up to the debug module.  any help would be appreciated.  Thank you.

 

inByte.c:

#include "xparameters.h"
#include "xuartlite_l.h"

#ifdef __cplusplus
extern "C" {
#endif
char inbyte(void);
#ifdef __cplusplus
}
#endif

char inbyte(void) {
  return XUartLite_RecvByte(STDIN_BASEADDRESS);

 

 

outByte.c:

#include "xparameters.h"
#include "xuartlite_l.h"

#ifdef __cplusplus
extern "C" {
#endif
void outbyte(char c);

#ifdef __cplusplus
}
#endif

void outbyte(char c) {
  XUartLite_SendByte(STDOUT_BASEADDRESS, c);
}

UCF:

#### Module RS232_DCE constraints
NET "RS232_DCE_RXD_pin" LOC = "R7" | IOSTANDARD =  LVCMOS33 ;
NET "RS232_DCE_TXD_pin" LOC = "M14" | IOSTANDARD = LVCMOS33;# | DRIVE = 8 | SLEW = SLOW ;

 

mss:

BEGIN OS
 PARAMETER OS_NAME = standalone
 PARAMETER OS_VER = 2.00.a
 PARAMETER PROC_INSTANCE = microblaze_0
 PARAMETER STDIN = RS232_DCE
 PARAMETER STDOUT = RS232_DCE
END

 

BEGIN DRIVER
 PARAMETER DRIVER_NAME = uartlite
 PARAMETER DRIVER_VER = 1.13.a
 PARAMETER HW_INSTANCE = RS232_DCE
END


BEGIN DRIVER
 PARAMETER DRIVER_NAME = uartlite
 PARAMETER DRIVER_VER = 1.13.a
 PARAMETER HW_INSTANCE = debug_module
END

 

BEGIN DRIVER
 PARAMETER DRIVER_NAME = uartlite
 PARAMETER DRIVER_VER = 1.13.a
 PARAMETER HW_INSTANCE = RS232_DTE
END

 

mhs:

 

 PORT fpga_0_RS232_DTE_RX_pin = fpga_0_RS232_DTE_RX, DIR = I
 PORT fpga_0_RS232_DTE_TX_pin = fpga_0_RS232_DTE_TX, DIR = O
 PORT RS232_DCE_RXD_pin = RS232_DCE_RXD_s, DIR = I
 PORT RS232_DCE_TXD_pin = RS232_DCE_TXD_s, DIR = O

 

 

BEGIN xps_uartlite
 PARAMETER INSTANCE = RS232_DTE
 PARAMETER HW_VER = 1.00.a
 PARAMETER C_BAUDRATE = 57600
 PARAMETER C_DATA_BITS = 8
 PARAMETER C_ODD_PARITY = 0
 PARAMETER C_USE_PARITY = 0
 PARAMETER C_SPLB_CLK_FREQ_HZ = 50000000
 PARAMETER C_BASEADDR = 0x84000000
 PARAMETER C_HIGHADDR = 0x8400ffff
 BUS_INTERFACE SPLB = mb_plb
 PORT RX = fpga_0_RS232_DTE_RX
 PORT TX = fpga_0_RS232_DTE_TX
END

 

BEGIN xps_uartlite
 PARAMETER INSTANCE = RS232_DCE
 PARAMETER HW_VER = 1.00.a
 PARAMETER C_SPLB_CLK_FREQ_HZ = 50000000
 PARAMETER C_ODD_PARITY = 0
 PARAMETER C_USE_PARITY = 0
 PARAMETER C_BAUDRATE = 57600
 PARAMETER C_BASEADDR = 0x84020000
 PARAMETER C_HIGHADDR = 0x8402ffff
 BUS_INTERFACE SPLB = mb_plb
 PORT TX = RS232_DCE_TXD_s
 PORT RX = RS232_DCE_RXD_s
END

 

 

0 Kudos
Reply
3 Replies
htsvn
Xilinx Employee
Xilinx Employee
6,641 Views
Registered: ‎08-02-2007

Can you try to replace xil_printf with any other print statement?

 

Check http://www.xilinx.com/support/answers/19592.htm

 

----------------------------------------------------------------------------------------------
Kindly note- Please mark the Answer as "Accept as solution" if information provided is helpful.

Give Kudos to a post which you think is helpful and reply oriented.
----------------------------------------------------------------------------------------------
0 Kudos
Reply
bunrector
Visitor
Visitor
6,630 Views
Registered: ‎05-19-2008

Thank you for your help.  I tried print() with a string and it didn't work either.

I know the processor is running, becuase i am poling the switches and outputing them to the leds.

I wasn't including stdio.h, but including it didn't seem to make a difference.  I know the connection is working, because I get "-- Entering Main() --", I just can't print to the rs232_dce port for some reason when i use a print statement.

 

this is my main rutine:

 

#include "lcd_interface.h"
#include "xparameters.h"
#include "xio.h"
#include <stdio.h>

int main(int argNum, char* args)
{
 print("Main \n");
 lcdInit();
 
 Xuint32 dips = 0;
 
 while(1)
 {
  dips = XIo_In32(XPAR_DIP_SWITCHES_4BIT_BASEADDR);
  XIo_Out32(XPAR_LEDS_8BIT_BASEADDR, dips);
 }
  return 1;
}

 

 

0 Kudos
Reply
bunrector
Visitor
Visitor
6,616 Views
Registered: ‎05-19-2008

I generated a new system and chose dce instead of dte this time, and I still have the same results.  I am connected to com1 on terra term, and all I get is

-- Entering Main() --.  I have tried xil_printf() and print().  Any help would be greatly appriciated.

0 Kudos
Reply