[coldfire-gnu-discuss] Debugging/Running program in internal Flash.
Claude Sylvain
csylvain at electro-technica.com
Fri Feb 16 16:02:21 UTC 2007
Hello Nathan,
>
> Nathan Sidwell wrote:
>
>
> Looking at the way the PC is behaving I think there's a cache problem.
> The Icache has not been flushed and has something stale in it. That
> would explain why the pc has landed at 404, which is not an instruction
> boundary.
>
> I'm not sure how that's happened. IIUC you're using the m52235evb config,
> right?
> That does tell the sprite that there is a cache.
The target I use is the M52235EVB.
Sprite is launched using the following command:
target remote | m68k-elf-sprite pe://USBMultilink m52235evb
I suppose that the command line parameter "m52235evb" refer to the
file "m52235evb.xml", located in "CodeSourcery\Sourcery
G++\m68k-elf\lib\boards\". This file seems to be the configuration
file you talk about and seems to include something related to the
cache. See below the header of that file:
----------
<?xml version="1.0"?>
<target-description>
<target-features>
<cache/>
</target-features>
----------
>
> Here are some suggestions:
>
> *) Reset or powercycle the board (the sprite should be resetting the
> board on first connection though)
>
>
> *) Force a write to RAM from gdb. this will cause the sprite to flush
> the Icache.
> p/x *(int *)__data_start = 0x1234567
>
> then reset the pc to 0x400 as you have been doing, and try again.
>
It is really strange, the symbol "__data_start" seems to not be
the start of the internal SRAM !?
Its value is 0xb5b88126 instead 0x20000000 (as defined in the linker
script "m52235evb-rom.ld").
GDB can not write at such an address.
See the GDB output below:
----------
..
m68k-elf-sprite:Opening P&E USBMultilink port 1 (USB1 : USB-ML-CF Rev
C (PE60123
45))
m68k-elf-sprite:Target reset
0x00000000 in __interrupt_vector ()
(gdb) p/x *(int *)__data_start = 0x1234567
m68k-elf-sprite:Memory write verification failed; config file error?
Cannot access memory at address 0xb5b88126
(gdb) print (unsigned int *) __data_start
$1 = (unsigned int *) 0xb5b88126
(gdb)
----------
I don't know a lot about GCC linker script file, but something seems
to be strange to me.
The section that define __data_start in "m52235evb-rom.ld" linker
script file is as follow:
----------
.data :
{
__data_load = LOADADDR (.data);
__data_start = .;
*(.got.plt) *(.got)
*(.shdata)
*(.data .data.*)
*(.gnu.linkonce.d.*)
. = ALIGN (4);
_edata = .;
} >ram AT>rom
----------
What is the purpose of "AT>rom" ?
Maybe the problem is related to that instruction !?
Regards,
Claude Sylvain
Electro-Technica inc.
More information about the coldfire-gnu-discuss
mailing list