EmbeddedRelated.com
Forums

IAR debug problem

Started by Neil Jansen September 20, 2007
Hi,

I'm currently converting a project from GNU to IAR quickstart. I kept
the GNU lpc2103.h header file since the IAR one uses a different
methodology (declaring each bit separately using a complicated mess of
preprocessor macros).

Everything works fine until I go into Debug mode and add say FIOPIN to
the Debug Watch window, it tells me FIOPIN is an unknown symbol.
Seems to me like it's an IAR problem, as the defnitions are ANSI C..
it should be able to look them up, right?
//GNU lpc2103.h excerpt for FIOPIN
#define FIOPIN (*((volatile unsigned long *) 0x3FFFC014))

When I add it to the watch window, I get this error:

Error (col 1): Unknown or ambiguous symbol. FIOPIN
Has anyone seen this behavior before?? Am I stuck re-writing all my
stuff, or is there a way to get it working?

An Engineer's Guide to the LPC2100 Series

Ahhh !! There's something I just might be able to help on !
(I hope this is what you're needing)

Go to the \IAR Systems\Embedded Workbench 4.0\arm\config dir...

Open the iolpc2103.ddf file and you'll see some definitions that
are used for the C-Spy JTAG debugger etc... Modify as necessary.
I had to do this a couple times myself. I don't remember getting
an error but that brain cell may be gone.
boB

It'll look something like this: It's also explained in the manual...

sfr = "FIOPIN" , "Memory", 0x3FFFC014, 4, base
sfr = "FIOPIN.P0_0" , "Memory", 0x3FFFC014, 4, base, bitRange=0-0
sfr = "FIOPIN.P0_1" , "Memory", 0x3FFFC014, 4, base, bitRange=1-1
sfr = "FIOPIN.P0_2" , "Memory", 0x3FFFC014, 4, base, bitRange=2-2
sfr = "FIOPIN.P0_3" , "Memory", 0x3FFFC014, 4, base, bitRange=3-3
sfr = "FIOPIN.P0_4" , "Memory", 0x3FFFC014, 4, base, bitRange=4-4
sfr = "FIOPIN.P0_5" , "Memory", 0x3FFFC014, 4, base, bitRange=5-5
Hi

You have to make sure that you include the following:

#include <iolpc2103.h>

You should then be able to compile without any errors.

This header file has the following information about the gpio.


regards,
Charles
> Ahhh !! There's something I just might be able to help on !
> (I hope this is what you're needing)
>
> Go to the \IAR Systems\Embedded Workbench 4.0\arm\config dir...
>
> Open the iolpc2103.ddf file and you'll see some definitions that
> are used for the C-Spy JTAG debugger etc... Modify as necessary.
> I had to do this a couple times myself. I don't remember getting
> an error but that brain cell may be gone.
> boB
>
> It'll look something like this: It's also explained in the manual...
>
> sfr = "FIOPIN" , "Memory", 0x3FFFC014, 4, base
> sfr = "FIOPIN.P0_0" , "Memory", 0x3FFFC014, 4, base, bitRange=0-0
> sfr = "FIOPIN.P0_1" , "Memory", 0x3FFFC014, 4, base, bitRange=1-1
> sfr = "FIOPIN.P0_2" , "Memory", 0x3FFFC014, 4, base, bitRange=2-2
> sfr = "FIOPIN.P0_3" , "Memory", 0x3FFFC014, 4, base, bitRange=3-3
> sfr = "FIOPIN.P0_4" , "Memory", 0x3FFFC014, 4, base, bitRange=4-4
> sfr = "FIOPIN.P0_5" , "Memory", 0x3FFFC014, 4, base, bitRange=5-5

Awesome, I'll try this tonight :)
Thanks,

Neil
Hi Neil,

I think IAR can not look up macro definitions. IAR is using the symbols
generated by the compiler and the macros are evaluated before the
compiler gets called. Thus the compiler has no idea what text in the
source comes from a macro definition and what does not. Thus it can not
generate debug symbols for macros and the debugger can not look them up.
As a workaround you can paste the text of the macro into the watch
window. (In your case this is "(*((volatile unsigned long *)
0x3FFFC014))") You can even add comments to it like

(*((volatile unsigned long *) 0x3FFFC014)) /*FIOPIN*/

As an alternative you can use the registers window (view/registers). By
default it will show the CPU registers but there is a drop down
selection box on the top. It can show the FIO registers too.

Foltos
--- In l..., "Neil Jansen" wrote:
>
> Awesome, I'll try this tonight :)
> Thanks,
>
> Neil

You may also want to look at the .PDF document:

EWARM_DDFFormat.pdf ( http://goo.gl/xAzzm )

in the DOC directory

boB