1.5.1. Simple tests

These demonstration programs are typically the first images you might run on a new target. The following simple tests demonstrate and verify a specific functionality:

hello.c

This program outputs data to the serial port.

io.c

This program takes data input on the serial port and echoes it on the output.

led.c

This program flashes the LEDs in a binary pattern. It requires no additional functionality (such as serial ports) to be working in order to run.

Note

The semihosted version prints out a banner and description on the debugger console, because this functionality is known to be available in semihosted mode.

heap.c

This program allocates and then frees some memory.

simple-caches.c

This program gives an example of simple cache (Data and Instruction) usage that:

  • reads the cache and MMU state

  • resets the cache and MMU

  • turns caches and MMU on and off

  • restores the original state.

system-timer.c

This program combines serial output, LED flashing, timers, and interrupts. This program uses most of the features of µHAL and is a good indicator that a target is functional.

file-io.c

A file I/O program. It performs file functions on the host and returns the size of a specified file.

Note

This program is only useful when built semihosted and linked with the ADS C Library.

exception.c

This program shows how the ADS C Library handles a divide-by-zero exception.

Note

The compiler displays a warning when building this program.

Copyright © 2000-2002 ARM Limited. All rights reserved.ARM DUI 0136D
Non-Confidential