Yahoo Groups archive

Lpc2000

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

Thread

I need IAP help...

I need IAP help...

2004-10-25 by albin_martinsson

Hi

I really need some IAP help for the LPC2129.

I need to reprogramm the code area in my application and this is 
done in my own bootloader. 

My routines follows the IAP commands that philips has in theire 
applicatione notes. 

like this...

#define IAP_LOCATION 0x7FFFFFF1;

typdef void (*IAP)(unsigned int[], unsigned int[]);

unsigned int command[5];
unsigned int result[2];
IAP iap_entry;


.... in a test function i do like this to read the part ID
iap_entry = (IAP)IAP_LOCATION;
command[0] = 54;
result[0] = 0;

iap_entry(command,result);
print_hex(result[0]);

The problem is that my code will hang when iap_entry is called...
Why does it do this???

Im using GCC.

Anyone now about this problem and how to solve it?

Thanks....   /Albin Martinsson

Re: I need IAP help...

2004-10-26 by Tutors of ESAcademy

--- In lpc2000@yahoogroups.com, "albin_martinsson" <fredrik_m@t...> 
wrote:
> The problem is that my code will hang when iap_entry is called...
> Why does it do this???
> 
> Im using GCC.
> 
> Anyone now about this problem and how to solve it?

Could it be because you are not calling the IAP routines from Thumb 
mode? Please see also this post for a good example on how to do it:

http://groups.yahoo.com/group/lpc2000/message/3479

Chris
Tutor at ESAcademy
www.esacademy.com
www.canopenbook.com

Re: I need IAP help...

2004-10-26 by albin_martinsson

--- In lpc2000@yahoogroups.com, "Tutors of ESAcademy" 
<esacademy@g...> wrote:
> 
> --- In lpc2000@yahoogroups.com, "albin_martinsson" 
<fredrik_m@t...> 
> wrote:
> > The problem is that my code will hang when iap_entry is called...
> > Why does it do this???
> > 
> > Im using GCC.
> > 
> > Anyone now about this problem and how to solve it?
> 
> Could it be because you are not calling the IAP routines from 
Thumb 
> mode? Please see also this post for a good example on how to do it:
> 
> http://groups.yahoo.com/group/lpc2000/message/3479
> 
> Chris
> Tutor at ESAcademy
> www.esacademy.com
> www.canopenbook.com

Im not calling the IAP routines from Thumb mode. Do you have to do 
that. There is a command in the gcc compiler "-mthumb-interwork" 
that should support calls between ARM and THUMB mode..
Then... im not so good at writing code in assembler, I can just read 
it so.. any more help is very welcome.

/Fredrik

Re: I need IAP help...

2004-10-26 by Leighton Rowe

> Im not calling the IAP routines from Thumb mode. Do you have to do 
> that. There is a command in the gcc compiler "-mthumb-interwork" 
> that should support calls between ARM and THUMB mode..
> Then... im not so good at writing code in assembler, I can just 
read 
> it so.. any more help is very welcome.

Yes. If you're running ARM code and u need to use the IAP u need 2do 
a thumb instruction.

Though I'm not familiar with your compiler, does GCC have thumb/arm 
directives that u can add-on to fuction definitions? Something 
like...

typdef _thumb void (*IAP)(unsigned int[], unsigned int[])
{
.....
}

If yes, then modifying your IAP call to a thumb function should do 
it.

Re: I need IAP help...

2004-10-26 by albin_martinsson

--- In lpc2000@yahoogroups.com, "Leighton Rowe" <leightonsrowe@y...> 
wrote:
> 
> > Im not calling the IAP routines from Thumb mode. Do you have to 
do 
> > that. There is a command in the gcc compiler "-mthumb-interwork" 
> > that should support calls between ARM and THUMB mode..
> > Then... im not so good at writing code in assembler, I can just 
> read 
> > it so.. any more help is very welcome.
> 
> Yes. If you're running ARM code and u need to use the IAP u need 
2do 
> a thumb instruction.
> 
> Though I'm not familiar with your compiler, does GCC have 
thumb/arm 
> directives that u can add-on to fuction definitions? Something 
> like...
> 
> typdef _thumb void (*IAP)(unsigned int[], unsigned int[])
> {
> .....
> }
> 
> If yes, then modifying your IAP call to a thumb function should do 
> it.

Hi
Thanks for your help.. but i did get it to work.. but I still dont 
know what i was doing wrong.. but this is how i solved it...

for all C-files im using i added "-mthumb-interwork" command to the 
gcc-compiler. Then the code that is generated can handel calls 
between ARM och THUMB code.

Now i can go home from work today and feel happy  =)...

Until next time... bye
/ Fredrik Martinsson, embedded developer, Sweden

Re: I need IAP help...

2004-10-27 by burner_itfi

