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
Single-Board Computers
  • Products
  • Dev Tools
  • Single-Board Computers
  • More
  • Cancel
Single-Board Computers
Forum Compile kernel module (sc16is7xx.c)
  • Blog
  • Forum
  • Documents
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Single-Board Computers to participate - click to join for free!
Actions
  • Share
  • More
  • Cancel
Forum Thread Details
  • Replies 9 replies
  • Subscribers 58 subscribers
  • Views 2323 views
  • Users 0 members are here
  • sc16is752
  • maaxboard
Related

Compile kernel module (sc16is7xx.c)

david.bozo
david.bozo over 5 years ago

Hello!

I'm looking for a way to add driver for SC16IS752 IC.

 

I want to use the Waveshare 2-CH RS232 HAT . This hat contains a SC16IS752 IC which uses SPI to communicate.

As far as i see the default image does not contains this module so i want to compile it from source: sc16is7xx.c(v4.14)

 

But i did not found the current kernel headers in /lib/modules/4.14.78/build. It points to /home/embest/compile/linux which is a not exist.

How can i achive this the most easily? Could someone point me in the right direction?

  • Sign in to reply
  • Cancel

Top Replies

  • jafoste4
    jafoste4 over 5 years ago +1
    Hi David, I'll look into this today. Will have an answer come tomorrow. Thx, Josh
  • zebular13
    zebular13 over 5 years ago +1
    Hi David, I believe that to enable the driver you'll have to compile the kernel from source using these instructions: MaaXBoard-Linux-Development_Guide-V1.0-EN.pdf After running "make em-sbc-imx8m_defconfig…
  • jafoste4
    jafoste4 over 5 years ago in reply to david.bozo +1
    Hi David, The only supported systems for the MaaXBoard/Mini are Yocto / Debian Linux and Android 9.0 Link to Yocto Sources - https://github.com/Avnet/meta-maaxboard I would reccomend you avoid using another…
  • jafoste4
    jafoste4 over 5 years ago

    Hi David,

     

    I'll look into this today. Will have an answer come tomorrow.

     

    Thx,

    Josh

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Cancel
  • zebular13
    zebular13 over 5 years ago

    Hi David,

     

    I believe that to enable the driver you'll have to compile the kernel from source using these instructions: MaaXBoard-Linux-Development_Guide-V1.0-EN.pdf

    After running "make em-sbc-imx8m_defconfig" and before running "make" in step 2.2.2 you can enable the driver in the .config file in the "linux" directory (found here: http://downloads.element14.com/downloads/zedboard/MaaxBoard/MaaXBoard-LinuxSourceCode-V1.0.6r07.rar.zip?ICID=maaxboard-d…

    I'm currently going through the same process, so reach out if you have further questions.

     

    Monica

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Cancel
  • david.bozo
    david.bozo over 5 years ago

    Thank you! I hoped i had other option then this. This will be my first time to do this so i might take the opportunity to ask you.

     

    But another question of mine. Is there any other linux distro for this board? Some more mainstream? Ubuntu, Debian, Alpine? I mean i know it is based on Debian 10.5 but i would rather use the official builds.

    In theory what would it take to for example use Ubuntu?

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • jafoste4
    jafoste4 over 5 years ago in reply to david.bozo

    Hi David,


    The only supported systems for the MaaXBoard/Mini are Yocto / Debian Linux and Android 9.0

     

    Link to Yocto Sources -https://github.com/Avnet/meta-maaxboard

     

    I would reccomend you avoid using another distro from a support standpoint, a significant amount of effort went into the development of the MaaXBoard/Mini specific libraries in each distribution supported. This would need to be created from scratch by you if you wanted for instance to use somthing besides Debian/Yocto/Android.

     

    If you wanted to use the official Debian release as mentioned above, you may be able to port the MaaXBoard specific files from the current Debian build. However support from our side would be quite limited.

     

    -Josh

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Cancel
  • david.bozo
    david.bozo over 4 years ago in reply to jafoste4

    I will probably stick with it then. Just these because these chinese it looked some too costume.  Thank you.

    If i get it right. Yocto project is aims to generate configure files to the kernel to be compatible with embedded systems?

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • david.bozo
    david.bozo over 4 years ago in reply to zebular13

    So i tried to compile the source using the documentation but i have some new questions.

     

    1. Sometimes if a compile the source i'm getting this kind of error:

    In file included from drivers/usb/phy/phy-gpio-vbus-usb.c:14:0:./include/linux/module.h: In function ’within_module_init’:./include/linux/module.h:511:9: internal compiler error: Segmentation fault
    
             addr < (unsigned long)mod->init_layout.base + mod->init_layout.size;         ^~~~Please submit a full bug report,with preprocessed source if appropriate.See <https://gcc.gnu.org/bugs/> for instructions.make[3]: *** [scripts/Makefile.build:328: drivers/usb/phy/phy-gpio-vbus-usb.o] Error 1

    Have you ever got this kind of error?

    After this i start make -j8 again and it compiles successfully. Is it probably just some gcc error because it is outdated?

    I'm using the provided 'gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu'. Are you using the same too?

     

    2. As you suggested i edited the .config file after make 'em-sbc-imx8m_defconfig' but it does not compiles the kernel module:

    lbozo@lbozo-PC:~/maaxboard/01LinuxSourceCode/linux$ find . -name "*sc16is7*"
    ./drivers/tty/serial/sc16is7xx.o
    ./drivers/tty/serial/.sc16is7xx.o.cmd
    ./drivers/tty/serial/sc16is7xx.c
    ./include/config/serial/sc16is7xx
    ./include/config/serial/sc16is7xx.h
    ./Documentation/devicetree/bindings/serial/nxp,sc16is7xx.txt
    

    I looked for it in the output folder too after:  'make modules_install INSTALL_MOD_PATH=~/output/modules/'

    But i did not found it.

    Sure is this the right way to enable this module? I tried to find other ways like make config, make menuconfig but not sure i can use them and i didnt even find the module in the menu.

    Edit (solution):

    I found the solution for the 2. question. If someone needs the solution:

    By editing the .config file with:

    'CONFIG_SERIAL_SC16IS7XX=y'

    I probably just statically linked it into the kernel. I used make xconfig GUI to configure. If the checkbox is checked (✓) it will compile it statically. If it is a dot (•) then it will create a kernel module.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • david.bozo
    david.bozo over 4 years ago in reply to david.bozo

    I'm trying  to understand how this device tree works and how to configure an overlay to load /dev/ttySCx for that Waveshare 2-CH RS232 HAT .

    But so far no luck. I found the overlay for Raspberry: https://github.com/raspberrypi/linux/blob/rpi-5.4.y/arch/arm/boot/dts/overlays/sc16is752-spi1-overlay.dts

    But i have no idea how to port it.

    Can someone help me out with a dts code please?

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • jafoste4
    jafoste4 over 4 years ago in reply to david.bozo

    Hi David,

     

    For number 1 is this an intermittent issue your having? The GCC compiler we used was gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu. So it looks like we are using the same. Please note you can find all the linux build resources located under reference designs -> Linux tools section.

     

    I'll try to get some feedback for you on the dts code help come monday.

     

    -Josh

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • david.bozo
    david.bozo over 4 years ago in reply to jafoste4

    Yes it was intermittent since then i don't have any problem with the compilation process.

    First time i downloaded the cross compiler from here: https://releases.linaro.org/components/toolchain/binaries/7.3-2018.05/aarch64-linux-gnu/

    Maybe that was the problem not sure. But i did not meet with the error.

     

    Thank you. Im looking forward ti it.

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