Yahoo Groups archive

Lpc2000

Index last updated: 2026-04-28 23:31 UTC

Thread

LPC2106 and IAP from app code

LPC2106 and IAP from app code

2006-01-22 by Branko Karaklajic

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

Re: [lpc2000] LPC2106 and IAP from app code

2006-01-23 by Sten

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/

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

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.