This is the mail archive of the ecos-patches@sourceware.org mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Support for LPC2XXX IAP interface


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]