EmbeddedRelated.com
Forums

Error message: "Code in HEX file exceeds Flash Limitations!"

Started by crapnuts September 5, 2006
subject: "Code in HEX file exceeds Flash Limitations!"

My setup: Embedded Workbench 4.0 Kickstart IDE, WindowsXP
the target: Embedded Artists LPC2103 USB QuickStart Board with
QuickStart Prototype Board
downloader: Philips LPC2000 Flash Utility V2.2.3

My code:
NAME main
PUBLIC main
COMMON INTVEC:CODE
CODE32
B main
RSEG ICODE:CODE
CODE32
main NOP
B main
END main

The problem: I can successfully download a ready-made hex file that
came with the prototype board. But all attempts at getting my own
code to download results in the flasher pgm error message: "Code in
HEX file exceeds Flash Limitations!"

I think I'm doing something wrong with the tool setup. There are no
errors or warnings reported during assembly/linking. I have changed
many things from the default settings trying to get it to work but no
luck.

For general options config, I have chosen the LPC2103, Arm mode,
little endian, 4 byte stack align.

Although I have not specified other files to be linked, the IDE
apparently has done so for me. But I don't know what the code is that
is being linked in. The file "dl4tpainl8n.r79" shows up in the
workspace listing of stuff in the project.

At this point ( two weeks of going through all the pdf's, searching
the net, etc.) I do not know if the code is a problem or if the
flasher utility has a problem or the tools are not setup right or
what. I gladly welcome any and all suggestions! Once I can get some
code to download, blinking leds won't be far behind. Thanks!

An Engineer's Guide to the LPC2100 Series

Dear Mr. Crapnuts,
Make sure you are setting the hex file format correctly, eg hex-386...
Rich

--- In l..., "crapnuts" wrote:
>
> subject: "Code in HEX file exceeds Flash Limitations!"
>
> My setup: Embedded Workbench 4.0 Kickstart IDE, WindowsXP
> the target: Embedded Artists LPC2103 USB QuickStart Board with
> QuickStart Prototype Board
> downloader: Philips LPC2000 Flash Utility V2.2.3
>
> My code:
> NAME main
> PUBLIC main
> COMMON INTVEC:CODE
> CODE32
> B main
> RSEG ICODE:CODE
> CODE32
> main NOP
> B main
> END main
>
> The problem: I can successfully download a ready-made hex file that
> came with the prototype board. But all attempts at getting my own
> code to download results in the flasher pgm error message: "Code in
> HEX file exceeds Flash Limitations!"
>
> I think I'm doing something wrong with the tool setup. There are no
> errors or warnings reported during assembly/linking. I have changed
> many things from the default settings trying to get it to work but no
> luck.
>
> For general options config, I have chosen the LPC2103, Arm mode,
> little endian, 4 byte stack align.
>
> Although I have not specified other files to be linked, the IDE
> apparently has done so for me. But I don't know what the code is that
> is being linked in. The file "dl4tpainl8n.r79" shows up in the
> workspace listing of stuff in the project.
>
> At this point ( two weeks of going through all the pdf's, searching
> the net, etc.) I do not know if the code is a problem or if the
> flasher utility has a problem or the tools are not setup right or
> what. I gladly welcome any and all suggestions! Once I can get some
> code to download, blinking leds won't be far behind. Thanks!
>
--- In l..., "Richard" wrote:
>
> Dear Mr. Crapnuts,
> Make sure you are setting the hex file format correctly, eg
hex-386...

I have set it to intel-extended. At first (being new to the IAR IDE),
I could not find the output file. Turns out it is labeled .a79
and when I managed to get the system to also generate an
intel-extended file, they look identical. The supplied hex file that
came with the prototype board also looks like the same format so I
think I'm good there.

What I would really like to know is what exactly does the error
message mean? And how can I find out what is in the included file the
IDE is linking along with my code? My guess is that it is basic
startup and init stuff but that's only a guess. I'm somewhat new to
using a linker so I have much to learn!

Thanks for your reply!
Tom (crapnuts... that's just a throw-away spam thwarting email addy)
> The problem: I can successfully download a ready-made hex file that
> came with the prototype board. But all attempts at getting my own
> code to download results in the flasher pgm error message: "Code in
> HEX file exceeds Flash Limitations!"
>
> I think I'm doing something wrong with the tool setup. There are no
> errors or warnings reported during assembly/linking. I have changed
> many things from the default settings trying to get it to work but no
> luck.
>
Have you tried any of the five IAR LPC2103 examples?

A couple have targets for debug from RAM, and Flash. Use these as a
reference.

The C Dinkum lib and associated startup funcs are linked if selected.
See Project Options, General Options, Library Configuration.
Linker config file should point to a config for your target - RAM or Flash.
If debugging from Flash, be sure flash loader is enabled under debugger
download.
You may want a macro file to setup target.
The IAR Flash Loader only uses simple-code format.

Joel
--- Joel Winarske wrote:

> Have you tried any of the five IAR LPC2103 examples?
>
> Joel

That's coming up on my list. For experienced
programmers, that is the obvious choice. For me, I
must confess in public now that I do not know C. I
dabbled with it 15 or 20 years ago but have been
writing assembly-only code as far as microcontrollers
go. Trying to see what's out there beyond the
Microchip products I've been using for several years.

I'll set up one of those examples later today and see
how it goes.

Thanks for the tip!

__________________________________________________