Sign in

username:

password:



Not a member?

Search lpc2000



Search tips

Subscribe to lpc2000



lpc2000 by Keywords

2106 | ADC | ARM7 | Atmel | Bootloader | CAN | CrossStudio | CrossWorks | DDS | ECos | Ethernet | ETM | FIFO | FLASH | FPGA | GCC | GDB | GNU | GNUARM | GPIO | I2C | IAP | IAR | JTAG | Kickstart | LCD | Linux | LPC | LPC-E2294 | LPC2000 | LPC2100 | LPC2104 | Lpc2106 | Lpc210x | LPC2114 | LPC2119 | LPC2124 | LPC2129 | Lpc2138 | LPC213x | LPC21xx | LPC2210 | LPC2212 | LPC2214 | LPC2292 | LPC2294 | LPC2xxx | LPC3128 | MCB2100 | Olimex | Philips | PWM | Rowley | RTC | RTOS | SPI | SSP | UART | UART0 | UART1 | ULINK | USB | Watchdog | Wiggler

Ads

Discussion Groups

Discussion Groups | LPC2000 | LPC2300 IAP

Discussion group dedicated to the Philips LPC2000 family of ARM MCUs

LPC2300 IAP - Baldur Gislason - Aug 11 16:29:00 2008

I'm developing code on LPC23xx, previously on LPC2378 which I then
swapped out for an LPC2387 (Nice that the MCB2300 has pads for both
packages)
I recently started playing with in application programming of the
flash memory. I must say it has disappointed me somewhat, the IAP
documentation in the user manual is not very good.
What disappoints me the most is the extremely slow speed I'm getting,
the following routine that burns 16kB of data into a 32kB page takes a
good 400ms to execute, that's almost a half second during which I
cannot access any part of the flash at all. I'm running at 72MHz. The
erase operation seems to be the slowest part but I haven't checked if
different values of data in RAM (non FF) make the burn process even
slower.

#define CLOCK_KHZ 72000
IAP iap_entry=(IAP) IAP_LOCATION;
command[0] = IAP_PREPARE;
command[1] = 13 + page;
command[2] = 13 + page;
FIO2SET = 0x02;
while(rcode = iap_entry(command, result) == 11) { }
command[0] = IAP_ERASE;
command[1] = 13 + page;
command[2] = 13 + page;
command[3] = CLOCK_KHZ;
FIO2SET = 0x04;
while(rcode = iap_entry(command, result) == 11) { }
command[0] = IAP_PREPARE;
command[1] = 13 + page;
command[2] = 13 + page;
FIO2SET = 0x08;
while(rcode = iap_entry(command, result) == 11) { }
command[0] = IAP_COPY;
command[1] = &page0data;
command[2] = scratchspace;
command[3] = 4096;
command[4] = CLOCK_KHZ;
FIO2SET = 0x10;
while(rcode = iap_entry(command, result) == 11) { }
command[0] = IAP_PREPARE;
command[1] = 13 + page;
command[2] = 13 + page;
while(rcode = iap_entry(command, result) == 11) { }
command[0] = IAP_COPY;
command[1] = (uint32_t)&page0data + 0x1000;
command[2] = (uint32_t)scratchspace + 0x1000;
command[3] = 4096;
command[4] = CLOCK_KHZ;
while(rcode = iap_entry(command, result) == 11) { }

command[0] = IAP_PREPARE;
command[1] = 13 + page;
command[2] = 13 + page;
while(rcode = iap_entry(command, result) == 11) { }
command[0] = IAP_COPY;
command[1] = (uint32_t)&page0data + 0x2000;
command[2] = (uint32_t)scratchspace + 0x2000;
command[3] = 4096;
command[4] = CLOCK_KHZ;
while(rcode = iap_entry(command, result) == 11) { }

command[0] = IAP_PREPARE;
command[1] = 13 + page;
command[2] = 13 + page;
while(rcode = iap_entry(command, result) == 11) { }
command[0] = IAP_COPY;
command[1] = (uint32_t)&page0data + 0x3000;
command[2] = (uint32_t)scratchspace + 0x3000;
command[3] = 4096;
command[4] = CLOCK_KHZ;
while(rcode = iap_entry(command, result) == 11) { }

Is there any way to speed this up? I'm very disappointed that I have
found zero information about what kind of time I should expect these
operations to take. 400ms is an enormous amount of time to halt
execution for. I should still be able to execute interrupts if I just
put interrupt handlers and all of the code and data associated with
them into RAM, right? I can't fit everything needed by my interrupts
into RAM but I have some core functionality that I absolutely cannot
afford to lose for a half second, 100ms would be ok.
------------------------------------



(You need to be a member of lpc2000 -- send a blank email to lpc2000-subscribe@yahoogroups.com )


Re: LPC2300 IAP - Karl Olsen - Aug 12 4:56:13 2008

--- In l...@yahoogroups.com, "Baldur Gislason" wrote:

> I'm developing code on LPC23xx, previously on LPC2378 which I then
> swapped out for an LPC2387 (Nice that the MCB2300 has pads for both
> packages)
> I recently started playing with in application programming of the
> flash memory. I must say it has disappointed me somewhat, the IAP
> documentation in the user manual is not very good.

