element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet & Tria Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • About Us
  • Store
    Store
    • Visit Your Store
    • 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
      • Japan
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Vietnam
      • 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
  • Settings
Avnet Boards Forums
  • Products
  • Dev Tools
  • Avnet & Tria Boards Community
  • Avnet Boards Forums
  • More
  • Cancel
Avnet Boards Forums
Avnet Boards General PS serial port line break - non functional
  • Forum
  • Documents
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Avnet Boards Forums to participate - click to join for free!
Actions
  • Share
  • More
  • Cancel
Forum Thread Details
  • State Verified Answer
  • Replies 3 replies
  • Subscribers 352 subscribers
  • Views 690 views
  • Users 0 members are here
Related

PS serial port line break - non functional

Former Member
Former Member over 9 years ago

I am connecting a serial port peripheral to a Zedboard, Zynq 7020, that requires a serial port line break transmission to reset the peripheral.  The Zedboard properly communicates to the peripheral through standard Linux commands cat/echo and C routines read(<fd>,..)/write(<fd>,u2026), on PS serial port 1.  However Linux, C routine, line break functions: tcsendbreak(<fd>, 0), ioctl(<fd>, TIOCSBRK, 0), ioctl(<fd>, TIOCCBRK, 0) do not reset the peripheral, nor elicit any signal on the serial transmit line.  The exact same Linux code compiled for a PC motherboard works.  Digging deeper, directly writing 0x94 to Control_reg0 (0xE0001000), clearing the STPBRK (bit 8) and setting STTBRK (bit7) should initiate the transmitter line break, however nothing happens.

Has anyone utilized the Zynq PS serial port line break feature to know if it works, or what may be implemented incorrectly?



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

    Hello Paul,

     

    On the ZedBoard PS serial port 1 is connected to the Cypress USB-UART, so the break condition would need to be recognized and pass both the USB UART device and the driver on the host side. I don't know if that works or not. Perhaps someone else out there has some experience with this.

     

    Another option might be to enable the PS UART 0, connect the signals via EMIO to the PL and connect via one of the PMOD interfaces using an RS232 converter PMOD. Then you would be dealing directly with the UART without the USB-UART device and drivers.

     

    If you do find out the issue, or try the PS UART 0 let us know the results.

     

    -Gary

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

    Gary,

    Thanks for the response, I should have clarified the HW configuration, and you prompted me to verify the line break does work by bit accessing STPBRK and STTBRK bits directly.

    ttyPS1 is connected to UART 0, the device tree I acquired makes this confusing.  UART 0 is wired to EMIO and directly to PMOD pins where it is connected to PHY line drivers and the peripheral device. 

    By writing to the correct UART 0 register 0xE0000000 the serial break function does work by writing 0x94 and 0x114.  Progress!

    However do not understand why the Linux commands, tcsendbreak etc... do not work.  Will now dig into the device driver code now that HW is confirmed working.

    Paul

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

    Found the issue with the xilinx_uartps.c file preventing serial line breaks from functioning.

    The original Xilinx_uartps.c code only set STARTBRK for a line break system call.  However, STOPBRK (STPBRK) must be cleared to set STARTBRK.  This must be performed in one single write transaction.  
    Note Zynq UG585, Register Control_reg0 Details,  states STARTBRK can only be set if STOPBRK is not high, however to implement this the bits must be modified simultaneously.
    Solution:
    Update: /drivers/tty/serial/xilinx_uartps.c   Line 613:
    From: ttxuartps_writel(XUARTPS_CR_STARTBRK | status,
    To:ttxuartps_writel(XUARTPS_CR_STARTBRK | (~XUARTPS_CR_STOPBRK & status),

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Reject 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 © 2025 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