Become a leader in the IoT community!

New DevHeads get a 320-point leaderboard boost when joining the DevHeads IoT Integration Community. In addition to learning and advising, active community leaders are rewarded with community recognition and free tech stuff. Start your Legendary Collaboration now!

Step 1 of 5

CREATE YOUR PROFILE *Required

Change Email
OR
Step 2 of 5

WHAT BRINGS YOU TO DEVHEADS? *Choose 1 or more

Collaboration & Work 🤝
Learn & Grow 📚
Contribute Experience & Expertise 🔧
Step 3 of 5

WHAT'S YOUR INTEREST OR EXPERTISE? *Choose 1 or more

Hardware & Design 💡
Embedded Software 💻
Edge Networking
Step 4 of 5

Personalize your profile

Step 5 of 5

Read & agree to our COMMUNITY RULES

  1. We want this server to be a welcoming space! Treat everyone with respect. Absolutely no harassment, witch hunting, sexism, racism, or hate speech will be tolerated.
  2. If you see something against the rules or something that makes you feel unsafe, let staff know by messaging @admin in the "support-tickets" tab in the Live DevChat menu.
  3. No age-restricted, obscene or NSFW content. This includes text, images, or links featuring nudity, sex, hard violence, or other graphically disturbing content.
  4. No spam. This includes DMing fellow members.
  5. You must be over the age of 18 years old to participate in our community.
  6. Our community uses Answer Overflow to index content on the web. By posting in this channel your messages will be indexed on the worldwide web to help others find answers.
  7. You agree to our Terms of Service (https://www.devheads.io/terms-of-service/) and Privacy Policy (https://www.devheads.io/privacy-policy)
By clicking "Finish", you have read and agreed to the our Terms of Service and Privacy Policy.

I have a BBB, How do i change the build-in bus driver to a module?

Hello Guys,
I have a BBB, How do i change the build-in bus driver to a module?

  1. Marvee Amasi#0000

    It’s to tweak things in the kernel, reconfigure the kernel

  2. Marvee Amasi#0000

    What’s your current configuration like

  3. melta101#0000

    Normal 6.12-rc1 kernel that comes with BBB

  4. melta101#0000

    I was thinking of taking the config folder and Changing that CONFIG=Y to CONFIG=m and then recompile it

  5. Marvee Amasi#0000

    just editing the .config file manually works? You know that it’s easy to miss dependencies

  6. melta101#0000

    What dependency are there in kernel?

  7. Marvee Amasi#0000

    Just make sure to recompile the kernel, not just the modules tho, since the .config changes might affect other components

  8. melta101#0000

    Right
    That’s why I am slightly confused

  9. melta101#0000

    So which all places should I should I change

  10. melta101#0000

    One is config

  11. melta101#0000

    Second Is vmlinux

  12. melta101#0000

    I think even change the path pointing to vmlinux in uEnv.txt

  13. melta101#0000

    Anything else?

  14. Marvee Amasi#0000

    Oh I meant about some configurations and features

  15. Marvee Amasi#0000

    I will suggest u so it this way

  16. melta101#0000

    Ah
    I see!

  17. Marvee Amasi#0000

    Since you are using 6.12-rc1 just firstly export the current configuration you have , to ensure u are working with the exact config for your current kernel

  18. Marvee Amasi#0000

    Hey what about using use make menuconfig or make nconfig

  19. Marvee Amasi#0000

    instead of directly editing the .config

  20. melta101#0000

    Yea
    That better
    But ryt now I was able to compile with the edited part

  21. melta101#0000

    So instead of y to m

  22. melta101#0000

    Main part
    Is how do I install this kernel from here

  23. melta101#0000

    And the extra module instead of using insmod

  24. Marvee Amasi#0000

    “`make modules_install
    make install“`

  25. Marvee Amasi#0000

    This will install d modules and update ur bootloader for you

  26. Marvee Amasi#0000

    Just that you will need to edit the uEnv.txt file on the boot partition to reference the new kernel image

  27. Marvee Amasi#0000

    Next thing is to restart after all said and done

  28. melta101#0000

    Hey, sorry for the delay in msg,
    but this would mean that i would have to clone the kernel in BBB?

  29. Marvee Amasi#0000

    Uhmm well not necessarily tho , you don’t need to clone the kernel source on the BBB itself. If you compiled the kernel and modules on another system like your PC, just transfer the necessary files to the BBB

  30. Marvee Amasi#0000

    Copy the kernel image maybe zImage or Image, copy the modules and the
    .dtb if you would need that

  31. Marvee Amasi#0000

    Place these guys you copied in the their own locations on the BBB and update the uEnv.txt file to point to the new kernel

  32. Marvee Amasi#0000

    Cus cloning or compiling directly on the BBB can be slow

  33. ming_58391#0

    There is a bit of documentation at:
    https://docs.beagleboard.org/books/beaglebone-cookbook/07kernel/kernel.html

    To re-compile the kernel:
    1. Get hold of a suitable toolchain **on your main Linux PC**
    `sudo apt install gcc-arm-linux-gnueabihf`

    2. Get hold of the kernel **on your PC**
    `git clone git://github.com/beagleboard/linux.git`

    3. Find out what version of the kernel you are running **on your BBB**

    uname -a
    Linux beaglebone 5.10.168-ti-r62 #1bullseye SMP PREEMPT Tue May 23 20:15:00 UTC 2023 armv7l GNU/Linux
    GNU/Linux
    

    The key bit of info is the `5.10.168-ti-r62`
    That tells me it is the 5.10 kernel

    4. Checkout the kernel version **on your PC**
    `cd linux`
    `get checkout -b 5.10.y`
    _Replace with your version_

    5. Get the kernel configuration file **from the BBB**
    There is a compressed copy of the kernel `.config` in the `/proc` directory
    `cp /proc/config.gz .`
    `gunzip config.gz`
    `mv config melta_defconfig`
    Copy this `melta_defconfig` over to your PC in te directory `linux/arch/arm/configs`

    6. Set up the kernel configuration **on your PC**
    `make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- melta_defconfig`

    7. Use the menuconfig system to change the driver to a Module
    It is safer to use the menuconfig rather than just editing the file is the menuconfig system (hopefully!) knows about any potential dependancies
    `make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- menuconfig`
    You will need ncurses-devel installed

    8. Re-compile the kernel & modules
    `make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- -j4 zImage modules`
    The `j4` is how many CPU cores to use for the compile. Use as many as you actually have

    8. Collect the modules
    `mkdir ~/new_modules`
    `make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- INSTALL_MOD_PATH=~/new_modules`

  34. ming_58391#0

    9. Copy the kernel & modules to your BBB
    `scp arch/arm/boot zImage :/boot/zImage-melta`
    `scp -rp ~/new_modules/lib/modules/*
    :/lib/modules`

    10. Ask your BBB to use the new kernel
    Edit `/boot/uEnv.txt`
    Change the `uname_r` line to the name of your new kernel
    e.g. `uname_r=zImage-melta`

    11. Reboot the BBB and see if it works

    12. (Optional) Re-flash the SD Card of the BBB as you realise that I wrote the instructions from memory, missed some step and have bricked the board 🙂

CONTRIBUTE TO THIS THREAD

Browse other questions tagged 

Leaderboard

RANKED BY XP

All time
  • 1.
    Avatar
    @Nayel115
    1620 XP
  • 2.
    Avatar
    @UcGee
    650 XP
  • 3.
    Avatar
    @melta101
    600 XP
  • 4.
    Avatar
    @lifegochi
    250 XP
  • 5.
    Avatar
    @Youuce
    180 XP
  • 6.
    Avatar
    @hemalchevli
    170 XP