November 23, 2024, 02:24:32 AM

ARM-USB-OCD-H -> Unknown LPC29xx derivative

Started by ViRuSk, April 03, 2016, 03:15:29 AM

Previous topic - Next topic

ViRuSk

Try to flash the Olimex LPC-P2919 board without success and get the following error:

> flash probe 0
Unknown LPC29xx derivative (FEATx=ffffffff:ffffffff:ffffffff:ffffffff)

> mdw 0xe0000100 16
0xe0000100: ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000000 00000 000
0xe0000120: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000 000


I have tried:
OpenOCD 0.5.0
OpenOCD 0.6.0
openocd-0.10.0-dev-00247-g73b676c

According to this Topic:
http://comments.gmane.org/gmane.comp.debugging.openocd.devel/14879

---
> mdw 0xE0000100 16
0xe0000100: ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000000 00000000

Ooops, that's a broken device! Looks like it hasn't seen the final production test before shipping...

I'll follow up on this by private email.

Regards,
Rolf
---

I get the board on 29.03.2016, how can i fix the "Unknown LPC29xx derivative" Error to get the Board flashed?

best regards

LubOlimex

Hey,

The thread you mentioned seems to have solved the problem at the end. The guys there conclude that the specific target processor lacks configuration files and one of the guys wrote proper configuration files.

What script are you using? Did you use the lpc2900.cfg in scripts/target folder? Did you try with the simple connection described in the manual of ARM-USB-OCD-H?

Use the latest OpenOCD version that you have, navigate to the folder with openocd-xxx.exe and execute the following:

openocd.exe -f interface/ftdi/olimex-arm-usb-ocd.cfg -f target/lpc2900.cfg

Best regards,
Lub/OLIMEX
Technical support and documentation manager at Olimex

ViRuSk

Hi,

i used this script (an updated version of the script from the example):

# Olimex LPC-P2919
# http://www.olimex.com/

# Delays on reset lines
adapter_nsrst_delay 100
jtag_ntrst_delay 50

# Maximum of 1/8 of clock frequency (XTAL = 16 MHz).
# Adaptive clocking through RTCK is not supported.
adapter_khz 2000

# Target device: LPC29xx with ETB
# The following variables are used by the LPC2900 script:
#   HAS_ETB             Must be set to 1. The CPU on this board has ETB.
#   FLASH_CLOCK         CPU frequency at the time of flash programming (in kHz)
set HAS_ETB             0
set FLASH_CLOCK         112000
source [find target/lpc2900.cfg]

# A working area will help speeding the flash programming
#$_TARGETNAME configure -work-area-phys 0x80000000 -work-area-size 0x2000 -work-area-backup 0

targets

# Event handlers
$_TARGETNAME configure -event reset-start {
  # Back to the slow JTAG clock
  jtag_khz 2000
}

# External 16-bit flash at chip select CS7 (SST39VF3201-70, 4 MiB)
#flash bank cfi 0x5C000000 0x400000 2 2 $_TARGETNAME jedec_probe


$_TARGETNAME configure -event reset-init {

  # Use PLL
  mww 0xFFFF8020 0x00000001     # XTAL_OSC_CONTROL: enable, 1-20 MHz
  mww 0xFFFF8070 0x01000000     # SYS_CLK_CONF: Crystal
  mww 0xFFFF8028 0x00000005     # PLL: (power down)
  mww 0xFFFF8028 0x01060004     # PLL: M=7, 2P=2 (power up)
                                # --> f=112 MHz, fcco=224 MHz
  sleep 100
  mww 0xFFFF8070 0x02000000     # SYS_CLK_CONF: PLL

  # Increase JTAG speed
  jtag_khz 6000
}

If i look in the source code of lpc2900.c:
if ((package_code == 4) && (itcm_code == 5)) {
/* Old LPC2917 or LPC2919 (non-/01 devices) */
lpc2900_info->target_name = (bank->size == 768*KiB) ? "LPC2919" : "LPC2917";
} else {
if (package_code == 2) {
/* 100-pin package */
if (bank->size == 128*KiB)
lpc2900_info->target_name = "LPC2921";
else if (bank->size == 256*KiB)
lpc2900_info->target_name = "LPC2923";
else if (bank->size == 512*KiB)
lpc2900_info->target_name = "LPC2925";
else
found = 0;
} else if (package_code == 4) {
/* 144-pin package */
if ((bank->size == 256*KiB) && (feat3 == 0xFFFFFFE9))
lpc2900_info->target_name = "LPC2926";
else if ((bank->size == 512*KiB) && (feat3 == 0xFFFFFCF0))
lpc2900_info->target_name = "LPC2917/01";
else if ((bank->size == 512*KiB) && (feat3 == 0xFFFFFFF1))
lpc2900_info->target_name = "LPC2927";
[b] else if ((bank->size == 768*KiB) && (feat3 == 0xFFFFFCF8))
lpc2900_info->target_name = "LPC2919/01";[/b]
else if ((bank->size == 768*KiB) && (feat3 == 0xFFFFFFF9))
lpc2900_info->target_name = "LPC2929";
else
found = 0;
} else if (package_code == 5) {
/* 208-pin package */
lpc2900_info->target_name = (bank->size == 0) ? "LPC2930" : "LPC2939";
} else
found = 0;
}

if (!found) {
LOG_WARNING("Unknown LPC29xx derivative (FEATx="
"%08" PRIx32 ":%08" PRIx32 ":%08" PRIx32 ":%08" PRIx32 ")",
feat0, feat1, feat2, feat3);
return ERROR_FLASH_OPERATION_FAILED;
}


so it´s an unexpected chip id...

JohnS

I made a crude workaround 3-4 years ago when I also found FEAT was wrong, in /home/l300/john/openocd-0.6.1/src/flash/nor/lpc2900.c
along the lines of
if (feat0 == 0xffffffff && feat1 == 0xffffffff && feat2 == 0xffffffff && feat3 == 0xffffffff)
{
        /* fake an old LPC2919 */
        feat0 = 0xFFFFFFF4;
        feat1 = 0xE6E5FF3F;
        feat2 = 0xDF0BFF08;
        feat3 = 0xFFFFFCF8;
}

My notes say the workarea addr was wrong in the cfg, too.

John