Neither the documentation nor the IAP interface itself are very good.

> #define CLOCK_KHZ 72000
> IAP iap_entry=(IAP) IAP_LOCATION;
> command[0] = IAP_PREPARE;
> command[1] = 13 + page;
> command[2] = 13 + page;
> FIO2SET = 0x02;
> while(rcode = iap_entry(command, result) == 11) { }

iap_entry() returns void, the return code is returned in result[0].
And iap_entry() doesn't return until the operation is complete, so
you should not call it in a loop. If you ever see a BUSY return
code, something is seriously wrong.

> Is there any way to speed this up? I'm very disappointed that I have
> found zero information about what kind of time I should expect these
> operations to take. 400ms is an enormous amount of time to halt
> execution for.

Manual page 3.

> I should still be able to execute interrupts if I just
> put interrupt handlers and all of the code and data associated with
> them into RAM, right?

Yes. Also remember to relocate the interrupt vectors to RAM. The
real fun begins if you call the same function from both RAM code and
normal flash code, and especially if you use standard library
functions (such as division) from your interrupt handlers.

Karl Olsen

------------------------------------



(You need to be a member of lpc2000 -- send a blank email to lpc2000-subscribe@yahoogroups.com )

help - pree...@softeltech.com - Aug 12 7:44:50 2008


hello,
I am new to lpc group and using lpc board 2387 for the first time.
We have the evaluation board MCB2300, with cpu - lpc2387.
I am not able to test anything with this. The realview, ide which comes along with the cd of evaluation board is not working, we are trying with some simple sample - blinky , using winarm, we are using flash magic to download the hex file to the board using serial port. Please help with the sample and the procedure to download the same and test it.

The blinky code is as below:

#include "LPC23xx.h"
void wait (void) { /* wait function */
int d;

for (d = 0; d < 1000000; d++); /* only to delay for LED flashes */
}

int main (void) {
unsigned int i; /* LED var */

IODIR1 = 0x00FF0000; /* P1.16..23 defined as Outputs */

while (1) { /* Loop forever */
for (i = 1<<16; i < 1<<23; i <<= 1) { /* Blink LED 0,1,2,3,4,5,6 */
IOSET1 = i; /* Turn on LED */
wait (); /* call wait function */
IOCLR1 = i; /* Turn off LED */
}
for (i = 1<<23; i > 1<<16; i >>=1 ) { /* Blink LED 7,6,5,4,3,2,1 */
IOSET1 = i; /* Turn on LED */
wait (); /* call wait function */
IOCLR1 = i; /* Turn off LED */
}
}
}

Thanks in advance

Thanks and regards
Preethi Sreenath

[Non-text portions of this message have been removed]
------------------------------------



(You need to be a member of lpc2000 -- send a blank email to lpc2000-subscribe@yahoogroups.com )

RE: help - "Milender, Jeff" - Aug 12 8:29:56 2008

My first thought is that "d" will never be larger then 1,000,000 as it
is an int (16bit = 65535) but that assumes that "d" is a 16 bit value in
the processor/complier you are using. I work mostly with 16bit
processors and they mostly (but not all) use char = 8bit, int =16bit,
long = 32bit.

Jeff

Jeff Milender
Systems Engineer
Cargo Systems
Goodrich Interiors
2604 Highway 20 North
Jamestown, ND 58401
Tel: 701-253-7569
j...@goodrich.com
www.goodrich.com

________________________________

From: l...@yahoogroups.com [mailto:l...@yahoogroups.com] On Behalf
Of p...@softeltech.com
Sent: Tuesday, August 12, 2008 5:59 AM
To: l...@yahoogroups.com
Subject: [lpc2000] help

hello,
I am new to lpc group and using lpc board 2387 for the first time.
We have the evaluation board MCB2300, with cpu - lpc2387.
I am not able to test anything with this. The realview, ide which comes
along with the cd of evaluation board is not working, we are trying with
some simple sample - blinky , using winarm, we are using flash magic to
download the hex file to the board using serial port. Please help with
the sample and the procedure to download the same and test it.

The blinky code is as below:

#include "LPC23xx.h"
void wait (void) { /* wait function */
int d;

for (d = 0; d < 1000000; d++); /* only to delay for LED flashes */
}

int main (void) {
unsigned int i; /* LED var */

IODIR1 = 0x00FF0000; /* P1.16..23 defined as Outputs */

while (1) { /* Loop forever */
for (i = 1<<16; i < 1<<23; i <<= 1) { /* Blink LED 0,1,2,3,4,5,6 */
IOSET1 = i; /* Turn on LED */
wait (); /* call wait function */
IOCLR1 = i; /* Turn off LED */
}
for (i = 1<<23; i > 1<<16; i >>=1 ) { /* Blink LED 7,6,5,4,3,2,1 */
IOSET1 = i; /* Turn on LED */
wait (); /* call wait function */
IOCLR1 = i; /* Turn off LED */
}
}
}

Thanks in advance

Thanks and regards
Preethi Sreenath

[Non-text portions of this message have been removed]

[Non-text portions of this message have been removed]
------------------------------------



(You need to be a member of lpc2000 -- send a blank email to lpc2000-subscribe@yahoogroups.com )