EmbeddedRelated.com
Forums

LPC2106 and IAP from app code

Started by Branko Karaklajic January 22, 2006
Hello everyone,

I just sign in for those group... greetings to all.

I work on some project with LPC2106, and need to write some user data
tu flash via IAP. I use IAR Workbench for ARM, and RTOS with 3 task.

I download IAP code from KEIL site and try it but 2106 always hang
when I include call to writing function.

So anyone know working example for IAP from within application code,
(with RTOS maybe)?

thanx in advance

--
greetings,
branek


An Engineer's Guide to the LPC2100 Series

Branko Karaklajic wrote:
> Hello everyone,
>
> I just sign in for those group... greetings to all.
>
> I work on some project with LPC2106, and need to write some user data
> tu flash via IAP. I use IAR Workbench for ARM, and RTOS with 3 task.
>
> I download IAP code from KEIL site and try it but 2106 always hang
> when I include call to writing function.
>
> So anyone know working example for IAP from within application code,
> (with RTOS maybe)?
>
> thanx in advance
>

Hello,

I don't know the keil sources, but might you have forgotten to disable interrupts during IAP-call?
And are you sure that your code is calling this IAP-routine correctly (THUMB mode)? ...
typedef void (*IAPCall_t)(u32*, u32*);
...
int iap_write(const void* destAddr, const void* srcAddr, unsigned long int size) {
IAPCall_t iap_call = (IAPCall_t) 0x7ffffff1;
u32 cbits;
u32 cmdres[5];
...

...
cmdres[0] = 50; /* Prepare sector */
cmdres[1] = sSect;
cmdres[2] = eSect;

cbits = kernel_beginCritical();
iap_call(cmdres, cmdres);
kernel_endCritical(cbits);

...

cmdres[0] = 51; /* Copy RAM 2 Flash */
cmdres[1] = (u32) p;
cmdres[2] = (u32) tmp;
cmdres[3] = 256;
cmdres[4] = pll_core_clock_khz;

cbits = kernel_beginCritical();
iap_call(cmdres, cmdres);
kernel_endCritical(cbits);

...
...

Sten

--
/************************************************
Do you need a tiny and efficient real time
operating system (RTOS) with a preemtive
multitasking for LPC2000 or AT91SAM7?

http://nanortos.net-attack.de/

Or some open-source tools and code for LPC2000?

http://www.net-attack.de/

************************************************/