Need "no load"/"no fill" on unused sectors when programming

OP #1813444
Rate this post
• ▲ useful
▼ not useful
I have bootloader code that uses the first and last few sectors of flash 
on an LPC2xxx.

In the startup assembly file the vectors & protection code word load at 
0x0, then there is an .org 0x7b000 statement that puts the program code 
up high.  There is no specific "fill" command.

When I go to debug and the program loads to flash, all the sectors in 
the middle get erased and filled with 0.  I don't want that because it 
erases the "main" code that I have previously loaded.

Is there a way to tell the system to ignore the unused area?  Right now 
it thinks that the startup section includes all the empty space, rather 
than only the first 0x200 bytes.

I essentially need to define a "noload" section between 0x1000 and 
0x7b000 so that it will leave those sectors alone.  Is this possible???

(Using gcc & openocd)
OP #1813548
Rate this post
• ▲ useful
▼ not useful
Ah, was looking in the wrong place.  I just edited the linker script to 
remove the memory I didn't want touched:
1
MEMORY
2
{
3
  flash1   (rx) : ORIGIN = 0x00000000, LENGTH = 4K
4
  /* Sectors 1 - 24 reserved for main program code */
5
  flash2   (rx) : ORIGIN = 0x0007B000, LENGTH = 12K
6
  ram      (rw) : ORIGIN = 0x40000000, LENGTH = 30720
7
  usbram   (rw) : ORIGIN = 0x7FD00000, LENGTH = 8K
8
  ethram   (rw) : ORIGIN = 0x7FE00000, LENGTH = 16K
9
}

Vectors and reset handler go in flash1, everything else goes up in 
flash2.

Reply

Note: the original post is older than 6 months. Please don't ask any new questions in this thread, but start a new one.

Formatting
  • [c]C-Code[/c]
  • [code]code in other languages, ASCII drawings[/code]
  • [math]formula (LaTeX syntax)[/math]
  • [[Title]] – link to an article
  • Link to another post: right-click its post ID (#8078628), copy the address, paste it into the text

More about formatting

Post long source code as an attachment, not in the text.

Already registered? Log in

Not shown to anyone. We send you a link; your post appears once you confirm it there.

By submitting you create a free account and accept the terms of use.