element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Members
    Members
    • Achievement Levels
    • Benefits of Membership
    • Feedback and Support
    • Members Area
    • Personal Blogs
    • What's New on element14
  • Learn
    Learn
    • eBooks
    • Learning Center
    • Learning Groups
    • STEM Academy
    • Webinars, Training and Events
  • Technologies
    Technologies
    • 3D Printing
    • Experts & Guidance
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Arduino Projects
    • Design Challenges
    • element14 presents
    • Project14
    • Project Groups
    • Raspberry Pi Projects
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • Store
    Store
    • Visit Your Store
    • Or choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
Avnet Boards Forums
  • Products
  • Dev Tools
  • Avnet Boards Community
  • Avnet Boards Forums
  • More
  • Cancel
Avnet Boards Forums
MicroZed Hardware Design Adding a serial port
  • Forum
  • Documents
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Avnet Boards Forums requires membership for participation - click to join
Actions
  • Share
  • More
  • Cancel
Forum Thread Details
  • State Not Answered
  • Replies 3 replies
  • Subscribers 175 subscribers
  • Views 167 views
  • Users 0 members are here
Related

Adding a serial port

100bobdxcool
100bobdxcool over 8 years ago

I am running xillinux on my microzed board. I need to define a new serial port on the board. I was able to add this to the IP core and the device is ready. But,how do I make this port visible on ubuntu (xillinux) like ttyPS0. DO I need to add this port to the device tree and generate the dtb file and boot.bin file ? IF so, how do I modify the device tree ?

  • Sign in to reply
  • Cancel
  • Former Member
    0 Former Member over 8 years ago

    Hello,

    Yes, you need to modify the device tree so that Linux' kernel knows about the extra serial port's existence and its attributes (for example, the address it's mapped to on the bus).

    You may find this tutorial helpful:

    http://xillybus.com/tutorials/device-tree-zynq-1

    On top of that, you probably need to create your own boot.bin file, unless the processor's setting remained the same as before. If you enabled a serial port, or changed its mapping in the processor's settings, the FSBL has to be recompiled according to the new setting, so it sets up the processor's internal registers accordingly at bootup.

    Please observe my answers on this thread:

    http://forum.xillybus.com/viewtopic.php?f=4&t=319

    They apply to your case as well (if you need to generate a new boot.bin).

    Regards,
       Eli

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • 100bobdxcool
    0 100bobdxcool over 8 years ago in reply to Former Member

    Thank you for replying back.

    1.)  Now again, instead of vivado if I use ISE, then would I be able to update the device tree source file in the ISE software itself and generate the device tree .dtb file ? If so, where can I find and edit this dts file ?

    2.) And for building the new boot.bin file in ISE, I can use http://xillybus.com/downloads/u-boot-xillinux-1.3.elf.zip for the microzed or can I use the bin file for microzed from http://xillybus.com/downloads/xillinux-eval-microzed-1.3c.zip ?

    3.) Even after using the ISE and creating the new .dtb (if possible in ISE), do I have to edit dtc files on the xillinux OS in the micozed board ?

    4.) If I need to follow step 3 to get everything working, based on this link, http://xillybus.com/tutorials/device-tree-zynq-1

    I can go only upto to cd /usr/src/kernels/3.12.0-xillinux-1.3/scripts/dtc/

    If I type cd /dtc again, it says dtc not a directory.

    How do I access the device tree script and add the address mapping to the bus in the peripheral section ?
    How do I compile this and make the new device tree start on every boot ?

    I am new to this platform. So, your help will be very appreciated.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • 100bobdxcool
    0 100bobdxcool over 8 years ago in reply to Former Member

    Thanks for your help. I managed to generate a new dtb on the microzedboard (7020) itself. These are the steps I followed below.

    cd /usr/src/kernels/3.12.0-xillinux-3.0/
    scripts/dtc/dtc -I fs -O dts -o ~/devicetree.dts /proc/device-tree/

    The devicetree.dts file was then found in the root directory. I added the following lines to the code

    serial@e0000000 {
        clock-names = "ref_clk", "aper_clk";
        clocks = <0x3 0x17 0x3 0x28>;
        compatible = "xlnx,ps7-uart-1.00.a", "xlnx,xuartps";
        current-speed = <0x1c200>;
        device_type = "serial";
        interrupt-parent = <0x2>;
        interrupts = <0x0 0x1B 0x4>;
        port-number = <0x1>;
        reg = <0xe0000000 0x1000>;
        xlnx,has-modem = <0x0>;
    };

    Then compiled it using the command below:

    scripts/dtc/dtc -I dts -O dtb -o /root/devicetree.dtb /root/devicetree.dts

    Then copied the new dtb file to a flash drive. Replaced the new .dtb file on the SD card.

    I had already generated a new bit file in vivado for the extra serial port UART0. Although the new port ttyPS1 was being detected, the communication wasnt happening properly. SO, I realized that I need to generate a new boot.bin file. So using thr SDK i generated a new FSBL, and then the boot.bin file. This part was a little tricky as there were no repositories available for xillinux modules (while creating new BSP file) on the SDK software. SO, I used standalone platform. These were the set of steps I followed to generate a new boot.bin file.

    1.) After the bit file generation in vivado, I selected export project to SDK. On the SDK, I selected new application project and selected standalone as OS and selected ZC702 hardware and then cortexa9 processor.
    2.) Then, I clicked on create a new BSP package. Chose standalone OS again.
    3.) The from the project folder after right clicking on it, clicked on create boot image. Here, I selected create new bif file. I selected the primary partition as type bootloader and chose the .elf file generated from this poject. The second parition (data file) I added the elf file from here (http://xillybus.com/downloads/u-boot-xillinux-1.3.elf.zip)
    4.) I created a boot.bin file and added it to the SD card.

    After all this I was able to read and write to ttyPS1 (With tx n rx shorted, whatever I wrote to ttyPS1 was reflected back in the read statement in the code)  without any issues. I just wanted to make sure this is the right way of generating the boot.bin file from you so that the next time I make any changes to hardware which needs me to generate a new boot.bin I follow this method.

    Also, another doubt I had is regarding the SD card. When I burnt the img.gz of xillinux from this page (http://xillybus.com/xillinux), I was analysing the two partitions on linux gparted software. It had two partitions, one was FAT16 and another was ext4 which is different from what they say on page 11 of this document (http://xillybus.com/downloads/doc/xillybus_getting_started_zynq.pdf) where they say FAT32 and ext4. Is this normal ?
    Also, A 4GB SD card is sufficient rigght ? 16MB for FAT 16 and the rest for ext4 partition.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2023 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube