cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Explorer
Explorer
3,210 Views
Registered: ‎11-13-2009

Using both 550 UART (User Port) and MDM UART (Debug Port)?

Jump to solution

Well I didn't quite find this in the forum so I thought I would ask.

 

I have a design where it would be helpful to debug using the MDM UART issuing the tracing debug messages and maybe some special stops along the way.  Think GDB like but lighter weight.

 

The design uses the 550 UART as the user interaction; I began by having both debug and User messages come out this port by assigning it to STDIN/OUT but now I really need them seperate.

 

So the question are:

1) How do I redirect the Debug Messages to always use STDIN/OUT using xil_print and print?

 

2) How do I redirect the User Messages to always use the UART550 port using xil_print and print (or do I have to use an overloaded version of printf)?

 

Now why would I want to do this and not use GDB always, well I have seen some interaction with GDB because of the UART to Host handshaking that are proving problematic to debug this method.  So I hope by seperating them I can get better insight into what is going on.  Think of it as polled timing loops (yes ugly)!

 

Thanks,

TomT...

0 Kudos
1 Solution

Accepted Solutions
Highlighted
Explorer
Explorer
4,056 Views
Registered: ‎11-13-2009

Re: Using both 550 UART (User Port) and MDM UART (Debug Port)?

Jump to solution

All,

 

Well I solved this by building my own "printf" functionality that was targeted at a USER configured port, for me this was the UART16550.  I then assigned STDIN/STDOUT to the mdm component and continued to use xil_printf() functionality for all my debug work.  Once my design is released for production the xil_print() will be replaced with a dummy call and NOT stall because nothing is listening to the mdm - no messages will be sent to STDIN/STDOUT.

 

Yes this was some work but seemed the only way to make achieve the results in standalone mode.  For now I have a small printf library, routines to INIT the UART the abillity to use blocking and non-blocking put/get to the UART.

 

Thanks for the suggestions,

TomT...

View solution in original post

0 Kudos
3 Replies
Highlighted
Xilinx Employee
Xilinx Employee
3,194 Views
Registered: ‎08-02-2007

Re: Using both 550 UART (User Port) and MDM UART (Debug Port)?

Jump to solution

Hi,

 

One of the procedure would be is to configure the standalone BSP with STDIN (UART16550) and STDOUT(MDM).

 

I have tested pesonally two UART's with one being configured as STDIN and the other being STDOUT using above flow.

 

--Hem

----------------------------------------------------------------------------------------------
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
Highlighted
Explorer
Explorer
3,157 Views
Registered: ‎11-13-2009

Re: Using both 550 UART (User Port) and MDM UART (Debug Port)?

Jump to solution

Hem,

 

Thanks for the reply!  That won't really work for my case.  The USER port is interactive for both input and output.  Think of it as putting up a text menu, waiting for the user to choose, more text menus more choices and then finally a file download or upload could be chosen.

 

What I am looking for on the Debug is tracking building a block of memory and watching the transfer so I can see where it is getting hung up; the debug messages could be pretty extensive so that I can follow the trace through the code.  Once I have isolated it down I can use GDB to help me find the specifics. Since I am debugging a polling timing loop I have having some side-effects with GDB being involved in the tight inner loop.

 

So my question is from the CODE can I direct which SERIAL port is being used?  I am thinking about overloading printf, print and xil_print to include the port type?  Have others done such a thing?

 

TomT...

0 Kudos
Highlighted
Explorer
Explorer
4,057 Views
Registered: ‎11-13-2009

Re: Using both 550 UART (User Port) and MDM UART (Debug Port)?

Jump to solution

All,

 

Well I solved this by building my own "printf" functionality that was targeted at a USER configured port, for me this was the UART16550.  I then assigned STDIN/STDOUT to the mdm component and continued to use xil_printf() functionality for all my debug work.  Once my design is released for production the xil_print() will be replaced with a dummy call and NOT stall because nothing is listening to the mdm - no messages will be sent to STDIN/STDOUT.

 

Yes this was some work but seemed the only way to make achieve the results in standalone mode.  For now I have a small printf library, routines to INIT the UART the abillity to use blocking and non-blocking put/get to the UART.

 

Thanks for the suggestions,

TomT...

View solution in original post

0 Kudos