Help for lpc2294_pp.cfg

Hello,

can somebody help me to make a lpc2294_pp.cfg for OpenOCD to make falshing operative.

I use RealView Compiler to build ARM7 programms. In a scatter-file following memory regions are defined:

MEM_REGION 0x00000000 0x0003DFFF
{
  ROM +0 0x3DFFE
  {
   StrtUp.o (Init,+FIRST)
    * (+RO)
  }
  RAM 0x40000B00 0x2E90
  {
    * (+RW,+ZI)
  }
  EXT-RAM 0x80000000 UNINIT 0x20000
  {
    DatExt.o (+RW,+ZI)
  }
  STACKS 0x40004000 UNINIT
  {
    stack.o (stacks)
  }
}

How flash banks has to be configured for this memory section?

Now i use following:

....
working_area 0 0x40000000 0x00040000 nobackup

#flash configuration
flash bank lpc2000 0x40000000 0x00040000 0 0 lpc2000_v2 0 20000 calc_checksum

but it doesnt work. Flashing with insight always fails with: “Memory access error while loadding section ROM”.

Thx

Daniel

You can’t use Insight for writing the flash regions, as the GDB protocol doesn’t know about different types of memory yet. Use the OpenOCD’s “flash” commands instead (see http://openfacts.berlios.de/index-en.ph … D_commands for a list of commands). You can enter these commands either via telnet or via GDB’s “monitor” facility.

Regards,

Dominic

What I’m doing wrong? Programm can not be flashed. :frowning:

Open On-Chip Debugger
> flash probe 0
flash 'lpc2000' found at 0x40000000
> flash banks
#0: lpc2000 at 0x40000000, size 0x00040000, buswidth 0, chipwidth 0
> flash write 0 C:\embed.elf 0
failed writing file C:\embed.elf to flash bank 0 at offset 0x00000000
flash program error
>

Regards

Daniel

Your flash configuration line is wrong:

flash bank lpc2000 0x40000000 0x00040000 0 0 lpc2000_v2 0 20000 calc_checksum

The syntax is “flash bank <bus_width> <chip_width> [driver-specific arguments: <lpc_flash_variant> <target#> [‘calc_checksum’]]”

for a LPC2294, that would be:

flash bank lpc2000 0x0 0x40000 0 0 lpc2000_v1 0 14765 calc_checksum

The OpenOCD also expects a plain binary for flashing, but you seem to be trying to write an ELF image. It depends on your toolchain how you’re generating the plain binary, on a GNU toolchain you’d use “objcopy -O binary source.elf output.bin”.

Best regards,

Dominic

Thx, it works.

You’re the best :slight_smile:

Regards

Daniel