Getting Started with KeyASIC IoT Development Kit

SPG101 is KeyASIC’s state-of-the-art System-On-Chip (SoC), with ARM926EJS core and the ability to run Linux Kernel as well as RTOS. The SoC integrated many peripherals and interfaces in typical embedded systems, contains built-in memory, and have option to add external memory via SD bus, and add external I/O device via SDIO bus.

 

KeyASIC's Kcard and Mcard is a SD memory card with built-in wireless LAN and web server, which allow user to access the SD card wirelessly. Where, KeyASIC's Kdrive and Mdrive is an USB drive with built-in wireless LAN and web server, which allow user to access the USB drive wirelessly. Both products have SPG101 SoC contained inside. This is one of the examples of SPG101 hardware and software revolutionized legacy product for better; in this case extending the function of a legacy and make them more intelligent.

Hardware

KeyASIC IoT development kit offers a quick approach to develop custom ARM processor-based application. The development kit is built around KeyASIC proprietary SPG101 SoC, and includes multiples components and wide range of interfaces.

Components and Features

●     8MBytes SPI NOR Flash

●     32MBytes SDRAM

●     SD slave interface to SD host device

●     SD slot to add external SD memory up to 32Mbytes

●     Atheros AR6005 Wi-Fi chip

●     SDIO slot to add external SDIO module 
        (as alternatives to on-board Wi-Fi chip)

●     16 GPIO pins

●     UART interface

●     SPI interface

●     I2C interface

●     JTAG interface for programming and debugging

●     External 5V DC power input (as alternatives to power from SD host device)

●     5V power switch

●     SoC reset button

Development Kit Form Factor
IoT Development Kit
Image

Software

The SPG101 Software Development Kit (SDK) is a Linux-oriented software development kit that enables quick and easy application development on KeyASIC SPG101 SoC platform. The SDK provides full cross-compile development for the Linux host, including Board Support Package (BSP) with Linux Kernel and file system, scripts and Makefile, documentation and example applications. The SDK is tested and ready to use within a predefined configuration for SPG101 platform. The default configuration can be further customized to support different applications and functions.

SDK Architecture

SPG101 SDK Features:

•     Linux Kernel 2.6.32 and device drivers
•     Makefile build system
•     ARM Toolchain (compilers, linkers, etc.)
•     Bootloader (KA Boot Loader, U-Boot)
•     Linux Root Filesystem
•     Busybox 1.18.5
•     Precompiled Binaries and Tools (programming tool, etc.)
•     Libraries and middleware

 

Boot Loader

The SDK includes the binary codes of 2 boot loaders, the proprietary KA Boot Loader and the widely-used open source U-Boot.


Linux Kernel

The SDK is based upon the standard Linux kernel from www.kernel.org with patches and customizations for SPG101 SoC and system. The device drivers for all supported bus interfaces are added to the kernel.

 

Linux Filesystem

The SDK includes a standard root file system, that contains user space Linux components such as applications, initialization scripts, common UNIX utilities, etc. The UNIX utilities are provided by Busybox.


Toolchain

The SDK uses the GNU toolchain to cross-compile embedded software for ARM platform. The Linux Kernel is cross-compiled with Mentor’s Sourcery ARM toolchain version 2011.03, while Linux Filesystem is cross-compiled with a customized version of uClibc toolchain.

Image

Firmware

The standard SPG101 SDK contains following fundamental components:

•     Bootloader – KA Boot Loader, U-Boot, U-Boot2

•     Linux Kernel

•     Linux Filesystem with applications

•     MTD – NOR flash filesystem

•     Makefile

Firmware Components

Bootloader

