Yahoo Groups archive

Lpc2000

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

Thread

LPC2129 IAP Questions

LPC2129 IAP Questions

2005-01-24 by firegenie1980

Hi,

I have been reading through all the posts about this topic, however 
there are two question I have which I cant find the answers for so 
far. Sorry if they have been answered and I have over looked them!

1. How can you see the value of the status code? Is it output into a 
vaiable anywhere?

2. I know that you have to disable the IRQ for the period your 
accessing the Flash. Where is the code for this located? Is it in a 
general library as I cant seem to find it on my setup. I have found 
the assembly for it, but I don't want to replicate teh code if it is 
already somewhere.

Thanks very much,

FG

Re: [lpc2000] LPC2129 IAP Questions

2005-01-24 by Robert Adsett

At 08:41 PM 1/24/05 +0000, you wrote:
>2. I know that you have to disable the IRQ for the period your
>accessing the Flash. Where is the code for this located? Is it in a
>general library as I cant seem to find it on my setup. I have found
>the assembly for it, but I don't want to replicate teh code if it is
>already somewhere.

It depends on your compiler.  If you are using a GNU setup there is code in 
the newlib-lpc support.

See http://www.aeolusdevelopment.com/Articles/download.html

You will want to look for the functions DisableInterrupts and 
RestoreInterrupts.  These are usable without needing the newlib file io 
overhead.

Robert

" 'Freedom' has no meaning of itself.  There are always restrictions,
be they legal, genetic, or physical.  If you don't believe me, try to
chew a radio signal. "

                         Kelvin Throop, III

Re: LPC2129 IAP Questions

2005-01-24 by Leighton Rowe

> 1. How can you see the value of the status code? Is it output into 
a 
> variable anywhere?

From what I've seen. That variable would be status[0].

The UM gives a basic skeleton on how all IAP function calls and data 
structures work, but probably not enough intructions to make IAP 
calls easily understood.

With the given data structures, and IAP function call format

Data structures

 unsigned long cmd[5]
 unsigned long status[2]

IAP function call format(from User Manual)
typedef void (*IAP)(unsigned long[], unsigned long[]) 

Calling the IAP function "iap_entry(cmd, status)"  for example,  
will always process the IAP command arguments (passed into cmd) and 
store all statuses & results in the status array (usually status[0] 
will hold the status code) .

Re: LPC2129 IAP Questions

2005-01-25 by firegenie1980

Hi,

Thanks for the information about the status code. I just hadn't 
realised that it was returned within the result variable.

The second part to do with the IRQ disabling is still proving to be 
a problem. I have tried writing it myself however my assembly 
experience is quite low and I have not managed to get it working.

I am using the GCC compiler with Kiel microVision 3. I tried the 
link I was given however it doesn't seem to contain any information, 
which is useful to my project even though I have located the IRQ 
enable/disable code fragments.

Any further information anyone?

On a related note, I have set the ARM/Thumb Interworking checkbox in 
the assembler options as I have read this is required to get the IAP 
working correctly. However I have the following warnings come up on 
all of my C files in this project. Any ideas?
 
Warning: /cygdrive/c/Cygnus/Arm-Tools/Bin/../lib/gcc-lib/arm-thumb-
elf/3.3.1/../../../../arm-thumb-elf/bin/ld: Warning: flash_record.o 
does not support interworking, whereas Scheduler.elf does

Thanks again,

FG


--- In lpc2000@yahoogroups.com, "firegenie1980" <firegenie1980@y...> 
wrote:
> 
> Hi,
> 
> I have been reading through all the posts about this topic, 
however 
> there are two question I have which I cant find the answers for so 
> far. Sorry if they have been answered and I have over looked them!
> 
> 1. How can you see the value of the status code? Is it output into 
a 
> vaiable anywhere?
> 
> 2. I know that you have to disable the IRQ for the period your 
> accessing the Flash. Where is the code for this located? Is it in 
a 
> general library as I cant seem to find it on my setup. I have 
found 
> the assembly for it, but I don't want to replicate teh code if it 
is 
Show quoted textHide quoted text
> already somewhere.
> 
> Thanks very much,
> 
> FG

