Newbie ARM question(s)

Hi all,

Well, I just changed from my PIC development, to ARM development, and I’m running into some issues…

My setup:

#1. ARM-USB-OCD

#2. Olimex AT91SAM7S256 proto board (2 buttons, MMC, 2 serial etc)

#3. I have the ARM-USB-OCD set for 5v

#4. I have plugged in the ribbon cable to the proto board, and the +5 also. The RED LED comes on

I installed the GCC-ARM for dummies toolchain that came with the programmer.

I’ve installed all the drivers (?) and had no issues

When I run Eclipse, and use the “RUN–>External–>OpenOCD” I get a GOOD message (I think!):

Info: openocd.c:82 main(): Open On-Chip Debugger (2006-10-12 18:00 CEST)

Now the strange part, when I issue the “Make” command, to create a new file, I get this error

ld: cannot open output file main.out: Permission denied lpc2148 line 0 1169137077750 417

When I goto the directory, I cannot copy, delete or modify the files. I’ve checked their permissions, and nothing there…Looks like a “chmod” issue.

Any Thoughts?

~ALSO~

:smiley: :smiley: :smiley:

The Proto board comes with a 18mhz chrystal/osc, I understand that the ARM can go 60, any recommended chrystal/osc I can use to replace?

Any help would be greatly appriciated!

