News:

Attention: For security reasons,please choose a user name *different* from your login name.
Also make sure to choose a secure password and change it regularly.

Main Menu

Vivado and Xilinx sdk Tutorial/Project for TE0720.

Started by Hammad, January 11, 2016, 09:49:44 AM

Previous topic - Next topic

Hammad

Hi,

Are there any vivado tutorial or project available for TE0720 board with TE0701-05 as a carrier board? In the first i simply want to make a LED blinking project for this board in vivado. but final i want to write SDCARD. I have a running project which i made for Zedboard when i try to run that project on this board. It doesn't work. I have changed the settings of the project according to this board. If someone would help me to convert Zedboard's (Vivado and Xilinx SDK) project for TE0720 that would be much appreciated.

Regards

Antti Lukats

it all depends what you actually want

blink LED on MIO from PS?
blink led from PL

writing to SD card is only from PS side, so no vivado involved in that process

as long as you get TE0720 to boot with correct working FSBL you can do anything from there

Hammad

Blinking led from PL. present on the carrier board because LEDs on TE0720 are already occupied.

What I am doing on Zedboard is, I write data coming from counter on DDR using PL logic and then read DDR data and write it on Sdcard from PS side. Now i want to port my running(Zedboard's) project on TE0720 using TE0701-05 as carrier board. I am doing all this as standalone or baremetal application no Linux involved.

And other thing how can i boot TE0720 with FSBL?

Regards

Antti Lukats

what you mean by booting "with" FSBL - Zynq ALWAYS boots the FSBL there is no other way at all.

no matter from what media you boot, you need FSBL or nothing works.

there are no issues or restrictions to control an PL connected LED on TE0720 or TE0701 or TE0703, just make the connection assing the pin and done

Hammad

#4
Actually problem i am facing is;
I have generated a bit file using vivado. I have also created fsbl by following these steps ( https://wiki.trenz-electronic.de/pages/viewpage.action?pageId=10625459#VivadoFlow(VideoandStep-by-StepTutorial)-SoftwareImplementation ). I have made my Xilinx sdk project for PS side to read from DDR and write on SDCARD. Following are the commands i am using in xmd console but fsbl commands shows no output even in TE0720 manual it is written that LED3 will blink which shows done when we program fpga but mine is not the case.

fpga -f ***.bit (my bit file)
connect arm hw
dow pathTo/fsbl.elf
run
stop
dow pathTo/sdcardwriter.elf
run
stop

Will you please tell me where I am doing wrong?

Antti Lukats

was PS7 init  done?
correct uart selected in bsp?

what led are you referring did FPGA get loaded or not?

for start debug:

first make MIO7 blink in FSBL, make sure you the MIO led on TE0720 blinking then you know your FSBL is running
you can enable debug log in FSBL then you see something on uart
after that proceed

Hammad

#6
ps7 init was done in Xilinx sdk.
Here are my settings for bsp attached in capture.png.
For fpga I was referring to LEd3 but i have read this and (A successful FPGA configuration can only be seen (for now) by checking if the green LED3 has switched off) i m clear now.
MIO7(led1 on te0702) blinks when i power on the board for few seconds and then turns off. what does this means Fsbl is working or not?

But I want to know how can i correctly configure SDCARD (software (vivado & sdk) + hardware)? So I can use it to write data from PS. Please tell me 1 more thing if i want to make led blinking from PL what should i write in xdc file i-e what will be the exact syntax for led3 on board TE0701 (carrier) in xdc file.

I am following this tutorial but nothing is working.

Antti Lukats

Quote from: Hammad on January 13, 2016, 12:30:45 PM
ps7 init was done in Xilinx sdk.
Here are my settings for bsp attached in capture.png.
For fpga I was referring to LEd3 but i have read this and (A successful FPGA configuration can only be seen (for now) by checking if the green LED3 has switched off) i m clear now.
MIO7(led1 on te0702) blinks when i power on the board for few seconds and then turns off. what does this means Fsbl is working or not?

But I want to know how can i correctly configure SDCARD (software (vivado & sdk) + hardware)? So I can use it to write data from PS. Please tell me 1 more thing if i want to make led blinking from PL what should i write in xdc file i-e what will be the exact syntax for led3 on board TE0701 (carrier) in xdc file.

I am following this tutorial but nothing is working.

MIO7 LED is connected to PS MIO7 by the system controller during bootup, when this handover happens the system controller is no longer controlling this LED and the PS MIO7 pin controls it, if you do not do anything with MIO7 in your FSBL, then the state of this LED would be undefined what would be correct behaviour. As I do not know what you do in the FSBL, if you set MIO7 to 1 or not, then I can not also tell if there is something wrong or not.

By SDCARD you mean PS7 SDIO0 IP? This should be configured OK by the FSBL and there is nothing special, you can just talk to the SD Card.

by te0702 you actually refer to TE0720 right? teo702 is and baseboard that we have not even released.

Please be aware that the LEDS on TE0701 are not directly connected to the TE0720, their function and mapping depends the TE0701 baseboard CPLD firmware, by default the LEDS are configured for various signal for status monitoring and are not accessible from TE0720 FPGA io pins.

"led3" do you refer to D3 in schematic? or UL3 on the PCB? Please be specific in that. There is no direct LED3 marking on TE0701

Antti Lukats

Hi,

we are preparing some new low level tutorital that hopefully explains the basics how to control an LED etc better.

usually the modules are used for more complicated tasks as LED on off control.


Hammad

Thank you for telling that LEDS on TE0701 are not directly connected to the TE0720. Lets leave it for some time while you prepare some basic level tutorial. Actually I was reading the getting started from manual of TE0720 and I couldn't find any steps to program PL and PS. For sanity checking whether I am on right path or wrong I just wanted to do something like I want to print something on terminal, anything else like writing on SDCARD etc using (19.Mini USB Connector (USB JTAG and UART Interface).

Can you please tell me 1 thing if I re program the flash memory present on TE0720 Can I get back the factory loaded original image back. Any link to download.

How Can I boot from Sdcard because section booting in SDcard in TE0720 manual had no steps which I can follow?

Regards;

Antti Lukats

booting from SD card with TE0720 on TE0701

1 insert SD Card, with valid BOOT.BIN
2 turn power on

writing to SD Card, create application that does access SD card, and execute that application, from flash or SD card or using JTAG

PL programming, just download your BIT file over jtag, or create boot.bin with the new bit file

PS programming, use SDK

sorry maybe I am missing your real problem.

http://www.trenz-electronic.de/de/download/d0/Trenz_Electronic/d1/TE0720-GigaZee/d2/reference_designs/d3/2015.4.html

inside are 2 bat files

one creates vivado project that you can use as starting point
other creates READY TO USE BOOT.BIN files, with FSBL, BIT and Hello world
there are ready to use HDF files also, so you can start using SDK directly, just import the HDF..

you just start the bat, and it does ALL what is needed for you. Very simple.









Hammad

#11
Hi, I have been able to program PL and PS And even I have communicated between PL and PS. Thanks. But now a problem is I want to write just a simple text file on SDCARD. I have read from here ( https://wiki.trenz-electronic.de/display/4X5B/TE0701+Control+and+Data+Flow+with+TE0720#TE0701ControlandDataFlowwithTE0720-ConfiguringBootModeConfiguringBootMode ) that "the LED labeled L4 on the TE0701 is switched on when a SD card is inserted." But mine is not switched do I have to do anything with switch3 (S3) present on te0701-05 to configure CPLD or anything?? Please tell me what I have to do? Any hardware or software settings I have to do ?

Antti Lukats

Hi

if SD card is inserted it is then also accessible to PS on TE0701, so you can just use it.

as soon as you boot linux SD card will be writeable.

For Standalone applications Xilinx provides NO DEMOS that write to SD card. there is only a READ test available from Xilinx.

So for writing you either use linux, or have to work out your own code.


Hammad

#13
Do you know about Zedboard? Using Zedboard I have written a text file on SDCARD via PS in standalone mode & my application was correctly working But I don't know why i am not able to use same application on Trenz TE0701-05 in standalone. Using TE0701-05 when I try to mount the sdcard using f_mount function it works well but when i try to open the file in write mode using f_open it ain't open and throws the error. I guess it has nothing to do with Xilinx.

To double check whether my sdcard is properly inserted or not  I have read from here ( https://wiki.trenz-electronic.de/display/4X5B/TE0701+Control+and+Data+Flow+with+TE0720#TE0701ControlandDataFlowwithTE0720-ConfiguringBootModeConfiguringBootMode ) that "the LED labeled L4 on the TE0701 is switched on when a SD card is inserted." But mine is not switched ON...

Using TE0701-05 Can I write simple text file on SDCARD in standalone mode or not ??

Antti Lukats

#14
SD Card is connected to zynq PS SDIO0 peripheral and is accessible.

there is no differences if you write from linux or standalone, the hardware is the same.

Ok lets try to get to the problem:

you can READ from SD card but not write, right?

Antti Lukats

did you double check the card detect and WP settings of the PS?
if WP is wrong your soft may see card being write protected.

so that would explain why reads work and writes do not

Antti Lukats

#16
Quote from: Hammad on January 18, 2016, 11:22:53 AM
Do you know about Zedboard? Using Zedboard I have written a text file on SDCARD via PS in standalone mode & my application was correctly working But I don't know why i am not able to use same application on Trenz TE0701-05 in standalone. Using TE0701-05 when I try to mount the sdcard using f_mount function it works well but when i try to open the file in write mode using f_open it ain't open and throws the error. I guess it has nothing to do with Xilinx.

To double check whether my sdcard is properly inserted or not  I have read from here ( https://wiki.trenz-electronic.de/display/4X5B/TE0701+Control+and+Data+Flow+with+TE0720#TE0701ControlandDataFlowwithTE0720-ConfiguringBootModeConfiguringBootMode ) that "the LED labeled L4 on the TE0701 is switched on when a SD card is inserted." But mine is not switched ON...

Using TE0701-05 Can I write simple text file on SDCARD in standalone mode or not ??

YES.

I just tested and did see no issues at all.

http://www.trenz-electronic.de/de/download/d0/Trenz_Electronic/d1/TE0720-GigaZee/d2/reference_designs/d3/2015.4.html

I did just take the Xilinx SDK standard SD card demo c code, compiled it with 0 changes, created a BOOT.BIN and booted from SD:
result the application does read and write a file.

output on console:
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
SD Polled File System Example Test
Successfully ran SD Polled File System Example Test

and on the SD card an 8Mbyte large file "test.bin" was created by the standalone application.

no settings all standard all just works.

I am truly sorry, you are asking if it can work, so the answer is it does work ok.

I added the BOOT.BIN I used for testing to the downloads also.




Hammad

#17
I am neither able to read from SDCARD nor write actually I guess my issue is my SDCARD is not detected because LED4 labeled D4/L4 on board TE0701-05 is not switched ON.
And what will be the settings for CD and WP? Please tell those settings. For WP & CD settings from here ( https://wiki.trenz-electronic.de/pages/viewpage.action?pageId=10625459 ) i have followed point 5 from section "Creating Vivado Block Design (IP Integrator)". Have i done right or wrong?

Antti Lukats

Dear Hammad,

you are following the tutorial for generic TE0720 modul design flow. In section 5 it says that if additional feature to detect the card presence is desired then this function can be mapped to some PS MIO pin. As example in the tutorial MIO12 and MIO13 are used one possible set of MIO pins.

The actual setting of Card Detect depends on your baseboard for TE0720, this is in most cases customer designed baseboard, and the customer knows if he has connected CD or not, and if it is connected then to what MIO pin.

TE0701 is made "as zedboard compatible" as possible, exposing 8 MIO pins in one PMOD, within those 8 pins are also MIO12 and MIO13.

So if you changed CD to MIO12 then it is on MIO12 what is open I/O in PMOD slot.

This is the reason why I did give you correct links to working setup:

http://www.trenz-electronic.de/de/download/d0/Trenz_Electronic/d1/TE0720-GigaZee/d2/reference_designs/d3/2015.4.html

you start from there and it works.

TE0701 can be customized to forward CD pin from on-board SD card to MIOxx, but this is not done by the default firmware. TE0701 default firmware leaves all the MIO pins FREE for user to maximize the different options for mio configuration.

Hammad

I have used BOOT.bin file you provided and I am able to boot from SDCARD. I have seen message printed on Terminal TE0720-hello world. Thanks. But I am still not able to write a text file on sdcard.

How can I customize TE0701 so that I can use SDCARD in Xilinx SDK. I am not able to find any help for the board about using sdcard in Xilinx sdk. My base board is TE0701-05. Carrier/SOM is TE0720. By using the default settings/firmware of TE0701 board can I write text file on SDCARD from PS using Xilinx sdk OR not?? Because I am neither able to write nor read the sdcard. What settings for MIO pins should i do? OR the default/factory settings are enough to read & write on board?

Antti Lukats

as I have already said, you need NO SPECIAL things to-do at all.
nothing extra required, in our documentation it also said, you can do that, if you want and need that function, not that it is necessary have CD on MIO.

http://www.trenz-electronic.de/de/download/d0/Trenz_Electronic/d1/TE0720-GigaZee/d2/reference_designs/d3/2015.4.html
1 you take the HDF
2 launch SDK
3 create sd card app

must work.
nothing to be changed by you. nothing to worry about. just leave all as it is.

CD and WP are configured as EMIO, and unconnected EMIO will get connected to GND by Vivado IPI, so all just works.

Hammad

Done writing on sdcard ur BOOT.bin file from here you have provided ( http://www.trenz-electronic.de/de/download/d0/Trenz_Electronic/d1/TE0720-GigaZee/d2/reference_designs/d3/2015.4/d4/sd_card_test.html ). But When I am running my own project I am not able to do it. Will you please give me your Vivado project and Xilinx Sdk project for Sdcard writing...

Antti Lukats

Hi

I already did give you all!

http://www.trenz-electronic.de/de/download/d0/Trenz_Electronic/d1/TE0720-GigaZee/d2/reference_designs/d3/2015.4.html

inside the zip are
1) ready made HDF files, you can use them without ever starting vivado to work in SDK

2) make_project.bat

if you start "make_project.bat" it creates the vivado project for you, and you can work with vivado

3) the SD Card demo is not ours but from Xilinx, it is located in:

Verzeichnis von C:\Xilinx\SDK\2015.4\data\embeddedsw\lib\sw_services\xilffs_v3_1\examples

11/18/2015  12:06 AM             6,454 xilffs_polled_example.c
               1 Datei(en),          6,454 Bytes
               0 Verzeichnis(se), 130,624,139,264 Bytes frei

you just compile xilffs_polled_example.c
create the boot.bin
copy the boot.bin to SD card and reboot TE0720

and it should work.

This is exactly what I did.

Hammad


Antti Lukats

did you get something working?

things actually work but there are many small gotchas, and we can not always guess them as we do all the small things right here.

As example the Xilinx SD Card test code, it DOES NOT work when the bootmode is not SD and PS is not booted from SD Card. So booting the same code from SPI flash would fail. Also running the code from debugger would fail, unless you initially booted from SD and then reverted to debugger without hard reset.

This is some Xilinx gotcha, but I did ask you to boot from SD using BOOT.BIN what is known working way. Why the demo fails when booting from SPI I do not yet know, it is some Xilinx internals, in any case to our knowledge it is not related to TE0720, as other code like u-boot can work with SD card regardless of boot mode.

Hammad

Yeah I am able to write SDCARD and able to get my code working on TE0720 with few bugs which are my issues not board's. Thanks for your time and 'll try to explore it more when i'll have some spare time.

Regards

Hammad

Hi Lukkats, As you know I am writing data on Sdcard. I am able to do what I wanted but there is a little bug. When I write multiples files on sdcard i-e 4 files of 100 MB each then result is Okay.
But if I write 4 files each of size 250MB then first 2 files have correct data and last two doesn't have. If I write 4 files of 500 MB each then first 2 files are correct. If I write 4 files of 600 MB each then only first file is correct. Seeing these results I have concluded that if the starting iNode of files is after 512MB then the files doesn't contain correct data but in all the cases files sizes are correct.

I have found a way around for this bug I wrote/initialized all the 4 files with 4 bytes of data after fopen then I wrote data using f_write and I got correct results. I want to know is it bug of TrenzElectronic's fsbl cz i have used same fatfs in my zedboard project and it was giving correct result.

Antti Lukats

fsbl has nothing todo with fatfs you use later.

FSBL only does peripheral init, and the loads bit and/or second stage bootloader (u-boot in most cases)

if you have a specific test case that you think should work, but does not we may take a look at it.

To our knowledge there should be almost no porting needed to get your zedboard designs working on TE0720.

BTW there is no TE0720 fsbl, the FSBL is Xilinx FSBL, everything, all FSBL code is from Xilinx not from us.

YoJo

Hi Anti
my board has the same specs as Hammad's in that it is TE0720-02 mounted on TE0701-05.
I followed the steps that you mentioned here.

1. Used the ready made files from the TE0720-test_board-vivado_2015.4-build_34_20160531091101 folder to generate a vivado project.
2. Without adding anything or making any changes, generated outputs
3. exported hardware and launched sdk.
4. created application for fsbl.
5. created application for sd using fsbl as bootloader.
6. copied the xilffs_polled_example.c to my source file. I only changed this line:
Res = f_mount(0, &fatfs);
to
TCHAR *Path = "0:/";
Res = f_mount(&fatfs, Path, 0);
7. Built it and created a boot image.
8. Copied to SD.
9. Inserted the SD into my socket and resetted the board.

It didn't generate any file.

so to debug I added a xil_printf command after every ff function and it turns out that it stops at file writing. Can you help me debug my code?

Antti Lukats

Can you write to the SD Card from Linux?

This would prove that SD card writing is working on TE0720.

I think I have seen also sometimes that the polled example does not work, but I think it was related to the way Zynq was booted.

Whatever it is SD card can be accessed on TE0720, both for read as for write operations.



YoJo

1. Didnt run it on Linux because at the end I want a bare metal app.
2. My code makes the file but it doesnt write into the file. Is that enough proof that the TE0720 is actually writing or we can say accessing for writing ?
3. I read here that you posted a downloadable boot file for SD card but I cant find it. Can I possibly get my hands on it?

Antti Lukats

Quote from: YoJo on June 15, 2016, 05:18:05 PM
1. Didnt run it on Linux because at the end I want a bare metal app.
2. My code makes the file but it doesnt write into the file. Is that enough proof that the TE0720 is actually writing or we can say accessing for writing ?
3. I read here that you posted a downloadable boot file for SD card but I cant find it. Can I possibly get my hands on it?

We do not ready to use versions of all xilinx examples compiled for all our modules. Sorry.

The hardware is working, we know that. It is possible to use it from Baremetal Application. Support for Xilinx libraries, drivers and Xilinx examples is provided by Xilinx.

We help where we can also, but we can not write customer applications for all our customers.

YoJo

No I thought the boot file for the polled example is present in the download section somewhere. anyway ok.

Antti Lukats

sorry, I know we have had such demo working and tested, but even if I find it, I should RE TEST it, and add some text etc etc for the public download. This I cant do right now, again sorry. It works, I can confirm, but I also had some fight, dont recall exactly what, I think the xilinx demo does not work if you start from debugger, or some weird thing was there.. some not explainable one..