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
Software Application Development building a kernel module/device driver for zedboard/zynq
  • 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 Not Answered
  • Replies 2 replies
  • Subscribers 329 subscribers
  • Views 430 views
  • Users 0 members are here
Related

building a kernel module/device driver for zedboard/zynq

Former Member
Former Member over 10 years ago

I have a PL design to which I need to write my own char device driver to control. I did the driver development on my linux VM and have a standard kernel module makefile

obj-m += mydriver.o
mydriver-objs := my_driver.o

all:    make -C /lib/modules/$(shell uname -r)/build M=$(PWD) modules
clean:
        make -C /lib/modules/$(shell uname -r)/build M=$(PWD) clean

however when I go to build it on my zedboard linux install (Linaro) i get this error:

make: *** /lib/modules/3.18.0-xilinx-06444-g06af32c/build: No such file or directory.  Stop.
make: *** [all] Error 2

how may I go about building my driver on zynq?

  • Sign in to reply
  • Cancel
  • zedhed
    0 zedhed over 10 years ago

    Hi BluePAZ,

    Are you compiling your driver statically into the kernel image?

    When I add a new PL driver to the kernel, I typically put it in a new drivers/pl/ folder under the kernel source.

    Then I make edits to drivers/Kconfig to add the Kconfig from my PL driver:

    source "drivers/pl/Kconfig"

    Then I make edits to drivers/Makefile to add the PL driver directory to the build traversal list:

    obj-$(CONFIG_PL)tt+= pl/

    Then I edit the PL driver Kconfig in /drivers/pl/Kconfig to add the configuration information needed for my PL driver:

    menuconfig PL
    tbool "Programmable Logic Support"
    tdepends on HAS_IOMEM && OF
    thelp
    ttAvnet Programmable Logic Support

    if PL

    config PL_DEBUG
    tbool "Enable Debug Message"

    config LEDBRIGHTNESS
    ttristate "LED Brightness Controller"
    thelp
    ttThe Avnet LED Brightness Controller

    endif # PL

    Edit the /drivers/pl/Makefile to add the appropriate source files to your kernel build.

    obj-$(CONFIG_LEDBRIGHTNESS) += led-brightness.o

    Finally you will need to edit your kernel config file to add your new driver configuration to the list and specify whether it is to be built statically or built as a dynamic kernel module.

    Once you are done setting up the source tree, you should be able to build by using the following command:

    make ARCH=arm

    Using the updated configuration and Kconfigs, the kernel should end up building only your new driver (plus and added dependencies) into the kernel image or kernel module depending on how your driver was configured.

    Regards,

    -Kevin

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

    Hello Kevin,


    menuconfig PL
    bool "Programmable Logic Support"
    depends on HAS_IOMEM && OF
    help
    Avnet Programmable Logic Support

    if PL

    config PL_DEBUG
    bool "Enable Debug Message"

    config LEDBRIGHTNESS
    tristate "LED Brightness Controller"
    help
    The Avnet LED Brightness Controller

    endif # PL




    Is above step common for all drivers or its special for your driver?
    where do you find kernel config file? and what changes you made in it?
    after you get kernel image including static module, how do you test it on zynq board?

    Please Guide.

    Ganesh.

    • 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