Jump to content
  • 0

Barebones PS system cannot talk to SDK console over UART1 -- SOLVED


JoeRuiz

Question

I'm uzing a Zybo board (Zynq-7000) and I'm trying to send text from the ZYNQ PS (uart1, connected to USB bridge on pins MIO48 and MIO49) to the SDK console, that's my only goal for now.

I am using Vivado 2019.1 on a Ubuntu 2020 machine. I am using the SDK version 2019.1 that came bundled with Vivado.

(I have not been able to find a single Digilent tutorial that I can follow 'blindly' with my setup: there is always some point at which the tutorial diverges from what I see, because the GUI has changed in Vivado or because the tutorial uses Vitis. This is a very major bummer, BTW.)

 

Since I cannot stick to a step by step tutorial, I am trying to create the simplest project that will get me console output, building on the advice I have read on this forum:

I have created a barebones Vivado project that only contains a PS. I have connected the PS port M_AXI_GP0_ACLK to the other PS port FCLK_CLK0. I run the design validation tool with no errors or warnings and create a wrapper as usual. Then I synthesize the design, generate a bitmap and export the hardware for use with the SDK. I make no changes at all to the configuration of the PS, in particular no changes to clock rates. When I check the uart1 configuration (in the PS configuration window), it appears to be enabled and connected to MIO48 and MIO49.

 

On the SDK, I generate a BSP. Then I create a "hello world"application. This is a bit of hit and miss: sometimes the SDK will not let me use the helloworld template because "the HW has no uart". But this time, working with a barebones PS, it lets me and I create the helloworld program, which I don't modify except for the link script.

 

Now, a problem: the link script is set up to load the program on DDR. If I do that, the program won't run. DDR appears not to be configured and it's empty if I look at it on the debugger.

So I change the load script to put everything, all segments, on ram0 instead.

This looks like a very strange glitch: the template application cannot work out of the box? strange. This makes me think I have already screwed something at this point. Any hints?

 

ANYWAY; after fixing the link script, I build the program, load the bitstream onto the FGPA, launch the application. Then I open a SDK console on ttyUSB1 at 115200. If I type something on the console, I see the TX led light up on the board, and I see the RX led light up when the PS sends something on uart1. So the program seems to be running and sending stuff over uart1. So far, so good.

 

THE PROBLEM: the SDK console gets garbage (unprintable characters).

 

I have tried all the speed settings in the SDK console from 115200 down to 9600. I am now about to try changing the stop bits and whatnot, and to try to find and check the code that initializes uart1. I may be reduced to looking at the received garbage bit patterns and trying to figure up what baud rate is being used on uart1 (I have no oscilloscope right now).

 

But I can't help thinking that I must be missing something obvious. This simple task just cannot be that difficult.

 

Can anyone help?

 

PS: FWIW I have installed the digilent zybo board files and selected the zybo board when I created the project. The project has no explicit xdc constraints file other than whatever constraints are applied under the hood as a result of using the board files. So much stuff happening under so many hoods in Vivado...

 

 

Edited by JoeRuiz
Link to comment
Share on other sites

1 answer to this question

Recommended Posts

  • 0

Ok, I figured it out. I think.

I was using the wrong set of board files: zybo-z7-10 instead of plain zybo.

After creating a new project with the zybo board files, and reproducing the above steps, it all works just fine (i.e. 'Hello world' on console).

(BTW I did *not* edit the link script this time, the program's running from DDR apparently. I don't know yet how the SW is booting and who's configuring the DDR controller. But that can wait.)

 

For reference, the board files come from here: https://github.com/Digilent/vivado-boards

 

Please feel free to add hints or corrections or comments down there. I'm still not out of the woods!

Edited by JoeRuiz
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...