Trouble writing to flash on LPC2468

Hi all,

I’m having trouble writing to the flash of my LPC2468, specifically using the JTAG connection. Using CrossWorks for ARM, I can build, link, etc my project, however it fails to write to the flash of the target using two different JTAG connectors, CrossConnect Lite and Olimex ARM-USB-OCD. However, I am able to write to flash using the Flash Magic utility, writing the program that CrossWorks builds (additional .hex output format). Additionally, I am able to attach the CrossWorks debugger to the LPC2468 and follow its execution once I have downloaded the program using Flash Magic. Also, I have checked to make sure CRP is disabled using Flash Magic.

Any help is appreciated,

Ben.

I am using a JLINK pod with IAR and have few problems. The only time I have issues is if the code I was running had the watchdog timer enabled. In this case since the download takes longer than the time out period, the download gets interrupted. My solution (although ugly) is to send a serial command to the board to greatly increase the timeout period prior to a program. We have also found that Segger’s download utility is somehow able to (most of the time) circumvent the WDT. Not sure how they do that!

Sounds like a JTAG hardware problem. Post the schematic.

fll-freak:
I am using a JLINK pod with IAR and have few problems. The only time I have issues is if the code I was running had the watchdog timer enabled. In this case since the download takes longer than the time out period, the download gets interrupted. My solution (although ugly) is to send a serial command to the board to greatly increase the timeout period prior to a program. We have also found that Segger’s download utility is somehow able to (most of the time) circumvent the WDT. Not sure how they do that!

I disabled the watch dog from resetting the device, however the problem is still present.

leon_heller:
Sounds like a JTAG hardware problem. Post the schematic.

This is interesting, I am not too familiar with hardware, but here are two schematics for the board. They are only focused on the JTAG connections, because I’m not sure of the relevance of the rest of the schematic. The second image shows the detailed part of the JTAG connection.

http://i56.tinypic.com/i77xjc.png

http://i52.tinypic.com/33mvm01.png

Cheers.

Just an update, we have mounted a different batch of the same microprocessor to the board and are still encountering the same issue.

Final update, for sake of completion. The problem was solved by setting the Loader Parameter to 0. (In Project Properties → Target Loader Options → Loader Parameter)

With thanks to Rowley for their support.

Ben.

Hi Benk,

You seem to have knowledge with the LPC213x related hardware, i need your help and would be very thankful if you can provide me

some to my below stated problem.

Well i have developed an LPC213x prototype board, and am using Keil uVision3 to write the code and Flash Magic to burn the chip. Now

the problem is that Flash magic is able to detect the chip as well as program the script. i.e. it detects the device id, boot loader etc and

when i select the HEX and hit start it perform the burn and says finished successfully. But nothing happens on the board, like for e.g.

if i write a prog to set and clear a pin it does not work. I have checked the program and it gets complied without any errors. Below is

the code snipet FYR, i have used PLLconfig with MSEL = 2 and PSEL = 2 the XTAL Fosc = 14.7456 MHz

My concern is that i haven’t pulled up the #rst and BSEL pins on the PCB and have 22pF caps for the XTAL, can these be the problem for

the program not getting executed?

Thanking you in advance for whatever light you can shed onto my problem.

Regards

Kpax


#include <lpc213x.h>
//#include “uart.h”

int main (void)
{

  • volatile unsigned int i,j; *

  • //PLLCON = 0x03;*

  • //PLLCFG = 0x22;*

  • PINSEL1 &= ~(1<<23);*

  • PINSEL1 &= ~(1<<22);*

  • IODIR0 |= (1<<27); *

  • while(1)*

  • { *

  • IOCLR0 |= (1<<27);*

  • for(i=0;i<100;i++)*

  • {*

  • for(j=0;j<1000;j++); *

  • } *

  • IOSET0 |= (1<<27); *

  • for(i=0;i<100;i++)*

  • {*

  • for(j=0;j<1000;j++); *

  • } *

  • }*
    }