# Cross compiling a specific module for BBB



## j4ck (Oct 23, 2016)

How can I cross compile a specific driver for BeagleBone Black (BBB). e.g. /usr/src/sys/modules/usb/smsc/? I tried `make TARGET_ARCH=armv6` but I found out that this is not correct.

Am I missing something?


----------



## SirDice (Oct 24, 2016)

This might help: https://wiki.freebsd.org/FreeBSD/arm/crossbuild


----------



## Phishfry (Nov 3, 2016)

OK first add to the /usr/src/sys/arm/conf/BEAGLEBONE kernconf file:

```
device smsc
```
Note: smsc is not the name of the device. The name of the driver .c- file is the device name.

Then edit /usr/src/sys/boot/fdt/dts/arm/beaglebone-black.dts and add a section for your device. Run dtc(1) to check that it compiles.

Then for actually compiling an image the quick way is to download crochet and simply run ./crochet.sh -b Beaglebone
`git clone https://github.com/freebsd/crochet /crochet`


----------

