element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • About Us
  • 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 Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • 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
      •  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
  • Settings
Avnet Boards Forums
  • Products
  • Dev Tools
  • Avnet Boards Community
  • Avnet Boards Forums
  • More
  • Cancel
Avnet Boards Forums
MiniZed Hardware Design Adding uartlite or uart16550 petalinux problem
  • 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 2 replies
  • Subscribers 324 subscribers
  • Views 2955 views
  • Users 0 members are here
Related

Adding uartlite or uart16550 petalinux problem

mhanuel
mhanuel over 7 years ago

I have a problem adding an uart to the PL for Minized Petalinux project, auart16550 is added to vivado project and exported to petalinux by doing

petalinux-config --get-hw-description=<my_hdf.sdk folder>

Project build successfully. 

Boot image shows the uart16550

 

Serial: 8250/16550 driver, 4 ports, IRQ sharing disabled
43c10000.serial: ttyS3 at MMIO 0x43c11000 (irq = 166, base_baud = 3000000) is a 16550A
43c00000.serial: ttyS0 at MMIO 0x43c01000 (irq = 167, base_baud = 3000000) is a 16550A
e0000000.serial: ttyPS1 at MMIO 0xe0000000 (irq = 143, base_baud = 6249999) is a xuartps
e0001000.serial: ttyPS0 at MMIO 0xe0001000 (irq = 144, base_baud = 6249999) is a xuartp
 
 43c00000 is the bluetooth uart. 
 43c10000 is my new uart16550 IP.
 
I have added to recipes-kernel under meta-user the following
 
  #
  # Serial drivers
  #
  CONFIG_SERIAL_8250=y
  CONFIG_SERIAL_8250_CONSOLE=y
  CONFIG_SERIAL_8250_NR_UARTS=4
  CONFIG_SERIAL_8250_RUNTIME_UARTS=4
   
   
  #
  # Non-8250 serial port support
  #
   
  CONFIG_SERIAL_CORE=y
  CONFIG_SERIAL_CORE_CONSOLE=y
  CONFIG_SERIAL_OF_PLATFORM=y

The device tree under meta-user (system-user.dtsi)

 &axi_uart16550_0 {

 
status = "okay";
port-number = <3>;
current-speed = <57600>;
xlnx,use-modem-ports = <0x0>;
xlnx,use-user-ports = <0x0>;
 
};
 
