Download presentation
Presentation is loading. Please wait.
1
EENG449b/Savvides Lec 9.1 2/10/04 February 9, 2004 Prof. Andreas Savvides Spring 2004 http://www.eng.yale.edu/courses/eeng449bG EENG 449bG/CPSC 439bG Computer Systems Lecture 9 Embedded Processor Programming II
2
EENG449b/Savvides Lec 9.2 2/10/04 Announcements You should all have all the hardware/software you need by now Midterm 1 next Thursday, Feb 19, 2004 Pick up, homework solutions from TA’s office at the end of class.
3
EENG449b/Savvides Lec 9.3 2/10/04 Overview This lecture provides an overview into the tools and code that you need for your projects –Running the GNU tools –Application Development Cycle –Sample code overview –Some debugging hints Examples based on the PIO demo program posted on the course website Board setup in the lab –Compile and run the sample code
4
EENG449b/Savvides Lec 9.4 2/10/04 Installing the GNU Tools To use the GNU tools on a Windows machine you need to use Cygwin –Cygwin already installed on the CO40 machines in the lab Precompiled GNU tool chain available at –http://www.eng.yale.edu/enalab/enalabonlyhttp://www.eng.yale.edu/enalab/enalabonly Unpack the tar file –gunzip gnutools_windows.tar.gz –tar –xvf gnutools_windows.tar Adding the the tools to your path –Modify the PATH environment variable in windows to point to the armgnutools/bin directory –In cygwin this is: »PATH= armgnutools/bin:$PATH
5
EENG449b/Savvides Lec 9.5 2/10/04 A Sample Makefile CFLAGS = -Wall -g -nostartfiles -mthumb-interwork -marm INCLUDE = -Iinc/ -Isrc/ OBJS = define.o common.o init.o irq.o pio_sample.o reentrant_irq.o LDFLAGS = -Wl,-Tarm.ld all: PIO.elf PIO.elf: $(OBJS) arm-elf-gcc $(CFLAGS) $(LDFLAGS) $(OBJS) $(LIBS) -o PIO.elf %.o: inc/%.s arm-elf-gcc -c $(INCLUDE) $(CFLAGS) $< %.o: src/%.c arm-elf-gcc -c $(INCLUDE) $(CFLAGS) $< %.o: src/%.s arm-elf-gcc -c $(INCLUDE) $(CFLAGS) $< %.bin: % arm-elf-objcopy -O binary $<.elf $@ clean: rm -f *.o PIO.elf PIO.hex hex: arm-elf-objcopy -I elf32-little -O ihex PIO.elf PIO.hex
6
EENG449b/Savvides Lec 9.6 2/10/04 Application Development Cycle Code Development Compile & Link Upload Code to Chip Run/Debug Linker determines Memory mapping (see arm.ld) File output format Can be elf, bin, hex.elf for JTAG Or.hex for serial port
7
EENG449b/Savvides Lec 9.7 2/10/04 Compiling your code To compile the code you simple run the makefile $ make The default output is a.elf file –You can use this with Nohau Seehau debugger BUT cannot be used with the OKI programming utility –To use the programming utilit you need to convert your file to intel hex format. »arm-elf-objcopy -I elf32-little -O ihex PIO.elf PIO.hex »Or type make hex in the sample Makefile
8
EENG449b/Savvides Lec 9.8 2/10/04 Running your code on the OKI CPU board JTAG Interface (Seehau &.elf file) Serial port OKI Program utility &.hex file 5V Power Supply
9
EENG449b/Savvides Lec 9.9 2/10/04 Demo Example Using the JTAG Interface Hardware you need: –OKI L67Q4004 CPU board –Serial Cable –5V power supply –Optional: Seehau JTAG pod – only 2 available so you will need special arrangement to use this Software you need –Sample code for OKI in GNU –Programming utility from OKI –Optional: Seehau debugger
10
EENG449b/Savvides Lec 9.10 2/10/04 Demo Example Using the OKI Downloader Utility Need to use tera term program terminal program Need the !ZERO.dat file posted on the website Manual for board available at http://www.eng.yale.edu/enalab/enalabonly/OKI/oki_boar d_manual.doc
11
EENG449b/Savvides Lec 9.11 2/10/04 Debugging w/o a JTAG? Use the LEDs Send debug messages through the UART –Need to include UART functions in your code
12
EENG449b/Savvides Lec 9.12 2/10/04 An Example Program for the OKI ARM PIO Program Posted on the website: Files in the inc directory: common.h - definitions specific to the board define.s - assembler common definitions – don’t need to change this irq.h - header files for interrupt functions – no change ml674000.h – include file for the OKI chip that lists the locations of registers – may need to change this for the 674Q4003 device
13
EENG449b/Savvides Lec 9.13 2/10/04 An Example Program for the OKI ARM PIO Program Posted on the website: init.s - chip initialization file. This initializes the exception table and interrupt handling mechanism – don’t need to change this reentrant_irq.s – interrupt handling mechanisms – don’t need to change this Files in the src directory: pio_sample.c - this is where the main() function. It is the entry point for any application. Pay attention to the initializations !!!
14
EENG449b/Savvides Lec 9.14 2/10/04 UART Example Read Chapter 18 of the OKI processor data sheet
15
EENG449b/Savvides Lec 9.15 2/10/04 Move to the lab….
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.