Yahoo Groups archive

Lpc2000

Index last updated: 2026-04-28 23:31 UTC

Message

Re: [lpc2000] Re: adding protection to final binary image

2004-06-30 by Robert Adsett

At 06:56 PM 6/30/04 +0000, you wrote:
>I am using GCC-ELF-ARM

Something like this might work.  Warning this is completely untested.

In your crt0.s add something like the following:

.section .protection,"ax"
         .code 32
         .align 0

         .word   0x87654321

to create the word holding the protection value.

In your ld script add something like:

  protect 0x1fc: { *(.protect)} /*  Place protection .   */

to the sections area.  You will probably have to modify other areas.

There will probably be a gap created.

Hmm, I suspect the best solution might be to create three sections in the 
flash 1- holds the interrupt table and maybe a little FIQ code, 2- holds 
the protection vector and maybe has a little room for system constants, 3 - 
everything after to hold the regular code.

You could do as Chris suggested and modify the ld script to exclude that 
area, and then modify the hex. I think that in effect takes you back to the 
3 section alternative above.

I'm a little leary about simply modifying the hex file since I have seen 
tools that fill the gaps in created hex files appropriately (usually 
meaning fill with FF).  I wouldn't be surprised if it worked with GCC 
though and it might be worth checking.

Robert


" 'Freedom' has no meaning of itself.  There are always restrictions,
be they legal, genetic, or physical.  If you don't believe me, try to
chew a radio signal. "

                         Kelvin Throop, III

Attachments

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.