Beagle Bone Black Devicetree Hardware Support - cu-ecen-aeld/buildroot-assignments-base GitHub Wiki
NOTE: This version has been tested on Buildroot version 2019.05.x. The I2C patch has been updated and tested for version 2021.02.x
See the pull request at https://github.com/cu-ecen-5013/buildroot-assignments-base/pull/4 which shows the steps to enable UART 1, 4 and 5 on BeagleBone Black running bare Linux built using Buildroot as described below.
Also see the pull request at https://github.com/cu-ecen-5013/buildroot-assignments-base/pull/16 which shows the steps to enable I2C-1 on the Beaglebone Black running bare Linux builf using buildroot.
Updated I2C patch tested as of Buildroot version 2021.02.x
Check link on which I2C bus is available and can be used to interface sensors.
Similar steps should work for enabling SPI(it has not been tested).
Step 1:
- Create a directory
patches
inbase_external
directory. - Modify your buildroot configuration with the command
make menuconfig
in buildroot directory to setBR2_GLOBAL_PATCH_DIR
to../base_external/patches
directory. (References for adding project specific patches: #1 and #2.) - Save configuration using
save_config.sh
present in project root directory.
Step 2:
- For adding I2C support, enable busybox_show_others and I2C-tools in your buildroot configuration.(For SPI you enable SPI tools and SPIdev).
- Save this configuration using 'save_config.sh'.
Step 3:
Create a directory linux
in `base_external/patches'
- For adding UART support, place this patch in it.
- For adding I2C-1 support, place this patch in the same directory.
(The UART patch above is a modified version of the original patch. Refer to the pinout, P8 and P9 headers of BBB for content. The I2C patch is done in a similar manner as the UART patch but also referring to this overlay.)
Step 4:
Go into buildroot directory and run the following commands in order:
make linux-dirclean
make linux-patch
Step 5:
Run build.sh
present in project root directory.
Proof:
For UART:
Before application of patch:
After application of patch:
For I2C:
Before application of patch:
After application of patch:
Testing the I2C bus:
You can use i2c detect commands if you wish to test the working of the I2C bus before executing the userspace application code. These commands have been tested after installing i2c-tools package. Not all I2C buses can be used to interface with sensors. Check link to see which buses can be used.