Customizing ARTIK Linux Build
Having compiled, loaded, and played with the base version of your Linux build for verification, you have the option of customizing it to use your chosen configurations. Although you could manually edit the configuration files, we recommend you use the kconfig-frontends
tool to add and remove drivers and features.
From time to time, you may also need to install patches.
Configuration Overview
The system is highly configurable through Kconfig
files. Each file contains declarations for the required configuration variables and provides configuration options. Main Kconfig file entries point to Kconfig files in subdirectories, giving a sub-menu of choices related to the main entry option.
Installing Kconfig Tools
You'll need to do a quick tool installation on your Linux development PC.
-
Open a bash terminal window.
-
Change to your working directory, such as
cd ~/ARTIK710s
-
Install the
Kconfig-frontend
tool for menu configuration.
git clone https://bitbucket.org/nuttx/tools.git tools
cd tools/kconfig-frontends
./configure --enable-mconf --disable-gconf --prefix=/usr
make
sudo make install
We chose the mconf
frontend, giving you the menu style seen in the example image we show.
Adding/Removing/Configuring Modules
Using the Kconfig tool is fairly intuitive once you get familiar with it. The best way to do so is to open up the tool and view the selections.
There are two configurable entities:
u-boot-artik
– the U-Boot codelinux-artik
– the Linux kernel
cd
into the directory you want to configure, then issue the make menuconfig
command to use the tool. You will need to specify your CPU architecture on the command line as shown in the instructions.
Example: Add PPP Module
The point-to-point protocol (PPP) is used to establish a communications connection between two nodes. The Cellular Modem project requires that this driver module be built into the Linux kernel, so it provides a good example of using the Kconfig tool to enable PPP in the kernel.
-
Start Kconfig to configure the Linux kernel.
cd linux-artik
make ARCH=arm artik530_raptor_defconfig
make ARCH=arm menuconfig
cd linux-artik
make ARCH=arm64 artik710_raptor_defconfig
make ARCH=arm64 menuconfig
-
Within the menu, use the down arrow to arrive at the selections noted.
-
Go to
D
evice Drivers --->
and hit Enter to select. -
Go to
[*] Ne
twork device support --->
and hit Enter. -
Go to
< >P
PP (point-to-point protocol) support
and hit Space to select (so it shows< M >
). -
Enabling PPP displays the following options. Select all of them, one at a time, using the space bar. Verify that your selections match the image below.
- Use the right arrow to select `Save` (Enter), then use the arrow keys (or hit the ESC key twice) to exit each menu until you are out of `Kconfig`.
-
Go to
-
Make each module.
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- Image -j4
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- dtbs -j4
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- modules -j4
make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- Image -j4
make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- dtbs -j4
make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- modules -j4
-
Save your configuration file.
make ARCH=arm savedefconfig
mv defconfig arch/arm/configs/artik530_raptor_defconfig
make ARCH=arm64 savedefconfig
mv defconfig arch/arm64/configs/artik710_raptor_defconfig
-
Build the complete image, or just the kernel.
cd ../build-artik
./release.sh ...
(use your usual command line here)
-- OR --
./build_kernel.sh -b artikXXXs_ubuntu
(replace XXX with 530, 710) - To move the updated modules, follow the directions in Updating Device Firmware.
-
On the first boot, type
modprobe ppp_generic
to load the new driver module.
Example: Add GSM modem support
Using menuconfig, you can also enable GSM modem support over USB. Refer to the Cellular Modem project for an example.
Follow the same procedure as in the previous example (step 2). This time, under:
Device Drivers ---> USB support ---> USB Serial Converter support --->
choose
< > USB driver for GSM and CDMA modems
by pressing the M key so that it will 'make' as a module.
On your first boot after loading the new images, run
modprobe option
to include the new module.
Updating Device Firmware
To incorporate the updated modules on your ARTIK device, you have multiple choices.
-
Transfer them using
scp
: follow the GitHub procedure for your OS branch and module.
https://github.com/SamsungARTIK/linux-artik/tree/A530s_os_3.0.0
To copymodules.img
replaceusr/
with thebuild-artik/output/images/ARTIKxxxx/UNRELEASED/{date}
directory. -
Burn the complete sdfuse image the usual way, using a microSD card.
-
Use the dfu-util (Device Firmware Update) utility available under Linux.
Patches
Patch files are supplied to enable specific configuration features. They are simple to install.
-
Set up and clean your build environment as always, using the base code revision specified for use with your patch.
-
Go to the
linux-artik
directory within the environment. -
Save your patch file, such as
patchfile.patch
, to this location. -
Run
patch < patchfile.patch
to apply each patch. -
Compile and load the image as always.
Click here for an example of why you would use patch code.