I’d like to make my own arm board. However, I dont’ know what the programming interface is for an ARM. Are there any good tutorial websites or how-to’s out there?
Thanks!
I’d like to make my own arm board. However, I dont’ know what the programming interface is for an ARM. Are there any good tutorial websites or how-to’s out there?
Thanks!
Hi Weinerschizel.
I wrote a 200 page tutorial, “Using Open Source Tools for AT91SAM7 Cross Development”, on how to download and use Eclipse and YAGARTO to develop ARM software and it is hosted on the Atmel web site located here:
http://www.atmel.com/dyn/resources/prod … source.zip
Since I wrote the above Atmel tutorial, there have been improvements in Eclipse and OpenOCD, so I wrote a tutorial on “Atmel Serial Communications” which is hosted on the Spark Fun Electronics web site. This tutorial has an appendix that shows the minor changes to defining a project and some additional path issues you should be aware of. You can download that tutorial from here:
http://www.sparkfun.com/datasheets/DevT … ations.pdf
Sparkfun also hosts other tutorials I have authored on Nokia LCD displays and debugging locked-out Atmel ARM boards.
The Atmel tutorial is almost like a book (200 pages) and should give you some good ideas on how to start.
Cheers,
Jim Lynch
Hello Weinerchizel,
Along with the great tutorials by Jim Lynch, there is a SparkFun tutorial called “LPC2148 USB Bootloader Tutorial.” This tutorial goes over the basics of how to set up a programming environment; it might be a good place to start.
-Ryan
So you basically wire these things up to a USB port and they act as a flash drive? Then you load the code… That’s what I’m getting out of the spark fun tutorial. Seems really slick if that’s the case.
Lynch, you’re book is still printing out I’m most likely going to setup a Eclipse Environment and hopefully load RT Linux. Is that possible to do when running in Windows? I know you can use eclipse but not sure how to compile RT-Linux in windows.
Thanks!
So you basically wire these things up to a USB port and they act as a flash drive?
Thats only if the device is preloaded with the sparkfun USB bootloader.
Cheers,
–David Carne
I designed a simple board for the LPC2106 a few years ago:
http://www.geocities.com/leon_heller/lpc2104.html
I’ve included details of the JTAG interface which is usually used for programming and debugging. I built my own JTAG unit, which worked very well with the Rowley CrossWorks tools.
Leon
"The Insider's Guide To The NXP (formerly Philips) ARM7-Based Microcontrollers (LPC21xx)":weinerschizel:
Are there any good tutorial websites or how-to’s out there?
Do you guys know… does the LPC2138 ARM7 sold on the site come with a bootloader already installed for loading code over the serial interface?
http://www.sparkfun.com/commerce/produc … cts_id=520
Thanks!
All the LPC chips have bootloader code, you need to read the docs to see how to use it. You hold P0.14 low when resetting, IIRC.
You ought to include a JTAG connector as well, of course.
Leon
Most(all?) NXP chips have a serial bootloader which you can drive with the little programmer available on sparkfun and their Flash Utility.
Atmel’s have a similar yet slightly different bootloader.
The SFE USB Bootloader requires installation and a different linker setup for applications.
You can also use an ARM JTAG header (standard 2x10 pinout) and a JTAG adapter. Burning flash is hit or miss depending on your tool, though you will always be able to read and write RAM. The Olimex USB JTAG and OpenOCD is able to work well with NXP, ST, and Atmel chips. Segger has a non-commercial use version of their USB JTAG available, which can flash many parts (and its around 1/10th the cost of the commercial version even though functionality is the same :)).
Jim:
I’m following your tutorial verbatim. Have everything installed and have read to page 115 where we build the tutorial I downloaded from the Atmel website.
I get errors but cannot seem to figure them out. All .c files compile properly but nothing links it just says:
ERROR: libc.a(atol.o) uses hardware FP, whereas main.out uses software FP demo_at91sam7_p64_blink_flash 0 C/C++ Problem
for each code module. I’m not sure how to track this down.
Thanks!
That means the compiler libraries (and libc) were compiled without -msoft-float (or there was no multilib for soft floating enabled).
so how do I resolve an issue like that? Do I have to download a new compiler? If so where do I get it?
Thanks!
Which compiler build are you using? What options are you using in your Makefile?
I’ve used WinARM and CodeSourcery’s toolchains on Windows, though I build one from scratch on Linux.
I’m using Jim’s example. I downloaded it from atmel’s forum. And also using his tutorial.
I do everything verbatum just as the tutorial says. Then I get the compiler issue. Honestly I don’t know a whole lot about makefiles. I believe eclipse comes with the GNU compiler but I’m not sure how to tell which switches are turned on in the compile. I’ll have to read into them a little more.
Attached below is a copy of the make file.
# ***************************************************************
# * Makefile for Atmel AT91SAM7S256 - flash execution *
# * *
# * *
# * James P Lynch May 12, 2007 *
# ***************************************************************
NAME = demo_at91sam7_blink_flash
# variables
CC = arm-elf-gcc
LD = arm-elf-ld -v
AR = arm-elf-ar
AS = arm-elf-as
CP = arm-elf-objcopy
OD = arm-elf-objdump
CFLAGS = -I./ -c -fno-common -O0 -g
AFLAGS = -ahls -mapcs-32 -o crt.o
LFLAGS = -Map main.map -Tdemo_at91sam7_blink_flash.cmd
CPFLAGS = --output-target=binary
ODFLAGS = -x --syms
OBJECTS = crt.o main.o timerisr.o timersetup.o isrsupport.o lowlevelinit.o blinker.o
# make target called by Eclipse (Project -> Clean ...)
clean:
-rm $(OBJECTS) crt.lst main.lst main.out main.bin main.hex main.map main.dmp
#make target called by Eclipse (Project -> Build Project)
all: main.out
@ echo "...copying"
$(CP) $(CPFLAGS) main.out main.bin
$(OD) $(ODFLAGS) main.out > main.dmp
main.out: $(OBJECTS) demo_at91sam7_blink_flash.cmd
@ echo "..linking"
$(LD) $(LFLAGS) -o main.out $(OBJECTS) libc.a libm.a libgcc.a
crt.o: crt.s
@ echo ".assembling"
$(AS) $(AFLAGS) crt.s > crt.lst
main.o: main.c
@ echo ".compiling"
$(CC) $(CFLAGS) main.c
timerisr.o: timerisr.c
@ echo ".compiling"
$(CC) $(CFLAGS) timerisr.c
lowlevelinit.o: lowlevelinit.c
@ echo ".compiling"
$(CC) $(CFLAGS) lowlevelinit.c
timersetup.o: timersetup.c
@ echo ".compiling"
$(CC) $(CFLAGS) timersetup.c
isrsupport.o: isrsupport.c
@ echo ".compiling"
$(CC) $(CFLAGS) isrsupport.c
blinker.o: blinker.c
@ echo ".compiling"
$(CC) $(CFLAGS) blinker.c
# **********************************************************************************************
# FLASH PROGRAMMING
#
# Alternate make target for flash programming only
#
# You must create a special Eclipse make target (program) to run this part of the makefile
# (Project -> Create Make Target... then set the Target Name and Make Target to "program")
#
# OpenOCD is run in "batch" mode with a special configuration file and a script file containing
# the flash commands. When flash programming completes, OpenOCD terminates.
#
# Note that the script file of flash commands (script.ocd) is part of the project
#
# Programmers: Martin Thomas, Joseph M Dupre, James P Lynch
# **********************************************************************************************
# specify output filename here (must be *.bin file)
TARGET = main.bin
# specify the directory where openocd executable and configuration files reside
OPENOCD_DIR = 'c:/Program Files/openocd-2007re141/bin/'
# specify OpenOCD executable (pp is for the wiggler, ftd2xx is for the USB debuggers)
#OPENOCD = $(OPENOCD_DIR)openocd-pp.exe
OPENOCD = $(OPENOCD_DIR)openocd-ftd2xx.exe
# specify OpenOCD configuration file (pick the one for your device)
#OPENOCD_CFG = $(OPENOCD_DIR)at91sam7s256-wiggler-flash-program.cfg
#OPENOCD_CFG = $(OPENOCD_DIR)at91sam7s256-jtagkey-flash-program.cfg
OPENOCD_CFG = $(OPENOCD_DIR)at91sam7s256-armusbocd-flash-program.cfg
# program the AT91SAM7S256 internal flash memory
program: $(TARGET)
@echo "Flash Programming with OpenOCD..." # display a message on the console
$(OPENOCD) -f $(OPENOCD_CFG) # program the onchip FLASH here
@echo "Flash Programming Finished." # display a message on the console
[/code]