Skip to content

sam9n12ek

Tony Cho edited this page Mar 4, 2015 · 4 revisions

WikiQuick Start GuideLinux SAM9N12-EK Board

Introduction

This page provides how to integrate the ATWILC3000 into the SAM9N12-EK board. Visit the following sites for more information.

Download Buildroot-at91

  • Download the buildroot-at91.

git clone https://github.com/linux4sam/buildroot-at91.git

  • Then, checkout the buildroot-2013.11-at91.
cd buildroot-at91
git checkout origin/buildroot-2013.11-at91 -b buildroot-2013.11-at91

Build

  • Configure the buildroot
    • Copy at91sam9_defconfig to configs/
    • at91sam9_defconfig is here in the sam9n12 patch
    • make at91sam9_defconfig
  • Then, build by issuing the following: make

Linux kernel

The Linux kernel is downloaded while building the buildroot. For example, the Linux kernel source is located in the /output/build/linux-${SHA}. The following section describes how to port Atmel wireless drivers in the Linux Kernel.

Patch the kernel with Atmel 802.11 drivers

  • Patch wilc3000 driver source to Linux kernel source. The directory tree of the patch file is the same as Linux source. Just overwrite files.
  • The wilc3000 kernel patch files are here in the sam9n12 patch
  • FYI, The latest wireless driver is here in ATWILC3000 driver. (Refer to the Release Note )

Firmware

  • Copy wilc3000 firmware files to BuildRoot target file system, output/target/lib/firmware/. If there is no directory named firmware so just make it.
  • The location of firmware is here in the patch
  • FYI, The latest firmware files are here in ATWILC3000 firmware. (Refer to the Release Note )

Build

  • Remove the followings before making new kernel image.
buildroot/output/build/linux-${SHA}/.stamp_configured
buildroot/output/build/linux-${SHA}/.stamp_built
buildroot/output/build/linux-${SHA}/.stamp_images_installed
buildroot/output/build/linux-${SHA}/.stamp_target_installed
  • Go to the root directory of buildroot-at91 and issue the following again: make

Then, the outputs necessary to flash the board are generated like the followings.

output/images/uImage
output/images/rootfs.ubi 

Flash

The SAM-BA tool is required to download images into the SAM boards. Download and install SAM-BA in Window or Linux machine.

Download the prebuilt image for SAM9N12-EK. We will use linux console demo package so download linux4sam-buildroot-at91sam9n12ek.zip.

Then, modify the at91sam9n12ek_console_linux_serialflash.tcl file like the followings.

  • Replace set kernelFile "uImage-2.6.39-m2-at91sam9n12ek.bin" by set kernelFile "uImage".
  • Replace set rootfsFile "buildroot_2011.05-at91_9n12_m2.ubi" by set rootfsFile "rootfs.ubi".

Now, it's time to change the boot mode for flashing new images. Press down PB1 and then power up the board; then release PB1. Then, the boards go to boot mode to flash the prebuilt image. Run the batch file, at91sam9n12ek_console_linux_serialflash.bat in Windows.

For detailed information on flashing images visit here.

For more information, visit the AT91 Linux4sam. It's also helpful to visit the AT91 SAM community.

Running wireless drivers

Issue the following command to insert the wilc3000.ko.

insmod /lib/modules/2.6.39/kernel/drivers/net/wireless/atmel/wilc3000/wilc3000.ko.

Then, refer to the followings for simple demo:

In case of SAM9N12 with Kernel 2.6.39, please use wext driver instead of nl80211.

wpa_supplicant -B -iwlan0 -Dwext -c/etc/wpa_supplicant.conf