This is the mail archive of the
ecos-patches@sourceware.org
mailing list for the eCos project.
Re: Support for LPC2XXX IAP interface
- From: Sergei Gavrikov <sergei dot gavrikov at gmail dot com>
- To: Jonathan Larmour <jifl at eCosCentric dot com>
- Cc: Sergei Gavrikov <sg at belvok dot com>, eCos patches list <ecos-patches at ecos dot sourceware dot org>
- Date: Thu, 27 Nov 2008 19:42:01 +0200
- Subject: Re: Support for LPC2XXX IAP interface
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:date:from:to:cc:subject :message-id:references:mime-version:content-type:content-disposition :in-reply-to:user-agent; bh=DAciltuvivrqGUjAZle7VjTL9t2oUjk5agQLjtC0qzM=; b=sAcEVAlGQ9YkUOU3ffQ22Dmmwq+zz3WwQKxnX4PLDeKIZPPtK4cTQ0WmIO8YcmzfI6 RkJvDtuPBfZVWZQK/YiE+25jf3qg/f2vy3UZJIc4EFgPYQOYw8vMvcCqJv04ocZn3NQd D7lLrWCyBUounuSopHYGHy940W7G5Xt0DBnoY=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; b=LfLCk/jFSPohb3qcKpbCmS1JsJI+ki7YKgbPOmAiOWJ5k55/uYrtrSrLQRtPAc2Z+I zRjVyZ1a4kipYpLb0tyGn01n5Xms4ClN50BtCWqwWldAwTTIKJhQTMDeUcNWJxzAmu32 Ip1PRUzhX/fezc0chVqDRvX+4lKP9E5CyTsr0=
- References: <20081127125253.GA20616@sg-ubuntu.local> <492ED567.2080900@eCosCentric.com>
Thank you for your feedback and the valuable remarks. Tonight I fix all
and repost a cleaned code.
Thank you, all the best,
Sergei
On Thu, Nov 27, 2008 at 05:14:15PM +0000, Jonathan Larmour wrote:
> Sergei Gavrikov wrote:
> >
> > I saw no such a support in other HALs. And I decided to put it under the
> > lpc2xxx/var tree.
> >
> > RFC: Is it a good place for the interface in lpc2xxx/var?
>
> Seems fine.
>
> > +//==========================================================================
> > +
> > +#include <cyg/infra/cyg_type.h>
> > +#include <cyg/infra/testcase.h>
> > +
> > +#include <cyg/hal/lpc2xxx_iap.h>
> > +
> > +extern int diag_printf (char *, ...);
>
> include diag.h
>
>
> > +externC void
> > +#ifdef CYGPKG_KERNEL
> > +cyg_user_start (void)
> > +#else
> > +cyg_start (void)
> > +#endif
> > +{
>
> Why ifdef kernel?
>
> > +cyg_uint32
> > +lpc_iap_call (cyg_uint32 cmd, cyg_uint32 par0, cyg_uint32 par1,
> > + cyg_uint32 par2, cyg_uint32 par3, cyg_uint32 *ret);
>
> This would be better named something like hal_lpc2xxx_iap_call.
>
> > +// 1) WARNING: lpc on-chip flash memory is not accessible during erase and
> > +// write operations. When the user application code starts executing the
> > +// interrupt vectors from the user flash area are active. The user should
> > +// either disable interrupts, or ensure that user interrupt vectors are active
> > +// in RAM and that the interrupt handlers reside in RAM, before making a flash
> > +// erase/write IAP call. The IAP code does not use or disable interrupts.
>
> You say the user, but below, you do disable interrupts.
>
> It sounds like this could be a CDL option, which defaults to what you do
> i.e. disabling interrupts (for safety). After all, the flash programming
> would severely hamper real-time operation so many people would want to
> avoid it..
>
> Otherwise fine.
>
> Jifl
> --
> eCosCentric Limited http://www.eCosCentric.com/ The eCos experts
> Barnwell House, Barnwell Drive, Cambridge, UK. Tel: +44 1223 245571
> Registered in England and Wales: Reg No 4422071.
> ------["Si fractum non sit, noli id reficere"]------ Opinions==mine