UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

cancel
Showing results for 
Search instead for 
Did you mean: 
Visitor raj@1994
Visitor
271 Views
Registered: ‎12-13-2018

Reading stored data from BRAM

Hi All,

I Stored coe file in BRAM IP. I used attached block diagram to read the value from BRAM ip. Below are the c code that i have used. But i didn't get output in SDK terminal. Can anyone help me out ?

#include "Xparameters.h"
#include "xbram.h"
#include <stdio.h>#include "xil_io.h"
#define XPAR_AXI_BRAM_CTRL_0_S_AXI_BASEADDR 0x40000000

int main()
{
int w1;
int w2;

w1=Xil_In32(XPAR_AXI_BRAM_CTRL_0_S_AXI_BASEADDR);
w2=Xil_In32(XPAR_AXI_BRAM_CTRL_0_S_AXI_BASEADDR+4);
xil_printf("%x",w1);
xil_printf("%x",w2);
return 0;

}

Capture.PNG
0 Kudos
7 Replies
Mentor hgleamon1
Mentor
259 Views
Registered: ‎11-14-2011

Re: Reading stored data from BRAM

If you debug the code and watch the variables, what values do you get when you step through the code?

How are you connecting the SDK terminal? What is defined in your subsystem to be the STDIN/OUT?

----------
"That which we must learn to do, we learn by doing." - Aristotle
0 Kudos
Visitor raj@1994
Visitor
217 Views
Registered: ‎12-13-2018

Re: Reading stored data from BRAM

Hi,

I connected SDK terminal using gpio ip and com port. I'm new to this domain. Can you plz guide me how to get the stored data to SDK terminal . Is there is any document for C code. Thanks in advance!!

0 Kudos
Mentor hgleamon1
Mentor
187 Views
Registered: ‎11-14-2011

Re: Reading stored data from BRAM

You didn't answer my question about what was defined to be the stdio in your subsystem (in the BSP)?

I think the SDK terminal uses the JTAG connection but if you have an external connection that should probably be some UART.

----------
"That which we must learn to do, we learn by doing." - Aristotle
0 Kudos
Visitor raj@1994
Visitor
176 Views
Registered: ‎12-13-2018

Re: Reading stored data from BRAM

Hi,

Thanks for your reply.

I don't have much knowledge about C code in SDK. I want to read the stored data (.coe file) from BRAM IP and to display the same through VGA. I'm able to build the block diagram but unable to write c code to communicate PS and PL. Could you plz help me ? 

Have a good day!!

0 Kudos
Mentor hgleamon1
Mentor
122 Views
Registered: ‎11-14-2011

Re: Reading stored data from BRAM

 

After a quick inspection, there isn't anything wrong with the C code you have previously posted.

However, you haven't explained what debug you have attempted. Can you debug the application on your target and see that the variables acquire the values you expect when you expect them to?

It's still not clear to me how you are connecting the console to the system in order to see the values printed out to the terminal. Can you explain this a little bit more?

----------
"That which we must learn to do, we learn by doing." - Aristotle
0 Kudos
Visitor raj@1994
Visitor
114 Views
Registered: ‎12-13-2018

Re: Reading stored data from BRAM

Hi,

Thanks for your reply.

Im able to read the BRAM content through SDK terminal now.

0 Kudos
Mentor hgleamon1
Mentor
99 Views
Registered: ‎11-14-2011

Re: Reading stored data from BRAM

That's good.

For reference, you should explain what you have done to resolve your issue and then close this thread by marking your resolution message as solved.

----------
"That which we must learn to do, we learn by doing." - Aristotle
0 Kudos