Re: [lpc2000] Re: LPC2129 IAP Questions

2005-01-25 by Robert Adsett

At 01:34 AM 1/25/05 +0000, you wrote:
>I am using the GCC compiler with Kiel microVision 3. I tried the
>link I was given however it doesn't seem to contain any information,
>which is useful to my project even though I have located the IRQ
>enable/disable code fragments.


Assembler code doesn't get any simpler to use than those.  Just compile 
with GCC,  add #include "lpc_sys.h" in your application to provide the 
appropriate prototype defines and typedefs. Compile and link in with your 
application.

The documentation shows hows they are used.

Basically you do the following

  PROCESSOR_STATUS prev_int;

  prev_int = DisableInterrupts( INTERRUPT_DISABLE_MASK);

do stuff protected from interrupts

  RestoreInterrupts( prev_int);

That will take care of making sure interrupts are disabled and then restore 
them to what they were before you disabled them.

Robert

" 'Freedom' has no meaning of itself.  There are always restrictions,
be they legal, genetic, or physical.  If you don't believe me, try to
chew a radio signal. "

                         Kelvin Throop, III

Re: LPC2129 IAP Questions

2005-01-26 by firegenie1980

I have added all the required links and definitions, however I seem 
to be missing the actual code for the enable and disable routines.

Does anyone know where this can be obtained? Also what form is it 
in, Assembly or C?

I have tried adding the code in assembly which I have found on this 
site before, hoever this doesnt seem to compile no matter what I do 
with it.

Thanks,

FG



--- In lpc2000@yahoogroups.com, Robert Adsett <subscriptions@a...> 
wrote:
> At 01:34 AM 1/25/05 +0000, you wrote:
> >I am using the GCC compiler with Kiel microVision 3. I tried the
> >link I was given however it doesn't seem to contain any 
information,
> >which is useful to my project even though I have located the IRQ
> >enable/disable code fragments.
> 
> 
> Assembler code doesn't get any simpler to use than those.  Just 
compile 
> with GCC,  add #include "lpc_sys.h" in your application to provide 
the 
> appropriate prototype defines and typedefs. Compile and link in 
with your 
> application.
> 
> The documentation shows hows they are used.
> 
> Basically you do the following
> 
>   PROCESSOR_STATUS prev_int;
> 
>   prev_int = DisableInterrupts( INTERRUPT_DISABLE_MASK);
> 
> do stuff protected from interrupts
> 
>   RestoreInterrupts( prev_int);
> 
> That will take care of making sure interrupts are disabled and 
then restore 
> them to what they were before you disabled them.
> 
> Robert
> 
> " 'Freedom' has no meaning of itself.  There are always 
restrictions,
> be they legal, genetic, or physical.  If you don't believe me, try 
to
Show quoted textHide quoted text
> chew a radio signal. "
> 
>                          Kelvin Throop, III

Re: [lpc2000] Re: LPC2129 IAP Questions

2005-01-26 by Robert Adsett

At 07:05 PM 1/26/05 +0000, you wrote:
>I have added all the required links and definitions, however I seem
>to be missing the actual code for the enable and disable routines.
>
>Does anyone know where this can be obtained? Also what form is it
>in, Assembly or C?

Assembly. The file is interrupt_sup.s  That is the standard file extension 
for an assembly source file for use by gcc.

>I have tried adding the code in assembly which I have found on this
>site before, hoever this doesnt seem to compile no matter what I do
>with it.

When you say it doesn't work, what error messages are you getting?
The standard compile command (see below) works just fine for me.  It has no 
dependencies.

arm-elf-gcc -c -Os  -o interrupt_sup.o  interrupt_sup.s

You can then link that in as you normally would.

Robert


" 'Freedom' has no meaning of itself.  There are always restrictions,
be they legal, genetic, or physical.  If you don't believe me, try to
chew a radio signal. "

                         Kelvin Throop, III

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.