Main Page | Modules | Related Pages | Examples

Installation, Development Environment, Tools

Note:
We describe the development environment for linux and possibly other unices here. It is also possible to use cygwin for win32.
The development consists of 3 main steps:
  1. write your code, compile and link
  2. convert resulting object yourapp.elf into yourapp.trb - Turbo application object format
  3. upload yourapp.trb with the prog_apps utility.

devel.png

Tools

For development and building of Turbo applications you need the following tools:

  1. gcc - GNU project C compiler configured for AVR architecture
  2. binutils - GNU project set of utilities for linking and object code manipulation configured for AVR architecture; application specific format --turbo support patch by BLADOX
  3. turbo-devel - package containing Turbo Adapter specific libc and headers
  4. turbo-prog-utils - package containing Turbo Programmer headers and linker scripts

Where to get all this stuff?

As for gcc you can use the vanilla gcc from any GNU mirror, binutils have to be patched to provide turbo specific binary application format.

The binutils and turbo-devel packages can be found on http://www.bladox.com/.

Installation

Binutils

Untar and
./configure --target=avr
make
make install
installs all the AVR binutils into /usr/local/.

GCC

Untar and
./configure --target=avr --enable-languages=c
make
make install
installs all the AVR gcc into /usr/local/.

Turbo-devel

Untar the package somewhere (and use this path in Makefiles).

Turbo-prog-utils

Untar the package somewhere (and use this path in Makefiles).

Notes on Makefile

Example of Makefile
ifndef TPROG_DIR
TPROG_DIR = ../../../
endif

ifndef TURBO_DIR
TURBO_DIR := ../../../../../turbo-devel
endif

TURBO_TAG = #--turbo-manifest "Version: 2.0.0 Vendor: BLADOX"  #--turbo-verbose
INCDIR	= -I$(TPROG_DIR)/include -I.
LIBDIR = $(TURBO_DIR)/lib

CC = avr-gcc
LD = avr-ld
RM = rm -f

TRG = YOUR_TARGETNAME
SRC = YOUR_SOURCE1.c YOUR_SOURCE2.c ... YOUR_SOURCEn.c

LIB = 

CFLAGS	= -std=gnu99 -mmcu=atmega128 -mno-tablejump -Wimplicit-function-declaration -Os -fno-builtin
LDFLAGS = -L$(LIBDIR) -T $(TPROG_DIR)/lib/turbo.lds -d -r --emit-relocs -R $(TPROG_DIR)/lib/public_calls $(LIB) -lm -lc `avr-gcc -print-libgcc-file-name`

OBJ = $(SRC:.c=.o)
  
all:	$(TRG).trb

include $(SRC:.c=.d)

%.o : %.c 
	$(CC) -c $(CFLAGS) $(INCDIR) $< -o $@

%.d: %.c
	$(CC) -M $(CFLAGS) $(INCDIR) $< | sed 's/$*.o/& $@/g' >$@

$(TRG).elf: $(OBJ)
	$(LD) -o $@ $(OBJ) $(LDFLAGS)

$(TRG).trb: $(TRG).elf
	avr-objdump $(TURBO_TAG) --turbo $(TRG).elf

dis: $(TRG).elf
	avr-objdump -D --architecture=avr:5  $(TRG).elf >$(TRG).dis

indent:
	for X in $(SRC); do \
		indent -npsl -sob -bad -bli0 -cli2 $$X; \
		done

install: all
	cp $(TRG).trb ../../../modules

clean:
	$(RM) *.o
	$(RM) *.d
	$(RM) *~
	$(RM) $(TRG).dis
	$(RM) $(TRG).elf
	$(RM) $(TRG).trb


Meaning of CFLAGS:

Meaning of LDFLAGS:

trb and elf are created, dis when "make dis"

Uploading application file to Turbo Programmer

Assume that you have built your application and the result is helloworld.trb file. To upload the object use the prog_apps utility.

prog_apps -u helloworld.trb


Copyright © 2004 BLADOX
Turbo Programmer version 2.0