This is the mail archive of the gdb@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Followup: Memory access error while loading section .text


Hi,

I while ago (dec 2005) I saw some messages passing through here about
this problem:

When using gdb for remote debugging using a BDI2000, in my case to
debug an application on a Philips LPC2xxx. When I try to "load" the
program into memory I got:

Loading section .text, size 0x30b3 lma 0x0
Memory access error while loading section .text

This was said to be a bug in GDB version before 6.4 but it should be
noted that this also happens when gdb tries to write to an undefined
memory region or flash-memory. This happened to me using a LPC2xxx cpu
when I had an incorrect linker-script. (note the address "0x0" which
is the start of the flash-memory, internal RAM in this case started at
0x4000000)

To reiterate: you must configure your linker-script to load the
program into RAM instead of the normal flash-region if you want to
load it from gdb!
The same goes for any initialized data-sections you might have.

Other unrelated cave-eats:
If you want to _flash_ (not load) you program using the bdi2000, you
might have to enable writing to flash on the cpu, before the BDI2000
can access it. You can do this by adding a WM32 to the init-section of
the bdi2000 configuration file.

[INIT]
WM32    0xE01FC040  0x00000001  ;MEMMAP: User flash mode

Finally note that the init section is not executed by a "reset run"
command, only a "reset halt" will trigger this execution.

Greetings,

Jan Wilmans
Myquest


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]