--- In lpc2000@yahoogroups.com, "albin_martinsson" <fredrik_m@t...> wrote:
> 
> Hi
> 
> I really need some IAP help for the LPC2129.
> 
> I need to reprogramm the code area in my application and this is 
> done in my own bootloader. 
> 
> My routines follows the IAP commands that philips has in theire 
> applicatione notes. 
> 
> like this...
> 
> #define IAP_LOCATION 0x7FFFFFF1;
> 
> typdef void (*IAP)(unsigned int[], unsigned int[]);
> 
> unsigned int command[5];
> unsigned int result[2];
> IAP iap_entry;
> 
> 
> .... in a test function i do like this to read the part ID
> iap_entry = (IAP)IAP_LOCATION;
> command[0] = 54;
> result[0] = 0;
> 
> iap_entry(command,result);
> print_hex(result[0]);
> 
> The problem is that my code will hang when iap_entry is called...
> Why does it do this???
> 
> Im using GCC.
> 
> Anyone now about this problem and how to solve it?
> 
> Thanks....   /Albin Martinsson

hello

i have had the same problem. When i want to call the iap_entry
function the processor hang up. 

I have said the gcc that it is thumb code but it still don't work.

The solution was that i update the onchip philips bootloader to the
actual version 1.63. And now it still works perfect.

i hope i can help you with this solution.

best regards Tobi

Re: I need IAP help...

2004-10-28 by dave_albert

Upgrading the bootloader is a good idea.  Also, make sure you disable interrupts before the call to IAP and restore them afterwards.

--- In lpc2000@yahoogroups.com, "burner_itfi" <burner_itfi@h...> wrote:
Show quoted textHide quoted text
> 
> --- In lpc2000@yahoogroups.com, "albin_martinsson" <fredrik_m@t...> wrote:
> > 
> > Hi
> > 
> > I really need some IAP help for the LPC2129.
> > 
> > I need to reprogramm the code area in my application and this is 
> > done in my own bootloader. 
> > 
> > My routines follows the IAP commands that philips has in theire 
> > applicatione notes. 
> > 
> > like this...
> > 
> > #define IAP_LOCATION 0x7FFFFFF1;
> > 
> > typdef void (*IAP)(unsigned int[], unsigned int[]);
> > 
> > unsigned int command[5];
> > unsigned int result[2];
> > IAP iap_entry;
> > 
> > 
> > .... in a test function i do like this to read the part ID
> > iap_entry = (IAP)IAP_LOCATION;
> > command[0] = 54;
> > result[0] = 0;
> > 
> > iap_entry(command,result);
> > print_hex(result[0]);
> > 
> > The problem is that my code will hang when iap_entry is called...
> > Why does it do this???
> > 
> > Im using GCC.
> > 
> > Anyone now about this problem and how to solve it?
> > 
> > Thanks....   /Albin Martinsson
> 
> hello
> 
> i have had the same problem. When i want to call the iap_entry
> function the processor hang up. 
> 
> I have said the gcc that it is thumb code but it still don't work.
> 
> The solution was that i update the onchip philips bootloader to the
> actual version 1.63. And now it still works perfect.
> 
> i hope i can help you with this solution.
> 
> best regards Tobi

Re: I need IAP help...

2004-10-28 by dave_albert

Upgrading the bootloader is a good idea.  Also, make sure you disable interrupts before the call to IAP and restore them afterwards.

--- In lpc2000@yahoogroups.com, "burner_itfi" <burner_itfi@h...> wrote:
Show quoted textHide quoted text
> 
> --- In lpc2000@yahoogroups.com, "albin_martinsson" <fredrik_m@t...> wrote:
> > 
> > Hi
> > 
> > I really need some IAP help for the LPC2129.
> > 
> > I need to reprogramm the code area in my application and this is 
> > done in my own bootloader. 
> > 
> > My routines follows the IAP commands that philips has in theire 
> > applicatione notes. 
> > 
> > like this...
> > 
> > #define IAP_LOCATION 0x7FFFFFF1;
> > 
> > typdef void (*IAP)(unsigned int[], unsigned int[]);
> > 
> > unsigned int command[5];
> > unsigned int result[2];
> > IAP iap_entry;
> > 
> > 
> > .... in a test function i do like this to read the part ID
> > iap_entry = (IAP)IAP_LOCATION;
> > command[0] = 54;
> > result[0] = 0;
> > 
> > iap_entry(command,result);
> > print_hex(result[0]);
> > 
> > The problem is that my code will hang when iap_entry is called...
> > Why does it do this???
> > 
> > Im using GCC.
> > 
> > Anyone now about this problem and how to solve it?
> > 
> > Thanks....   /Albin Martinsson
> 
> hello
> 
> i have had the same problem. When i want to call the iap_entry
> function the processor hang up. 
> 
> I have said the gcc that it is thumb code but it still don't work.
> 
> The solution was that i update the onchip philips bootloader to the
> actual version 1.63. And now it still works perfect.
> 
> i hope i can help you with this solution.
> 
> best regards Tobi

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.