37
ATZB-EVB-XXX-XXX User Manual
AVR-09-2011
management routines are responsible for gracefully shutting down all stack
components and saving system state when preparing to sleep and restoring system
state when waking up.
Hardware Abstraction Layer (HAL) includes a complete set of APIs for using on-
module hardware resources (EEPROM, app, sleep, and watchdog timers) as well as
the reference drivers for rapid design-in and smooth integration with a range of
external peripherals (IRQ, I2C, SPI, UART, 1-wire). Board Support Package (BSP)
includes a complete set of drivers for managing standard peripherals (sensors, UID
chip, sliders, and buttons) placed on a MeshBean development board.
8.2 Using AVR Programming Tools
It is recommended that Atmel’s AVR Studio [16] is to develop custom applications
based on BitCloud API. This multiplatform Integrated Development Environment (IDE)
provides the options for editing source code, compilation, linking object modules with
libraries, debugging, making executable file automatically, and more. See Section 4.3
for the IDE installation instructions. Refer to the AVR Studio User’s manual for further
instructions.
AVR Studio can be integrated with WinAVR – a suite of software development tools
for the Atmel AVR series of RISC microprocessors hosted on the Windows platform
[19]. WinAVR contains a set of utilities including AVR GCC compiler, linker, automatic
Makefile generator, system libraries, etc. GCC compiler is designed to be executed
on the Windows platform, and is configured to compile C or C++ codes. For
description of GCC compiler see WinAVR documentation. You can find command
options for compilation and linking specified in [20].
In AVR Studio, the development of an application is organized under particular
project. All the necessary information about a project is kept in project file. Such files
assigned to the AVR Studio have an
*.aps
extension, so they open in AVR Studio
automatically when double-clicked.
The easiest way to configure an AVR project is to use Makefile that is a plain text file
which name has no extension. Makefile specifies compilation and linking flags.
Makefile also specifies corresponding directories in order to include header files and
to link the system object libraries.
The required BitCloud software is located in ZDK Distribution CD in the “
BitCloud
”
structured subdirectory as presented in 10.7.
8.3 How to Build Minimum Application
For a quick start in programming, a user’s sample application is designed to show the
required application structure and coding conventions. This application (a local variety
of the traditional "Hello World" demo) implements permanent blinking of the ATZB-
EVB (MeshBean)’s LEDs, using the GPIO interface. The source code for minimum
application is given in 10.9 , along with the Makefile corresponding to the file structure
specified in 10.7. Both are located in the “
./Sample Applications/Blink/
“
subdirectory. The resulting image files are also delivered. You can rebuild them any
time as described below.
Open
blink.aps
file from the “
./Sample Applications/Blink/
“ subdirectory
and just execute
Build/Rebuild All
item from the main menu of AVR Studio.
The
blink.hex
and
blink.srec
image files will be generated. No *
.eep
image