2014年7月9日 星期三
[Xilinx] Booting Petalinux on Zynq through JTAG+TFTP, w/o an SD Card
Hi all,
I am quite new to Zynq System and spend a few days to port a working Linux on the chip. Xilinx provides both XSDK for baremetal developments and petalinux for linux deployment. Personally I hate keep plugging the SD for every single time especially when I deal with linux development.
However, The "petalinux-boot" utility always fail to boot a working linux or we can't even transfer the image to the DRAM. I would like to make all the stuff done with JTAG,LAN and standard tools like XMD. I would like to share the solution I have realized after a few days of struggling. Hope this helps your development.
We assume:
1. You have finished the "petalinux-create" for a petalinux file system.
2. You have configured the system through "petalinux-config"
3. You have finished the compilation of your system through "petalinux-build".
If you failed to build the rootfs, please try to run the build for TWICE MORE. It works.
4. You have exported your hardware and they can be accessed by XSDK.
You will have the following files in "<PetaLinux Dir>/images/linux"
1. image.ub > Kernel Image for u-boot
2. urootfs.cpio.gz > RootFS for linux in u-boot format
3. system.dtb > Device Tree Blob
They should be also located in "/tftpboot". They should be identical.
You will need two more files for the setup.
1. The bit stream of your PL/FPGA Design
You can find them through [find . -name "*.bit"]
2. The TCL Script to initialize the PS/ARM.
It is located at the "someDesign.sdk/hardware platform" under your Vivado project folder.
You can find them through [find . -name "*ps7_init.tcl"].
Copy these files to the "<PetaLinux Dir>/images/linux" is recommended.
After that, you can use XMD to boot the system. You also need an UART connection to your FPGA.
Steps:
1. > xmd
2. xmd> source ps7_init.tcl
3. xmd> connect arm hw
5. xmd> ps7_init
6. xmd> ps7_post_conf
7. xmd> dow u-boot.elf
8. xmd> run
9. xmd> fpga -f bitstream.bit
Step 5 and 6 enable the DDR-RAM PLL for DDR-RAM access. And these routine is located in the "ps7_init.tcl" mentioned.
Step 7 and 8 launch u-boot through JTAG.
Connecting the UART through a terminal application (e.g. Putty) and stop the auto boot process.
Step 9 downloads the bitstream to the FPGA. Without this, the kernel might stuck because it can't find the custom device through AXI ports and fail the process.
9. uboot> tftpboot 0x1000000 /tftpboot/image.ub
10. uboot> tftpboot 0x2000000 /tftpboot/urootfs.cpio.gz
11. uboot> tftpboot 0x3000000 /tftpboot/system.dtb
12. uboot> bootm 0x1000000 0x2000000 0x3000000
Step 9-11 load all the kernel related files to the DDR-RAM through tftp and bootm will start the boot.
The addresses (0x1,2,3000000) can be adjusted according to the file size.
The linux should be ready for access.
As a final remark, you might have to modify:
1. "bootargs" to boot the kernel. Most likely the ip should be included. For static IP setting, you will need: ip=DeviceIP:ServerIP:NetMask:GatewayIP:HostName:InterfaceName
It can be used during the boot process but you still need to modify "/etc/network/interfaces"
2. "tftpboot" needs a device IP and also the server IP. Make sure you have set the correct IP setting in uboot env. Furthermore, TFTP runs in UDP and no gateway is needed. You might check if the tftp server listens the correct port through: ">netstat -nulp"
Now, you can deploy your system without using SD Card. This allows me to perform remote development even I am working somewhere else. Hope you enjoy the development.
2014年5月6日 星期二
Android Smart phone Unlock Bootloader, root and flash rom
I would like to write down my experience of unlock bootloader, root and flash the rom for my sony xperia U and my understanding in a matter of kernal, tools and so on.
Before this, I would like to list out all the useful links which help me to finish the tasks.
However, time is limited, I would like to finish it tomorrow morning within 1 hour. Thank you.
http://forum.xda-developers.com/xperia-u/issues/xperia-bricked-unable-enter-neither-t2482179
http://en.kioskea.net/faq/3914-windows-7-disable-signature-verification-of-drivers
http://social.technet.microsoft.com/Forums/windows/en-US/9b6eee60-855d-47cc-9927-acae3fb6f971/permanently-disable-driver-signature-enforcement-on-win-7-x64?forum=w7itprohardware
http://www.youtube.com/watch?v=RPp0PN3FkWY
Before this, I would like to list out all the useful links which help me to finish the tasks.
However, time is limited, I would like to finish it tomorrow morning within 1 hour. Thank you.
http://forum.xda-developers.com/xperia-u/issues/xperia-bricked-unable-enter-neither-t2482179
http://en.kioskea.net/faq/3914-windows-7-disable-signature-verification-of-drivers
http://social.technet.microsoft.com/Forums/windows/en-US/9b6eee60-855d-47cc-9927-acae3fb6f971/permanently-disable-driver-signature-enforcement-on-win-7-x64?forum=w7itprohardware
http://www.youtube.com/watch?v=RPp0PN3FkWY
Xilinx Vivado VCS simulation Export
Get into TCL Console
1. cd to a test space first
2. compile_simlib -directory "somehwere" {-family/library} {-language} -simulator vcs_mx
3. Generate Block design first
4. Export for Simulations
export_simulation -lib_map_path "lib" -directory "output" -simulator vcs_mx
-of_objects [get_ips / get_files]
5. Modify the simulation script generated. It should include the source files locations.
1. cd to a test space first
2. compile_simlib -directory "somehwere" {-family/library} {-language} -simulator vcs_mx
3. Generate Block design first
4. Export for Simulations
export_simulation -lib_map_path "lib" -directory "output" -simulator vcs_mx
-of_objects [get_ips / get_files]
5. Modify the simulation script generated. It should include the source files locations.
2013年9月7日 星期六
Sync files in Windows
There is the software and link. This is a build-in software for window OS
http://www.microsoft.com/en-us/download/details.aspx?id=15155
http://www.microsoft.com/en-us/download/details.aspx?id=15155
2013年6月26日 星期三
[PCB] My PCB Design Flow
Because of some reasons, I write the following for Sharing and Education Purpose.
Hope this helps all visitors.
This piece of work is in Chinese / Cantonese. Sorry for Non-Cantonese Speakers.
好多人認為, 起一塊PCB, 就係畫Schematic 同畫Layout. 唔可以話錯, 但係只係事情既一小部份.起一起板,實情係坐係到諗同做”無聊野”既時間多過真係畫.
Okay. 咁啫係要做咩? 我通常會有一個咁既Flow
https://docs.google.com/document/d/1UnauGLrbjLl5it3u1mnhnsCIaINrPEtgAkW-ldyX2bY/edit
2013年6月25日 星期二
[Cadence] Corner Simulation + Cadence in Youtube
Youtube Video Channel.
Corner Simulation
http://www.youtube.com/watch?v=bsA2gCgyn6I
Guess What! Try out the Cadence Channel on Youtube.
I doubt you can get something from there.
http://www.youtube.com/user/CadenceDesign?feature=watch
Corner Simulation
http://www.youtube.com/watch?v=bsA2gCgyn6I
Guess What! Try out the Cadence Channel on Youtube.
I doubt you can get something from there.
http://www.youtube.com/user/CadenceDesign?feature=watch
2013年6月24日 星期一
[Website] Circuit Design site
Good Website with lots of references.
http://www2.ece.ohio-state.edu/~bibyk/ee720/ee720.htm
http://www2.ece.ohio-state.edu/~bibyk/ece822/ece822.htm
http://www2.ece.ohio-state.edu/~bibyk/ee720/ee720.htm
http://www2.ece.ohio-state.edu/~bibyk/ece822/ece822.htm
2013年6月2日 星期日
[USB] USB in a nutshell
A very good Tutorial on USB.
Read this before you dealing with USB.
http://www.beyondlogic.org/usbnutshell/usb1.shtml
Read this before you dealing with USB.
http://www.beyondlogic.org/usbnutshell/usb1.shtml
2013年5月30日 星期四
[FPGA] Xilinx FPGA Video Courses
Tons of Videos on FPGA Training.
http://www.xilinx.com/training/free-video-courses.htm
http://www.xilinx.com/training/free-video-courses.htm
2013年5月24日 星期五
[CentOS]Divide the USB drive into multi-partition
There is the reference
http://www.linuxidc.com/Linux/2013-05/84183.htm
Basically, using fdisk in root mode for dividing the partition and using mkfs for format. The full path for those two tools are under /sbin
http://www.linuxidc.com/Linux/2013-05/84183.htm
Basically, using fdisk in root mode for dividing the partition and using mkfs for format. The full path for those two tools are under /sbin
訂閱:
文章 (Atom)