SPG101 system runs two bootloaders before Linux kernel is booted. Both bootloaders will get auto-loaded from on-SIP NOR flash to the SDRAM after power-on-reset (POR). KA Boot Loader is the first block of code automatically run after SPG101 power up. KA Boot Loader has similar functions as ROM code in other embedded devices. Its main function is to setup stack, configure system clock, and check presence of next bootloader in SDRAM (U-Boot). U-Boot, or "Universal bootloader", is an open-source (GPL licensed) bootloader and one of the most widely used bootloader in embedded systems. U-Boot is the main bootloader in SPG101 platform. Its main function is to perform firmware upgrades and as bootloader for our Linux Kernel. SPG101 U-Boot 2010.06-rc1 binary is released with the SPG101 SDK.

 

 

Linux Kernel

Linux Kernel consists of system-specific configurations, and SPG101 SDK added predefined configurations to allow developers to customize the firmware in SPG101 platform. Developers can customize the kernel load address, system clock frequency, kernel modules or device drivers to load, etc. Linux Kernel accepts boot time parameters as it starts to boot system. In SPG101 SDK, boot parameters are passed when building the Kernel. The boot parameters are specified as CONFIG_CMDLINE, at Kernel configuration menu “Boot Options ---> Default kernel command string”.

 

 

Kernel Driver

By default, majority of the device drivers for SPG101 peripherals and controllers are integrated into kernel image as built-in modules. The built-in modules are statically compiled into the kernel and are always loaded in the kernel upon boot-up. The built-in modules are automatically compiled and integrated into Kernel image when you build Kernel with make command. Few device drivers in the SPG101 SDK are built as loadable kernel modules (LKM), for example the SDIO driver.

 

 

LINUX Filesystem

SPG101 SDK uses Busybox-1.18.5 to implement the root filesystem command utilities. You can easily add or remove commands/features at compile time. By including only the components you need, you can keep binary size to minimum. SPG101 platform loads initramfs as root filesystem at early stage of kernel. Initramfs provides an early user space for kernel and gives user more control over boot process. On SPG101, the initiramfs is supplied as an external file, in cpio.gz archive format. SPG101 firmware also has a built-in web server that implements the HTTP protocol. The embedded web server, BOA 0.94.14rc21, allows HTTP clients to communicate, get status or control SPG101 using HTTP protocol. Web browser can send HTTP requests to SPG101 after establish connection with SPG101 wireless LAN.

 

 

MTD

In SPG101, MTD is the main memory translation layer that interfaces our Linux kernel with built-in 8MB NOR flash. File system used is JFFS2. MTD subsystem provides an abstraction layers for raw flash devices, between hardware specific device drivers and higher level applications. It makes it possible to use the same API when working with different flash types and technologies, e.g. NAND, NOR, CFI, OneNAND, etc.

 

 

Makefile

The prototypical build file for Make is called Makefile, which contains all the targets and rules for a project. Makefile directs make on how to compile and link a program. SPG101 SDK uses Makefile to organize code compilation and reduce build time. The main Makefile is at root directory of SDK package.

 

Image

Application Programming Interface (API)

SPG101 SDK comes with a rich APIs and interfaces by default. New API can be added to the SDK for new functions or features. SPG101 SDK provides a set of sample HTTP API to allow user or application to access and configure SPG101 platform over wireless network. 

 

The PWM controller in SPG101 can be used to control the piezo buzzer. On SPG101 platform with buzzer connected to PWM, the SDK provides an interface to play tunes with the buzzer. The I/O Control for PWM takes a 32-bit argument. For queueing a tune, set the frequency, volume and duration in following format and pass as argument to PWM_PLAY or PWM_REPEATPLAY IOCTL.

 

The clock speed for the SPG101 platform can be dynamically changed during run-time via the /proc/ka2000_sleep interface. The standard Linux GPIOLIB interface is used to control GPIO in SPG101 system. The control can be accessed from /sysfs virtual filesystem in Linux running on SPG101. Each GPIO in SPG101 is assigned to a unique integer GPIO number (0 – 15).

Support

We welcome any technical questions about SPG101 Development Kit. Our technical support team based in Malaysia is available to help and advise on product solutions. From product set up to problem solving and trouble shooting. 

 

For businees partnership inquiries, please contact us on the contact form.