Programmable Devices
CPLDs, FPGAs, SoC FPGAs, Configuration, and Transceivers
20704 Discussions

Problem with transfering Data with UART

Altera_Forum
Honored Contributor II
1,653 Views

Hi all,  

First of all: I am newbie in programming FPGAs 

I am using a ALtera Cyclone 3 on a self made Board.  

For communication with a PC I use the avalon UART. It works fine while working with the debugging Interface of JTAG UART.  

My problem is: Removing the JTAG UART Connection, my Programm on the FPGA is not able to send me data via UART.  

To receive and send data with UART, I dont use any Interrupts directly, I read the status of the UART (Status: TRDY, RRDY) and also a Control bit(Control: RRDY).  

I do this without any kind of handshake, so I am just using Ground, TxD and RxD of my RS232. 

It works realy fine, but my compiled program wont transmit data via UART without the JTAG UART connection.  

Any idea? Maybe I missed something while making my hex File/compiling?  

I deactivated the stdout, stderr and stdin in my BSP for the compile, cause I read it will make trouble otherwise  

 

I am sure my Hardware is sending something, cause when I send something, I will send 9 Bytes. So i wait after every Byte for my Status TRDY(ready to transmit) to be one, before I send the next Byte 

like this: while(((IORD_ALTERA_AVALON_UART_STATUS(UART_BASE) & ALTERA_AVALON_UART_STATUS_TRDY_MSK) >> ALTERA_AVALON_UART_STATUS_TRDY_OFST)!=1){} IOWR_ALTERA_AVALON_UART_TXDATA(...); 

 

I hope you get a idea of my problem.
0 Kudos
6 Replies
Altera_Forum
Honored Contributor II
424 Views

Can you make a led blink from your software? It will let you know if it's stuck somewhere or if it is running. 

Do you mean that it does transmit data on the UART when you do have a JTAG UART connection? Is there anything written on the nios terminal?
0 Kudos
Altera_Forum
Honored Contributor II
424 Views

My program also let blink LEDs, I have a timer that activate LEDs when no Commands are received via UART (reading the UART works). I can send a Command via UART, that requieres a response via UART. After several Sends, I can be sure that the software does not stuck anywhere. 

 

Exactly, while the JTAG UART is connected to my board, the transmit via UART works fine, I can see it with a serial port monitor. Without the JTAG UART connected, they will be no response to my pc, but the TXDATA of my UART will be filled with data. Receiving data still works.  

 

Its my goal to let my programm run without NIOS, so without any JTAG UART Connection. So I dont realy care about the NIOS Terminal, if I am right the terminal just work with a JTAG connected, but I already know that my Software work with JTAG connected, but not without JTAG 

 

I see, after compiling my program and running it on my board, my USB Blaster lights up the whole time.  

 

(There is JTAG_UART Function used in my software, I searched whole workspace for "JTAG")
0 Kudos
Altera_Forum
Honored Contributor II
424 Views

I was asking this to try and find out what could be the cause of the trouble. 

Is there a difference between JTAG probe connected but no Nios terminal opened and JTAG probe connected with the Nios terminal opened? 

Is there any unlicensed core in your design that uses the Opencore plus evaluation system?
0 Kudos
Altera_Forum
Honored Contributor II
424 Views

There is nothing written on the terminal.  

There are no differences between running software with Terminal and without.  

All cores I am using are fully licensed.
0 Kudos
Altera_Forum
Honored Contributor II
424 Views

Problem solved, thanks for your help

0 Kudos
Altera_Forum
Honored Contributor II
424 Views

What was the problem?

0 Kudos
Reply