Yahoo Groups archive

Lpc2000

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

Message

Re: How to protect code in LPC2129

2006-02-17 by Thiadmer Riemersma (ITB CompuPhase)

--- In lpc2000@yahoogroups.com, Rui Gonçalves <rpsgoncalves@...> wrote:
> How can I place same assembler code before position
> 0x01FC? And C code (compiled with gnuarm)?

I have the following in the linker definition file for protected code:
    SECTIONS {
    . = 0
    startup : {
        *(.startup)
        . = 0x1fc;
        LONG(0x87654321);
    } >flash
    prog : {
        *(.text)
        *(.rodata)
        *(.rodata*)
        *(.glue_7)
        *(.glue_7t)
    } >flash
etc. etc.

Assembler code in section ".startup" comes before the protection key
(0x87654321). Of course, it is my own responsibility to ensure that
this code takes less than 0x1fc bytes. Code generated by GCC in the
.text, .rodata and other sections come behind the protection key.

Kind regards,
Thiadmer Riemersma

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.