~Kam (^8*

KamPutty:
The Proto board comes with a 18mhz chrystal/osc, I understand that the ARM can go 60, any recommended chrystal/osc I can use to replace?

Any help would be greatly appriciated!

~Kam (^8*

Can't answer your other questions - but this is an easy one. I highly, highly suggest reading over the datasheet a bit more. You're missing how the clock works on this part. The PLL is used to set your clock frequency. I expect the crystal is 18.432MHz, not just 18MHz. This frequency is needed for the SAM-BA functions to work properly, but you can still use the PLL to set your master frequency to anything within the functional range for the part.

You’re correct, the speed is indeed 18.432.

I will look into PLL.

At this time, I really don’t care about speed! I just need to make the LED blink so I have a development environment!

~Kam (^8*

Hi all,

I think I’m making progress! :shock:

I had to uninstall the “GNU for dummies” as the file permissions where jacked…beats me.

I’m now installing the latest Yagarto IDE and toolchain they provide.

I’m following the doc by James P. Lynch, v2

Everything has installed and done as the manual describes.

Question

I’m now trying to program my at91sam7s256 (it compiles just fine) and setup a “make target” as described. The issue is that the directories are setup for an older version then I have of.

This is what it uses

make -k program

Preparing OpenOCD script…

Flash Programming with OpenOCD…

'c:\Program Files<B>openocd-2006re93\bin'openocd-ftd2xx.exe -f 'c:\Program Files\openocd-2006re93\bin'at91sam7s256-armusbocd-flash-program.cfg

process_begin: CreateProcess(NULL, “c:\Program Files\openocd-2006re93\bin\openocd-ftd2xx.exe” -f “c:\Program Files\openocd-2006re93\bin\at91sam7s256-armusbocd-flash-program.cfg”, …) failed.

make (e=3): The system cannot find the path specified.

The directory used above of "c:\Program Files<B>openocd-2006re93\bin" should be

c:\Program Files<B>openocd-2006re115\bin\

How/where do I change this? I’ve looked for files etc…

~Kam (^8*

KamPutty:
Hi all,

I think I’m making progress! :shock:

I had to uninstall the “GNU for dummies” as the file permissions where jacked…beats me.

I’m now installing the latest Yagarto IDE and toolchain they provide.

I’m following the doc by James P. Lynch, v2

Everything has installed and done as the manual describes.

Question

I’m now trying to program my at91sam7s256 (it compiles just fine) and setup a “make target” as described. The issue is that the directories are setup for an older version then I have of.

This is what it uses

make -k program

Preparing OpenOCD script…

Flash Programming with OpenOCD…

'c:\Program Files<B>openocd-2006re93\bin'openocd-ftd2xx.exe -f 'c:\Program Files\openocd-2006re93\bin'at91sam7s256-armusbocd-flash-program.cfg

process_begin: CreateProcess(NULL, “c:\Program Files\openocd-2006re93\bin\openocd-ftd2xx.exe” -f “c:\Program Files\openocd-2006re93\bin\at91sam7s256-armusbocd-flash-program.cfg”, …) failed.

make (e=3): The system cannot find the path specified.

The directory used above of “c:\Program Files<B>openocd-2006re93\bin” should be

c:\Program Files<B>openocd-2006re115\bin\

How/where do I change this? I’ve looked for files etc…

~Kam (^8*

Hi KamPutty,

You’ll need to make some minor adjustments to the makefile that James P Lynch has provided in his code examples.

In the makefile scroll all the way down do the flash program part (It’s towards the end of the file).

Now do you see a variable named “OPENOCD_DIR”?

You need to set this variable to C:\Program Files\openocd-2006re115\bin \ instead of c:\Program Files\openocd-2006re93\bin\

Hope this helps

The problem is that I cannot locate the makefile!!!

Any idea where it is?!

~Kam (^8*

Okay,

I cheated (until I can get a better answer!), I just created the directory and copied all the files from the “new” to “old”.

I get further now…

make -k program

Preparing OpenOCD script…

Flash Programming with OpenOCD…

'c:\Program Files\openocd-2006re93\bin'openocd-ftd2xx.exe -f 'c:\Program Files\openocd-2006re93\bin'at91sam7s256-armusbocd-flash-program.cfg

Info: openocd.c:82 main(): Open On-Chip Debugger (2006-10-12 18:00 CEST)

Warning: arm7_9_common.c:683 arm7_9_assert_reset(): srst resets test logic, too

Info: target.c:219 target_init_handler(): executing reset script ‘c:\temp\temp.ocd’

Info: configuration.c:50 configuration_output_handler(): waiting for target halted…

Info: configuration.c:50 configuration_output_handler(): target halted

Info: configuration.c:50 configuration_output_handler(): core state: ARM

Error: at91sam7.c:257 at91sam7_wait_status_busy(): status register: 0x30005

Error: at91sam7.c:259 at91sam7_wait_status_busy(): Lock Error Bit Detected, Operation Abort

Info: configuration.c:50 configuration_output_handler(): failed writing file main.bin to flash bank 0 at offset 0x00000000

Info: configuration.c:50 configuration_output_handler(): flash program error

Warning: arm7_9_common.c:683 arm7_9_assert_reset(): srst resets test logic, too

Flash Programming Finished.

It still fails…lock bit…

Thoughts?!

All I want is to make the freaking LED toggle! BLA!

~Kam (^8* :?

You are not the first …

http://www.sparkfun.com/cgi-bin/phpbb/v … t=lock+bit

http://www.sparkfun.com/cgi-bin/phpbb/v … t=lock+bit

Regards,

Magnus

Thanks Magnus,

Well…nearly there…

so I issues the command

telnet localhost 4444 and got in. But still some strange results

example

If I enter “version”, I get

version

Open On-Chip Debugger (2006-10-12 18:00 CEST)

But, if I enter the flash command, I get this…

flash info 0

Command info not found

the commands I need to issue to release the bit do not run! command xxx not found!

Some work, some don’t!

Thoughts anyone?!

~Kam (^8*

Hi Kamputty.

If you check page 80 of the “Using Open Source Tools for AT91SAM7 Cross Development, Revision 2”, there’s a suggestion for adding two command lines to the “flash programming” target in the makefile that will clear the lock bits before attempting to program the flash.

Once you’ve done this, be sure to remove those two lines because the lock bits can only be changed 100 times.

Sorry about the path confusion. I attempted to call out in the tutorial every instance where the path specification may need editing if you are using a later revision of YAGARTO. In any case, it’s easy to forget one of these and have the system squawk at you.

Keep trying - you’re almost there!

Jim Lynch

Jim,

Thanks for the reply!

Where is the makefile located?! I cannot locate it :frowning:

~Kam (^8*

Hi again Kamputty.

Go to the Atmel support web site www.at91.com

Click on the button “Support” followed by “Application Notes”.

Scroll down to “Development Tools” and click on the CDROM symbol labeled “Using Open Source Tools for AT91SAM7 Cross Development (2 pages, revision B, updated 11/06)”

Click on “Save” and it will download to a directory of your choice on your hard drive. This is a high speed server and will only take a few seconds.

Unzip the file called atmel_tutorial_source.zip

There are four sample projects (each in a separate folder), six OpenOCD configuration files and the pdf version of the tutorial itself.

You will find that each project contains a make file with the rather simple name “makefile” with no extension.

I just downloaded it and checked and it’s all there.

Cheers,

Jim Lynch

Hi Lynch,

perhaps can you or another user help me by resolving the same problem, I have the same lock bit problem as “Kaputty”

"

Error: at91sam7.c:257 at91sam7_wait_status_busy(): status register: 0x30005
Error: at91sam7.c:259 at91sam7_wait_status_busy(): Lock Error Bit Detected, Operation Abort 
"

than I have exactly do the following

If you check page 80 of the “Using Open Source Tools for AT91SAM7 Cross Development, Revision 2”, there’s a suggestion for adding two command lines to the “flash programming” target in the makefile that will clear the lock bits before attempting to program the flash.

but when I try again to program my at91sam7s256 and setup a “make target” as described, this is what is uses

make -k program 
Preparing OpenOCD script...
Flash Programming with OpenOCD...
'C:\GCCFD\openocd\bin\'openocd-ftd2xx.exe -f 'C:\GCCFD\openocd\bin\'at91sam7s256-armusbocd-flash-program.cfg
Info:    openocd.c:82 main(): Open On-Chip Debugger (2006-08-31 15:00 CEST)
Error:   ft2232.c:966 ft2232_init(): unable to open ftdi device: 1
make: *** [program] Error 1

Most thankful for any help

Best regards

That last error will have one of 2 causes.

  1. You have not installed the Jtag interface correctly

  2. I have also seen this problem when you get a crash of GDB / Eclispe

To fix this for either cause

A) Restart the machine.

B) Resinstall the driver for the JTAG interface from device manger.

What OS are you using ?

Good Luck.

Most importantly - don’t use the software that came with the ARM-USB-OCD. Get the latest binaries from www.yagarto.de.

Regards,

Dominic

Hi every body,

Problem resolved, and the LEds blinked, I have unlock the first two bits of the flash direct on the make file, see the two commented line below

[code]program: $(TARGET)
	@echo "Preparing OpenOCD script..."
	@cmd /c 'echo wait_halt > $(OPENOCD_SCRIPT)'
	@cmd /c 'echo armv4_5 core_state arm >> $(OPENOCD_SCRIPT)'
#     @cmd /c 'echo mww 0xffffff64 0x5a000004 >> $(OPENOCD_SCRIPT)'
#     @cmd /c 'echo mww 0xffffff64 0x5a002004 >> $(OPENOCD_SCRIPT)'
	@cmd /c 'echo flash write 0 $(TARGET) 0x0 >> $(OPENOCD_SCRIPT)'
	@cmd /c 'echo mww 0xfffffd08 0xa5000401 >> $(OPENOCD_SCRIPT)'
	@cmd /c 'echo reset >> $(OPE

NOCD_SCRIPT)’

@cmd /c ‘echo shutdown >> $(OPENOCD_SCRIPT)’

@echo “Flash Programming with OpenOCD…”

$(OPENOCD) -f $(OPENOCD_CFG)

@echo “Flash Programming Finished.”[/code]

Then I have programmed again the Flash, all thing work as the plane

many things to all of you