PDA

View Full Version : WinARM


zboot
03-30-07, 09:58 AM
Has anyone installed or tried to use this?

I'm going to be giving it a shot this weekend - from what I've read, it's going to be a pain getting Eclipse/gcc up and running through cygwin on my machine. .

I'm working on a robot. His name is LastMinute. . .and that is because the competition is in two weeks and I'm essentially just starting this weekend.

Dave
03-30-07, 10:21 AM
Can't say that I've used it, but have seen some discussion of building, configuring, and using WinARM on the LPC2000 Yahoo Group (http://tech.groups.yahoo.com/group/lpc2000/)

zboot
04-16-07, 04:22 PM
Since I've been successful in developing my applications using WinARM, I want to post some details so that others who may want to use WinARM can get started.

After your download WinARM, you'll want to unzip it to C:\WinARM.

Next, you'll want to add to your PATH variable, and entry to C:\WinARM\bin and C:\WinARM\utils\bin.

Browse to the C:\WinARM\examples\lpc213x_lpc214x_examples folder. You'd want a copy of the Common_WinARM folder and the makefile from one of the projects (like ADC).

The lpc2131.h file is located in c:\WinARM\arm-elf\include\arch\philips\keil.

You'll need to edit the makefile and add that path to where it searches for header files. Do that by adding this line:
EXTRAINCDIRS += c:\WinARM\arm-elf\include\arch\philips\keil
Or, you could copy the lpc2131.h file to a folder of your choice and add that path instead. While you're in the makefile, make sure you change the other paths to reflect the location of Common_WinARM. Also, change SUBMDL to LPC2131.

These are the files that are really necessary from Common_WinARM:

type.h, irq.h, lpc2138-ROM.ld, Startup.S, and swi_handler.S

So, you could copy those to your special include directory. Make sure to copy the ROM-ld or RAM-ld file and rename it to lpc2131-ROM.ld or lpc2131-RAM.ld

The final (AND IMPORTANT) thing you'll need to do is edit the Startup.S file to configure the PLL for the TiniARM lpc2131 and to configure PCLK. For advanced users. . . there may be other things you'd want to edit too.

Anyway, there are two important values you may need to edit. First, for PCLK or the VPB Divider - the stuff for this starts around line 138 of Startup.S. You'll want to edit the VPBDIV_Val to reflect the PCLK settings you want - consult the lpc2131 manual for more details on this. After this are the settings for the PLL. You want to edit the PLLCFG_Val to generate an appropriate clock frequency. The max that our 2131 is recommended to be run at is 60MHz. You can get this by setting PLLCFG_Val to 0x00000025.

If you want a slower clock frequency, consult the lpc2131 manual on what values to load to PLLCFG.

CAUTION - some of you may read the manual and see that PLLCFG and VPBDIV are 8bit registers. However you MUST write those configuration values as 32bits in the Startup.S file. If you look further to where the startup code actually loads those into the processor, you'll see that it copies them to a 32bit register, then copies the values to the appropriate locations in memory. If you don't represent PLLCFG_Val or VPBDIV_Val as 32bits, any code you write that is time dependent will not operate as expected and you'll spend hours debugging code that doesn't actually have problems. Believe me, I've done it.