and the generated .dts file for uart16550 becomes
 
  serial@43c10000 {
  clock-frequency = <0x2dc6c00>;
  clock-names = "ref_clk";
  clocks = <0x1 0x0>;
  compatible = "xlnx,xps-uart16550-2.00.a", "ns16550a";
  current-speed = <0xe100>;
  device_type = "serial";
  interrupt-parent = <0x4>;
  interrupts = <0x0 0x1f 0x4>;
  port-number = <0x3>;
  reg = <0x43c10000 0x10000>;
  reg-offset = <0x1000>;
  reg-shift = <0x2>;
  xlnx,external-xin-clk-hz = <0x2dc6c00>;
  xlnx,external-xin-clk-hz-d = <0x30>;
  xlnx,has-external-rclk = <0x0>;
  xlnx,has-external-xin = <0x1>;
  xlnx,is-a-16550 = <0x1>;
  xlnx,s-axi-aclk-freq-hz-d = "100.0";
  xlnx,use-modem-ports = <0x0>;
  xlnx,use-user-ports = <0x0>;
  status = "okay";
  };
   
  After logging in, I can see there is no issue with any kernel module (2017.2 version tool) and my serial list correctly
   
 
   root@MiniZed:~# lsmod
 
       Not tainted
 
   uio_pdrv_genirq 2754 0 - Live 0xbf000000
 
   root@MiniZed:~# dmesg | grep serial
 
   43c10000.serial: ttyS3 at MMIO 0x43c11000 (irq = 166, base_baud = 3000000) is a 16550A
 
   43c00000.serial: ttyS0 at MMIO 0x43c01000 (irq = 167, base_baud = 3000000) is a 16550A
 
   e0000000.serial: ttyPS1 at MMIO 0xe0000000 (irq = 143, base_baud = 6249999) is a xuartps
 
   e0001000.serial: ttyPS0 at MMIO 0xe0001000 (irq = 144, base_baud = 6249999) is a xuartps
 
   root@MiniZed:~# echo 123 > /dev/ttyS0
 
    
 
    
 
   Then when trying to echo anything I got this
 
    
 
  
    root@MiniZed:~# echo 123 > /dev/ttyS3
  
    Unhandled fault: imprecise external abort (0x406) at 0xb6fa9e40
  
    pgd = c7b30000
  
    [b6fa9e40] *pgd=07a8d831, *pte=05b7775f, *ppte=05b77c7f
  
    Internal error: Oops - BUG: 406 [#1] PREEMPT SMP ARM
  
    Modules linked in: uio_pdrv_genirq
  
    CPU: 0 PID: 1273 Comm: sh Not tainted 4.9.0-xilinx-v2017.2 #1
  
    Hardware name: Xilinx Zynq Platform
  
    task: de6cb980 task.stack: c7bc6000
  
    PC is at mem_serial_in+0x18/0x1c
  
    LR is at serial8250_do_startup+0x190/0x63c
  
    pc : [<c0362288>]    lr : [<c0364580>]    psr: 60000013
  
    sp : c7bc7d80  ip : 00000000  fp : 00000000
  
    r10: 00020241  r9 : de7e1940  r8 : c7b5e800
  
    r7 : 00000000  r6 : c0a629a8  r5 : 00000000  r4 : c0a629a8
  
    r3 : e0910000  r2 : 00000002  r1 : e0910014  r0 : 00000000
  
    Flags: nZCv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment none
  
    Control: 18c5387d  Table: 07b3004a  DAC: 00000051
  
    Process sh (pid: 1273, stack limit = 0xc7bc6210)
  
    Stack: (0xc7bc7d80 to 0xc7bc8000)
  
    7d80: de7ddaf4 00000000 c0a629a8 00000000 c7b5e800 de7e1940 00020241 c035ef00
  
    7da0: 00000000 c7b5e800 de7ddb88 c7a6c780 c7bc6000 c0360948 de7ddaf4 c7b5e800
  
    7dc0: de7ddb88 c034fdf4 c7b5e800 c780ed80 c7a6c780 00400043 c7bc6000 c035fb28
  
    7de0: c7b5e800 c0349ca4 de7e1940 00000003 00000000 de5a0a00 00000000 de7e1940
  
    7e00: c072cba4 c7a6c780 c7bc6000 00000000 00000000 c01d18d0 de7e1940 00000000
  
    7e20: c7a6c780 de7e1940 00000000 c01d178c c7a6c788 c01cb990 c7bc7ed0 00000000
  
    7e40: 00000000 c7a6c780 00020241 c7bc6000 00000000 c01dabc0 bedffa74 c019887c
  
    7e60: c7bc7f74 00000000 00020241 de425ab8 000081b6 00000041 de001440 00000002
  
    7e80: 00000040 c7bc7ed8 00000000 00000000 de7e1940 de6b4190 de0a3aa0 00000000
  
    7ea0: c7bc7ea0 c7bc7ea0 00000004 00000003 c7bc7f74 00000001 ffffff9c c0106e24
  
    7ec0: c7bc6000 00000000 bedffa74 c01daf4c de6b4190 de0a3aa0 426ab25c 00000005
  
    7ee0: de531015 024000c0 00000000 de001770 de7e1940 00000301 00000000 0000003a
  
    7f00: 00000000 00000000 00000000 c7bc7f10 de400380 024000c0 a0000013 00101708
  
    7f20: 00000000 00000000 00000003 c742c6c0 c7b51700 c7b51740 00020241 c01e724c
  
    7f40: de531000 00000000 00020241 00000002 ffffff9c c0106e24 00000003 00020241
  
    7f60: de531000 c01cc948 c7bc6000 bedff1f0 00000051 00020241 c01081b6 00000002
  
    7f80: 00000300 00000001 00000000 00000241 00000000 00000001 00000005 c0106e24
  
    7fa0: c7bc6000 c0106c60 00000241 00000000 00101708 00020241 000001b6 00000000
  
    7fc0: 00000241 00000000 00000001 00000005 00000003 00101708 b6fd5880 bedffa74
  
    7fe0: 000e32ec bedff930 000765a4 b6eee888 60000010 00101708 1eff6861 1eff6c61
  
    [<c0362288>] (mem_serial_in) from [<c0364580>] (serial8250_do_startup+0x190/0x63c)
  
    [<c0364580>] (serial8250_do_startup) from [<c035ef00>] (uart_port_startup+0x74/0x104)
  
    [<c035ef00>] (uart_port_startup) from [<c0360948>] (uart_port_activate+0x48/0x6c)
  
    [<c0360948>] (uart_port_activate) from [<c034fdf4>] (tty_port_open+0x7c/0xbc)
  
    [<c034fdf4>] (tty_port_open) from [<c035fb28>] (uart_open+0x30/0x38)
  
    [<c035fb28>] (uart_open) from [<c0349ca4>] (tty_open+0x10c/0x47c)
  
    [<c0349ca4>] (tty_open) from [<c01d18d0>] (chrdev_open+0x144/0x15c)
  
    [<c01d18d0>] (chrdev_open) from [<c01cb990>] (do_dentry_open.constprop.3+0x224/0x2e0)
  
    [<c01cb990>] (do_dentry_open.constprop.3) from [<c01dabc0>] (path_openat+0x9a4/0xd00)
  
    [<c01dabc0>] (path_openat) from [<c01daf4c>] (do_filp_open+0x30/0x78)
  
    [<c01daf4c>] (do_filp_open) from [<c01cc948>] (do_sys_open+0xe8/0x1ac)
  
    [<c01cc948>] (do_sys_open) from [<c0106c60>] (ret_fast_syscall+0x0/0x3c)
  
    Code: e0831211 e5d10000 e6ef0070 f57ff04f (e12fff1e) 
  
    ---[ end trace ae9403c8fd40899c ]---
  
    /bin/start_getty: line 8:  1273 Segmentation fault      /sbin/getty -L $1 $2
  
     
  
     
  
    Does someone have sucessfully used an uart16550 under Minized using petalinux?
  
     
  
    Will appreciate comments,
 
 
    
 
    
   
   
  • Sign in to reply
  • Cancel
  • jlamp
    0 jlamp over 7 years ago

    Hi @mhanuel,

     

    Looking to the kernel log your error is located in the serial8250_do_startup kernel function. It seems that the serial8250 is not initializing.

    I do not have the minized board but I will check the BOOT.bin file created using petalinux. For me the fpga is not loading the bitstream correctly so the kernel complains.

    Create a new BOOT.bin using SDK and your hdf. (FSBL, bitstream)

    Regards,

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Reject Answer
    • Cancel
  • mhanuel
    0 mhanuel over 7 years ago in reply to jlamp

    Hi, @jlamperez,

    After recreating the BOOT.bin using hsi and bootgen tools and loading it to emmc I was able to solve the issue.

    Only thing is that I have to write the boot.bin to /dev/mtd0, which I understand is the QSPI memory, without doing it the error is not solved.

    Thank you for your comments,

    • 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 © 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