Yahoo Groups archive

Lpc2000

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

Thread

LPC2138FBD64

LPC2138FBD64

2005-10-26 by Patrick Doll

Hi,

I have three (easy) questions:

1.)Is it possible to store Data in the nonvolatile internal Flash memory
region of the LPC2138FBD64 by a program running on the MCU? I want to store
serial values coming from the SPI Interface (~100KBytes). Or do I need an
external memory chip?

2.)I'm looking for a C-Compiler
In the book "The Insiders guide to the Philips ARM7-Based MCUs" the Keil ARM
Compiler is mentioned. Is there any experience with this Compiler? Is it
freeware? Is it possible to use it for the LPC2138FBD64? Or do you suggest
another compiler?

3.)At the moment I'm looking for the right MCU, so the size of the program
space is a very important part. How much memory is used by a simple program?
(e.g. let an led blink incl. startup code + ...?).

Thank you

-- 
Highspeed-Freiheit. Bei GMX superg\ufffdnstig, z.B. GMX DSL_Cityflat,
DSL-Flatrate f\ufffdr nur 4,99 Euro/Monat*  http://www.gmx.net/de/go/dsl

Re: LPC2138FBD64

2005-10-26 by lpc2100_fan

Hi Patrick,

it is possible to store data while running from the internal RAM but
it is not possible to run a program from Flash while programming
another part of the Flash.

The Keil C-Compiler is a good choice but it is not freeware. There is
a version that allows you to write 16k of your code and can be
downloaded from www.keil.com

Size of Blinky, a few hundred bytes, unless you use such a library
function like printf, then we are immediately talking a couple kbytes.

There is a free compiler (GNU) and if you take ten minutes to search
this forum you will find many references to that compiler as well. One
warning, the library functions of the GNU are very big and increase
the size of a program a lot compared to a compilers you have to buy.
For the application you mention (sounds like a data logger), the GNU
compiler is perfect, actually the 16k of the Keil compiler might be
enough to do the function you mentioned. 

Bob

--- In lpc2000@yahoogroups.com, "Patrick Doll" <Patrick-doll@g...> wrote:
>
> Hi,
> 
> I have three (easy) questions:
> 
> 1.)Is it possible to store Data in the nonvolatile internal Flash memory
> region of the LPC2138FBD64 by a program running on the MCU? I want
to store
> serial values coming from the SPI Interface (~100KBytes). Or do I
need an
> external memory chip?
> 
> 2.)I'm looking for a C-Compiler
> In the book "The Insiders guide to the Philips ARM7-Based MCUs" the
Keil ARM
> Compiler is mentioned. Is there any experience with this Compiler? Is it
> freeware? Is it possible to use it for the LPC2138FBD64? Or do you
suggest
> another compiler?
> 
> 3.)At the moment I'm looking for the right MCU, so the size of the
program
> space is a very important part. How much memory is used by a simple
program?
Show quoted textHide quoted text
> (e.g. let an led blink incl. startup code + ...?).
> 
> Thank you
> 
> -- 
> Highspeed-Freiheit. Bei GMX supergünstig, z.B. GMX DSL_Cityflat,
> DSL-Flatrate für nur 4,99 Euro/Monat*  http://www.gmx.net/de/go/dsl
>

Re: [lpc2000] LPC2138FBD64

2005-10-26 by Joel Winarske

> 2.)I'm looking for a C-Compiler
> In the book "The Insiders guide to the Philips ARM7-Based MCUs" the Keil 
> ARM
> Compiler is mentioned. Is there any experience with this Compiler? Is it
> freeware? Is it possible to use it for the LPC2138FBD64? Or do you suggest
> another compiler?

IAR offers an excellent toolset, Embedded Workbench ARM.  The EWARM Free 32k 
limited version fits the bill for most programs.  If you attend the OKI 
seminar you will get a very nice discount certificate. 
http://supp.iar.com/Download/SW/?item=EWARM-KS32
http://www.iar.com/index.php?show=43943_ENG

The GNU route is "free", but if you don't exceed 32k IAR is a very good 
choice.
http://www.gnuarm.com/

When reviewing the potential parts be sure to use:
http://www.standardics.philips.com/products/lpc2000/all/

The LPC2101/2/3 and the LPC214x are the newer parts.

Regards,
Joel Winarske

Re: [lpc2000] LPC2138FBD64

2005-10-26 by Joel Winarske

I must also state I don't represent Keil or IAR ;-)  I'm just a customer.
Show quoted textHide quoted text
>> 2.)I'm looking for a C-Compiler
>> In the book "The Insiders guide to the Philips ARM7-Based MCUs" the Keil
>> ARM
>> Compiler is mentioned. Is there any experience with this Compiler? Is it
>> freeware? Is it possible to use it for the LPC2138FBD64? Or do you 
>> suggest
>> another compiler?
>
> IAR offers an excellent toolset, Embedded Workbench ARM.  The EWARM Free 
> 32k
> limited version fits the bill for most programs.  If you attend the OKI
> seminar you will get a very nice discount certificate.
> http://supp.iar.com/Download/SW/?item=EWARM-KS32
> http://www.iar.com/index.php?show=43943_ENG
>
> The GNU route is "free", but if you don't exceed 32k IAR is a very good
> choice.
> http://www.gnuarm.com/
>
> When reviewing the potential parts be sure to use:
> http://www.standardics.philips.com/products/lpc2000/all/
>
> The LPC2101/2/3 and the LPC214x are the newer parts.
>
> Regards,
> Joel Winarske

Re: [lpc2000] LPC2138FBD64

2005-10-26 by Ghazan Haider

I'm new to ARM too. I tried GCC first (have been using
and compiling Linux since 1996), but it didnt work
out. Finding info and making sense of the error
messages makes things tough. 

Tried IAR and Kiel, and got stuck with Kiel. Their
sim, IDE and programming interfaces are very
intuitive. I'll try gcc again when I have the time;
for pressing projects (or ones requiring small sized
programs) I'll use Kiel.


--- Joel Winarske <joelw@...> wrote:

> > 2.)I'm looking for a C-Compiler
> > In the book "The Insiders guide to the Philips
> ARM7-Based MCUs" the Keil 
> > ARM
> > Compiler is mentioned. Is there any experience
> with this Compiler? Is it
> > freeware? Is it possible to use it for the
> LPC2138FBD64? Or do you suggest
> > another compiler?
> 
> IAR offers an excellent toolset, Embedded Workbench
> ARM.  The EWARM Free 32k 
> limited version fits the bill for most programs.  If
> you attend the OKI 
> seminar you will get a very nice discount
> certificate. 
> http://supp.iar.com/Download/SW/?item=EWARM-KS32
> http://www.iar.com/index.php?show=43943_ENG
> 
> The GNU route is "free", but if you don't exceed 32k
> IAR is a very good 
> choice.
> http://www.gnuarm.com/
> 
> When reviewing the potential parts be sure to use:
>
http://www.standardics.philips.com/products/lpc2000/all/
Show quoted textHide quoted text
> 
> The LPC2101/2/3 and the LPC214x are the newer parts.
> 
> Regards,
> Joel Winarske 
> 
> 
>

Re: [lpc2000] LPC2138FBD64

2005-10-26 by Richard

At 09:14 AM 10/26/2005, Patrick Doll wrote:
>...
>2.)I'm looking for a C-Compiler
>In the book "The Insiders guide to the Philips ARM7-Based MCUs" the Keil ARM
>Compiler is mentioned. Is there any experience with this Compiler? Is it
>freeware? Is it possible to use it for the LPC2138FBD64? Or do you suggest
>another compiler?
>...

I'd recommend our compiler :-) $199, the lowest cost commercial non-GNU 
based IDE/compiler out there. The demo is fully functional for 45 days, and 
code limited to 10K for non-commercial use after ward.


// richard (This email is for mailing lists. To reach me directly, please 
use richard at imagecraft.com)

Re: LPC2138FBD64 - not possible to run from Flash and use IAP?

2005-10-27 by Guillermo Prandi

Hi, Bob... I am worried about what you just wrote. I'm in the middle 
of an urgent project and I took for granted that I can use IAP while 
my code runs from Flash without giving it a second tought. Can you 
please explain the concept a little more? I'm reading the LPC2138 
user's manual at 20.4.10 and it suggests it is possible as long as 
you disable interrupts while using IAP (or make interrupts to run 
from RAM).

Guille

--- In lpc2000@yahoogroups.com, "lpc2100_fan" <lpc2100_fan@y...> 
wrote:
>
> Hi Patrick,
> 
> it is possible to store data while running from the internal RAM but
> it is not possible to run a program from Flash while programming
> another part of the Flash.
> 
> The Keil C-Compiler is a good choice but it is not freeware. There 
is
> a version that allows you to write 16k of your code and can be
> downloaded from www.keil.com
> 
> Size of Blinky, a few hundred bytes, unless you use such a library
> function like printf, then we are immediately talking a couple 
kbytes.
> 
> There is a free compiler (GNU) and if you take ten minutes to search
> this forum you will find many references to that compiler as well. 
One
> warning, the library functions of the GNU are very big and increase
> the size of a program a lot compared to a compilers you have to buy.
> For the application you mention (sounds like a data logger), the GNU
> compiler is perfect, actually the 16k of the Keil compiler might be
> enough to do the function you mentioned. 
> 
> Bob
> 
> --- In lpc2000@yahoogroups.com, "Patrick Doll" <Patrick-doll@g...> 
wrote:
> >
> > Hi,
> > 
> > I have three (easy) questions:
> > 
> > 1.)Is it possible to store Data in the nonvolatile internal Flash 
memory
> > region of the LPC2138FBD64 by a program running on the MCU? I want
> to store
> > serial values coming from the SPI Interface (~100KBytes). Or do I
> need an
> > external memory chip?
> > 
> > 2.)I'm looking for a C-Compiler
> > In the book "The Insiders guide to the Philips ARM7-Based MCUs" 
the
> Keil ARM
> > Compiler is mentioned. Is there any experience with this 
Compiler? Is it
> > freeware? Is it possible to use it for the LPC2138FBD64? Or do you
> suggest
> > another compiler?
> > 
> > 3.)At the moment I'm looking for the right MCU, so the size of the
> program
> > space is a very important part. How much memory is used by a 
simple
> program?
> > (e.g. let an led blink incl. startup code + ...?).
> > 
> > Thank you
> > 
> > -- 
> > Highspeed-Freiheit. Bei GMX supergünstig, z.B. GMX DSL_Cityflat,
> > DSL-Flatrate für nur 4,99 Euro/Monat*  
http://www.gmx.net/de/go/dsl
> >
>

Re: [lpc2000] Re: LPC2138FBD64 - not possible to run from Flash and use IAP?

2005-10-27 by Peter Jakacki

Hi Guille,

Just to let you know that the IAP looks after everything and I had some 
misgivings about having to hand control over to an IAP. But, as I said, 
it looks after everything. I certainly don't get any inadvertent Flash 
corruption happening.

My software runs from Flash and never has a problem with programming it. 
A little side note though, somewhere between the early IAP in the 2106 
and the latest in the 2138 I had problems. My IAP routines were 
reporting a program failure. It turned out I was assuming that R0,R1 
would stay intact as it had originally, but the new IAP does not restore 
them.

Also, I wish Philips would handle the address to sector translate 
though, otherwise the application interface has to worry about it for 
the different cpu sector maps (petty whinge).

*Peter*


Guillermo Prandi wrote:
Show quoted textHide quoted text
> Hi, Bob... I am worried about what you just wrote. I'm in the middle 
> of an urgent project and I took for granted that I can use IAP while 
> my code runs from Flash without giving it a second tought. Can you 
> please explain the concept a little more? I'm reading the LPC2138 
> user's manual at 20.4.10 and it suggests it is possible as long as 
> you disable interrupts while using IAP (or make interrupts to run 
> from RAM).

Re: LPC2138FBD64 - not possible to run from Flash and use IAP?

2005-10-27 by Guillermo Prandi

This is good news to me. Thanks, Peter.

Guille

--- In lpc2000@yahoogroups.com, Peter Jakacki <peterjak@t...> wrote:
>
> Hi Guille,
> 
> Just to let you know that the IAP looks after everything and I had 
some 
> misgivings about having to hand control over to an IAP. But, as I 
said, 
> it looks after everything. I certainly don't get any inadvertent 
Flash 
> corruption happening.
> 
> My software runs from Flash and never has a problem with 
programming it. 
> A little side note though, somewhere between the early IAP in the 
2106 
> and the latest in the 2138 I had problems. My IAP routines were 
> reporting a program failure. It turned out I was assuming that 
R0,R1 
> would stay intact as it had originally, but the new IAP does not 
restore 
> them.
> 
> Also, I wish Philips would handle the address to sector translate 
> though, otherwise the application interface has to worry about it 
for 
> the different cpu sector maps (petty whinge).
> 
> *Peter*
> 
> 
> Guillermo Prandi wrote:
> > Hi, Bob... I am worried about what you just wrote. I'm in the 
middle 
> > of an urgent project and I took for granted that I can use IAP 
while 
> > my code runs from Flash without giving it a second tought. Can 
you 
> > please explain the concept a little more? I'm reading the LPC2138 
> > user's manual at 20.4.10 and it suggests it is possible as long 
as 
Show quoted textHide quoted text
> > you disable interrupts while using IAP (or make interrupts to run 
> > from RAM).
>

Re: LPC2138FBD64 - not possible to run from Flash and use IAP?

2005-10-27 by hyperikon

Hi Peter,

> ...and the latest in the 2138 I had problems.

so, you would not suggest to take the 2138 for IAP Programming? I 
wanted to use the 2138 because of its big flash memory. Which parts 
of the lpc2000 family are uncritical for IAP Programming?

thank you,
Patrick

--- In lpc2000@yahoogroups.com, Peter Jakacki <peterjak@t...> wrote:
>
> Hi Guille,
> 
> Just to let you know that the IAP looks after everything and I had 
some 
> misgivings about having to hand control over to an IAP. But, as I 
said, 
> it looks after everything. I certainly don't get any inadvertent 
Flash 
> corruption happening.
> 
> My software runs from Flash and never has a problem with 
programming it. 
> A little side note though, somewhere between the early IAP in the 
2106 
> and the latest in the 2138 I had problems. My IAP routines were 
> reporting a program failure. It turned out I was assuming that 
R0,R1 
> would stay intact as it had originally, but the new IAP does not 
restore 
> them.
> 
> Also, I wish Philips would handle the address to sector translate 
> though, otherwise the application interface has to worry about it 
for 
> the different cpu sector maps (petty whinge).
> 
> *Peter*
> 
> 
> Guillermo Prandi wrote:
> > Hi, Bob... I am worried about what you just wrote. I'm in the 
middle 
> > of an urgent project and I took for granted that I can use IAP 
while 
> > my code runs from Flash without giving it a second tought. Can 
you 
> > please explain the concept a little more? I'm reading the 
LPC2138 
> > user's manual at 20.4.10 and it suggests it is possible as long 
as 
> > you disable interrupts while using IAP (or make interrupts to 
run 
> > from RAM).
>

Re: [lpc2000] Re: LPC2138FBD64 - not possible to run from Flash and use IAP?

2005-10-27 by Richard Duits

Hi Guillermo,

You can call the IAP routines from code running in flash, but you must 
be sure that nothing will use the flash during the IAP call. This 
usually means that you disable interrupts or relocate all your ISP 
routines into RAM.

Richard.


Guillermo Prandi wrote:
Show quoted textHide quoted text
> Hi, Bob... I am worried about what you just wrote. I'm in the middle
> of an urgent project and I took for granted that I can use IAP while
> my code runs from Flash without giving it a second tought. Can you
> please explain the concept a little more? I'm reading the LPC2138
> user's manual at 20.4.10 and it suggests it is possible as long as
> you disable interrupts while using IAP (or make interrupts to run
> from RAM).
>
> Guille
>

Re: [lpc2000] Re: LPC2138FBD64 - not possible to run from Flash and use IAP?

2005-10-27 by Peter Jakacki

There is nothing critical with any of the parts in this regard. This was 
simply a side note to say that I thought I had a problem but it wasn't 
really. All I had to do was to not assume that R0,R1 would not be 
changed, as simple as that. Your code may access the IAP differently but 
mine needed to access the result from the buffer and so was assuming 
that R0 still pointed to that buffer. In my instance I simply reloaded 
R0 and the 2138's IAP works like a breeze now.

Hope that clarifies the previous remark I made.

*Peter*

hyperikon wrote:
> so, you would not suggest to take the 2138 for IAP Programming? I 
> wanted to use the 2138 because of its big flash memory. Which parts 
> of the lpc2000 family are uncritical for IAP Programming?
>   

<n.b. please trim your quotes>

Re: LPC2138FBD64 - not possible to run from Flash and use IAP?

2005-10-27 by Guillermo Prandi

> This usually means that you disable interrupts or relocate
> all your ISP routines into RAM.

Hi, Richard. I don't understand the "relocate all your ISP routines 
into RAM" part. What ISP routines? Shouldn't disabling all interrupts 
be enough?

Guille

--- In lpc2000@yahoogroups.com, Richard Duits <yahoo@r...> wrote:
>
> Hi Guillermo,
> 
> You can call the IAP routines from code running in flash, but you 
must 
> be sure that nothing will use the flash during the IAP call. This 
> usually means that you disable interrupts or relocate all your ISP 
> routines into RAM.
> 
> Richard.
> 
> 
> Guillermo Prandi wrote:
> 
> > Hi, Bob... I am worried about what you just wrote. I'm in the 
middle
> > of an urgent project and I took for granted that I can use IAP 
while
Show quoted textHide quoted text
> > my code runs from Flash without giving it a second tought. Can you
> > please explain the concept a little more? I'm reading the LPC2138
> > user's manual at 20.4.10 and it suggests it is possible as long as
> > you disable interrupts while using IAP (or make interrupts to run
> > from RAM).
> >
> > Guille
> >
>

Re: [lpc2000] Re: LPC2138FBD64 - not possible to run from Flash and use IAP?

2005-10-27 by Richard Duits

Disabling interrupts is enough, but if you do not or cannot do that, you 
have to make
sure that everything used by your interrupt service routines (ISR) is in 
RAM.

ISP should have been ISR, sorry about that.

Richard.


Guillermo Prandi wrote:
Show quoted textHide quoted text
> > This usually means that you disable interrupts or relocate
> > all your ISP routines into RAM.
>
> Hi, Richard. I don't understand the "relocate all your ISP routines
> into RAM" part. What ISP routines? Shouldn't disabling all interrupts
> be enough?
>
> Guille
>
> --- In lpc2000@yahoogroups.com, Richard Duits <yahoo@r...> wrote:
> >
> > Hi Guillermo,
> >
> > You can call the IAP routines from code running in flash, but you
> must
> > be sure that nothing will use the flash during the IAP call. This
> > usually means that you disable interrupts or relocate all your ISP
> > routines into RAM.
> >
> > Richard.
> >
> >
> > Guillermo Prandi wrote:
> >
> > > Hi, Bob... I am worried about what you just wrote. I'm in the
> middle
> > > of an urgent project and I took for granted that I can use IAP
> while
> > > my code runs from Flash without giving it a second tought. Can you
> > > please explain the concept a little more? I'm reading the LPC2138
> > > user's manual at 20.4.10 and it suggests it is possible as long as
> > > you disable interrupts while using IAP (or make interrupts to run
> > > from RAM).
> > >
> > > Guille
> > >
> >

Re: LPC2138FBD64 - not possible to run from Flash and use IAP?

2005-10-27 by Guillermo Prandi

Thanks, Richard.

By the way... Is there any hint or record about how long do IAP 
routines take to prepare/erase/save the flash for any given sector 
size?

Guille

--- In lpc2000@yahoogroups.com, Richard Duits <yahoo@r...> wrote:
>
> Disabling interrupts is enough, but if you do not or cannot do 
that, you 
> have to make
> sure that everything used by your interrupt service routines (ISR) 
is in 
> RAM.
> 
> ISP should have been ISR, sorry about that.
> 
> Richard.
> 
> 
> Guillermo Prandi wrote:
> 
> > > This usually means that you disable interrupts or relocate
> > > all your ISP routines into RAM.
> >
> > Hi, Richard. I don't understand the "relocate all your ISP 
routines
> > into RAM" part. What ISP routines? Shouldn't disabling all 
interrupts
> > be enough?
> >
> > Guille
> >
> > --- In lpc2000@yahoogroups.com, Richard Duits <yahoo@r...> wrote:
> > >
> > > Hi Guillermo,
> > >
> > > You can call the IAP routines from code running in flash, but 
you
> > must
> > > be sure that nothing will use the flash during the IAP call. 
This
> > > usually means that you disable interrupts or relocate all your 
ISP
> > > routines into RAM.
> > >
> > > Richard.
> > >
> > >
> > > Guillermo Prandi wrote:
> > >
> > > > Hi, Bob... I am worried about what you just wrote. I'm in the
> > middle
> > > > of an urgent project and I took for granted that I can use IAP
> > while
> > > > my code runs from Flash without giving it a second tought. 
Can you
> > > > please explain the concept a little more? I'm reading the 
LPC2138
> > > > user's manual at 20.4.10 and it suggests it is possible as 
long as
> > > > you disable interrupts while using IAP (or make interrupts to 
run
Show quoted textHide quoted text
> > > > from RAM).
> > > >
> > > > Guille
> > > >
> > >
>

Re: [lpc2000] Re: LPC2138FBD64 - not possible to run from Flash and use IAP?

2005-10-27 by Tom Walsh

Guillermo Prandi wrote:

>>This usually means that you disable interrupts or relocate
>>all your ISP routines into RAM.
>>    
>>
>
>Hi, Richard. I don't understand the "relocate all your ISP routines 
>into RAM" part. What ISP routines? Shouldn't disabling all interrupts 
>be enough?
>
>Guille
>
>  
>
A lot of Flash does this, while the microcode sequencer inside the flash 
memory is busy working with the flash array, it cannot be disturbed by 
the CPU core reading that same array.  Some flash memories are capable 
of allowing reading while the sequencer is busy writing / erasing some 
other part of the Flash array, but these types of Flash are more of an 
oddity than the normal flash you find.

So, to keep your CPU core running (waiting for the flash to become 
available again), you copy some code into RAM, then call the Flash erase 
/ write IAP routines from there.  This way, your CPU doesn't find itself 
suddenly reading random bytes from the Flash program store.

TomW


-- 
Tom Walsh - WN3L - Embedded Systems Consultant
http://openhardware.net, http://cyberiansoftware.com
"Windows? No thanks, I have work to do..."
----------------------------------------------------

Re: [lpc2000] Re: LPC2138FBD64 - not possible to run from Flash and use IAP?

2005-10-27 by Richard Duits

Tom Walsh wrote:

> A lot of Flash does this, while the microcode sequencer inside the flash
> memory is busy working with the flash array, it cannot be disturbed by
> the CPU core reading that same array.  Some flash memories are capable
> of allowing reading while the sequencer is busy writing / erasing some
> other part of the Flash array, but these types of Flash are more of an
> oddity than the normal flash you find.
>
I think the LPC2xxx have a flash that can read from the last block while 
erasing/programming another block, otherwise the IAP routines had be 
relocated to RAM before using them. It could also be that the LPC2xxx 
has more RAM then specified in the datasheet and that the bootcode 
relocates the IAP routines before jumping to the user program, but this 
seems more expensive and increases the startup time.

> So, to keep your CPU core running (waiting for the flash to become
> available again), you copy some code into RAM, then call the Flash erase
> / write IAP routines from there.  This way, your CPU doesn't find itself
> suddenly reading random bytes from the Flash program store.
>
You don't need any code in RAM to use the IAP routines (it works for 
me). You can call the IAP from flash, you just have to make sure that 
all interrupts are disabled.

> TomW
>
Richard.

Re: LPC2138FBD64 - not possible to run from Flash and use IAP?

2005-10-28 by Karl Olsen

--- In lpc2000@yahoogroups.com, Richard Duits <yahoo@r...> wrote:
> Tom Walsh wrote:
> 
>> A lot of Flash does this, while the microcode sequencer inside the 
>> flash memory is busy working with the flash array, it cannot be
>> disturbed by the CPU core reading that same array.  Some flash
>> memories are capable of allowing reading while the sequencer is
>> busy writing / erasing some other part of the Flash array, but
>> these types of Flash are more of an oddity than the normal flash 
>> you find.
>
> I think the LPC2xxx have a flash that can read from the last block 
> while erasing/programming another block, otherwise the IAP routines 
> had be relocated to RAM before using them. It could also be that
> the LPC2xxx has more RAM then specified in the datasheet and that
> the bootcode relocates the IAP routines before jumping to the user 
> program, but this seems more expensive and increases the startup
> time.

Most probably, the whole flash is unreadable during programming, and 
there is no secret RAM.  The User Manual says that the IAP commands 
for write/erase use the top 32 bytes of RAM for execution, and that 
you shouldn't use these bytes if you use write/erase IAP calls in 
your program.  32 bytes should be enough for some Thumb code that 
starts the write/erase, waits for it to finish, and returns to the 
again accessible IAP code in flash.

Some chips, where none of the flash is reserved for the boot block 
(LPC2131, 2132, 2134, 2136, 2141, 2142, 2144, 2146, and probably 
2101, 2102, 2103) do have an extra "secret" flash for the boot loader 
and IAP, see http://groups.yahoo.com/group/lpc2000/message/4636 .

Karl Olsen

Re: [lpc2000] Re: LPC2138FBD64 - not possible to run from Flash and use IAP?

2005-10-28 by Tom Walsh

Karl Olsen wrote:

>--- In lpc2000@yahoogroups.com, Richard Duits <yahoo@r...> wrote:
>  
>
>>Tom Walsh wrote:
>>
>>    
>>
>>>A lot of Flash does this, while the microcode sequencer inside the 
>>>flash memory is busy working with the flash array, it cannot be
>>>disturbed by the CPU core reading that same array.  Some flash
>>>memories are capable of allowing reading while the sequencer is
>>>busy writing / erasing some other part of the Flash array, but
>>>these types of Flash are more of an oddity than the normal flash 
>>>you find.
>>>      
>>>
>>I think the LPC2xxx have a flash that can read from the last block 
>>while erasing/programming another block, otherwise the IAP routines 
>>had be relocated to RAM before using them. It could also be that
>>the LPC2xxx has more RAM then specified in the datasheet and that
>>the bootcode relocates the IAP routines before jumping to the user 
>>program, but this seems more expensive and increases the startup
>>time.
>>    
>>
>
>Most probably, the whole flash is unreadable during programming, and 
>there is no secret RAM.  The User Manual says that the IAP commands 
>for write/erase use the top 32 bytes of RAM for execution, and that 
>you shouldn't use these bytes if you use write/erase IAP calls in 
>your program.  32 bytes should be enough for some Thumb code that 
>starts the write/erase, waits for it to finish, and returns to the 
>again accessible IAP code in flash.
>
>  
>
Yeah, I did the same with an 80C188 design + 28F010 Flash.  I put a 
small routine in RAM and then called that to do the erase / program 
stuff.  Then I could "stand back" until the Flash was available again 
and return to the caller (write protected block in Flash).

I suspect that is what Philips is doing, copying some Thumb code into 
those 32bytes to "stand back" until the current Flash operation has 
completed.

TomW


-- 
Tom Walsh - WN3L - Embedded Systems Consultant
http://openhardware.net, http://cyberiansoftware.com
"Windows? No thanks, I have work to do..."
----------------------------------------------------

Re: [lpc2000] Re: LPC2138FBD64 - not possible to run from Flash and use IAP?

2005-10-28 by Karl Olsen

---- Original Message ----
Show quoted textHide quoted text
From: "Tom Walsh" <tom@...>
To: <lpc2000@yahoogroups.com>
Sent: Friday, October 28, 2005 7:52 PM
Subject: Re: [lpc2000] Re: LPC2138FBD64 - not possible to run from
Flash and use IAP?

> Karl Olsen wrote:
>
>> Most probably, the whole flash is unreadable during programming, and
>> there is no secret RAM.  The User Manual says that the IAP commands
>> for write/erase use the top 32 bytes of RAM for execution, and that
>> you shouldn't use these bytes if you use write/erase IAP calls in
>> your program.  32 bytes should be enough for some Thumb code that
>> starts the write/erase, waits for it to finish, and returns to the
>> again accessible IAP code in flash.
>
> Yeah, I did the same with an 80C188 design + 28F010 Flash.  I put a
> small routine in RAM and then called that to do the erase / program
> stuff.  Then I could "stand back" until the Flash was available again
> and return to the caller (write protected block in Flash).
>
> I suspect that is what Philips is doing, copying some Thumb code into
> those 32bytes to "stand back" until the current Flash operation has
> completed.

They could have been even smarter.  They could have pushed the 32 bytes code 
on the stack and executed them from there.  The IAP code already requires 
128 bytes of stack space, and I guess that upping this to 160 bytes and 
avoiding the top-of-RAM requirement would bite fewer people.

In addition, an IAP entry for ARM mode would have been nice too.  If you 
have an ARM-only application, you now have to either:

1. Enable interworking, and its associated overhead, and do the function 
pointer call as mentioned in the manual, or

2. Add something like this to an .s file (GNU gas):

  .global CallIAP
  .func   CallIAP
CallIAP:
  ldr  r12, =0x7FFFFFF1
  bx  r12
  .size CallIAP, . - CallIAP
  .endfunc

and in a .c or .h file:
void CallIAP (unsigned int *cmd, unsigned int *resp);

With an ARM mode IAP entry in the boot block (which would consist of the two 
instructions in method 2), you could use method 1 but without having to 
enable interworking.  This could also save some users' head scratching.

(Yes, these are suggestions for philips_apps, but I guess too late.)

Karl Olsen

Re: LPC2138FBD64 - not possible to run from Flash and use IAP?

2005-10-29 by Guillermo Prandi

Karl, I'm an LPC newbie so please excuse my silly question but, why 
not just...?

void (*CallIAP)(unsigned int *cmd, unsigned int *resp) = 0x7ffffff1;

void My Func()
{
   .
   .
   CallIAP(cmd, resp);
   .
   .
}

What does the assembler routine you wrote do different from this?

Guille

--- In lpc2000@yahoogroups.com, "Karl Olsen" <kro@p...> wrote:
>
> ---- Original Message ----
> From: "Tom Walsh" <tom@o...>
> To: <lpc2000@yahoogroups.com>
> Sent: Friday, October 28, 2005 7:52 PM
> Subject: Re: [lpc2000] Re: LPC2138FBD64 - not possible to run from
> Flash and use IAP?
> 
> > Karl Olsen wrote:
> >
> >> Most probably, the whole flash is unreadable during programming, 
and
> >> there is no secret RAM.  The User Manual says that the IAP 
commands
> >> for write/erase use the top 32 bytes of RAM for execution, and 
that
> >> you shouldn't use these bytes if you use write/erase IAP calls in
> >> your program.  32 bytes should be enough for some Thumb code that
> >> starts the write/erase, waits for it to finish, and returns to 
the
> >> again accessible IAP code in flash.
> >
> > Yeah, I did the same with an 80C188 design + 28F010 Flash.  I put 
a
> > small routine in RAM and then called that to do the erase / 
program
> > stuff.  Then I could "stand back" until the Flash was available 
again
> > and return to the caller (write protected block in Flash).
> >
> > I suspect that is what Philips is doing, copying some Thumb code 
into
> > those 32bytes to "stand back" until the current Flash operation 
has
> > completed.
> 
> They could have been even smarter.  They could have pushed the 32 
bytes code 
> on the stack and executed them from there.  The IAP code already 
requires 
> 128 bytes of stack space, and I guess that upping this to 160 bytes 
and 
> avoiding the top-of-RAM requirement would bite fewer people.
> 
> In addition, an IAP entry for ARM mode would have been nice too.  
If you 
> have an ARM-only application, you now have to either:
> 
> 1. Enable interworking, and its associated overhead, and do the 
function 
> pointer call as mentioned in the manual, or
> 
> 2. Add something like this to an .s file (GNU gas):
> 
>   .global CallIAP
>   .func   CallIAP
> CallIAP:
>   ldr  r12, =0x7FFFFFF1
>   bx  r12
>   .size CallIAP, . - CallIAP
>   .endfunc
> 
> and in a .c or .h file:
> void CallIAP (unsigned int *cmd, unsigned int *resp);
> 
> With an ARM mode IAP entry in the boot block (which would consist 
of the two 
> instructions in method 2), you could use method 1 but without 
having to 
> enable interworking.  This could also save some users' head 
scratching.
Show quoted textHide quoted text
> 
> (Yes, these are suggestions for philips_apps, but I guess too late.)
> 
> Karl Olsen
>

Re: [lpc2000] Re: LPC2138FBD64 - not possible to run from Flash and use IAP?

2005-10-29 by Karl Olsen

---- Original Message ----
Show quoted textHide quoted text
From: "Guillermo Prandi" <yahoo.messenger@...>
To: <lpc2000@yahoogroups.com>
Sent: Saturday, October 29, 2005 2:22 AM
Subject: [lpc2000] Re: LPC2138FBD64 - not possible to run from Flash
and use IAP?

> Karl, I'm an LPC newbie so please excuse my silly question but, why
> not just...?
>
> void (*CallIAP)(unsigned int *cmd, unsigned int *resp) = 0x7ffffff1;
>
> void My Func()
> {
>   .
>   .
>   CallIAP(cmd, resp);
>   .
>   .
> }
>
> What does the assembler routine you wrote do different from this?

The above works when you have enabled interworking.  I think that Keil
always uses interworking.  GCC only uses it when you enable it
by -mthumb-interwork.

With interworking, the compiler always uses the mode-switching BX
instruction for returns and indirect calls.  (For direct calls it uses a
normal BL, and when the caller and callee are different mode, the linker
then inserts a small piece of code between them that switches mode).  Using
BX for returning often produces less efficient code.

Using the CallIAP assembler routine means that you can avoid
-mthumb-interwork, and only use BX in the single place it is needed, i.e.
when calling the IAP entry point (assuming that the whole program is in ARM
mode).

Karl Olsen

Re: LPC2138FBD64 - not possible to run from Flash and use IAP?

2005-10-29 by Guillermo Prandi

I thought that using the msb to switch between ARM/Thumb was common 
to BL and BX. Now I see it's not. Thanks a lot, Karl, because I was 
about to run into that very pit myself!

Guille

--- In lpc2000@yahoogroups.com, "Karl Olsen" <kro@p...> wrote:
>
> ---- Original Message ----
> From: "Guillermo Prandi" <yahoo.messenger@m...>
> To: <lpc2000@yahoogroups.com>
> Sent: Saturday, October 29, 2005 2:22 AM
> Subject: [lpc2000] Re: LPC2138FBD64 - not possible to run from Flash
> and use IAP?
> 
> > Karl, I'm an LPC newbie so please excuse my silly question but, 
why
> > not just...?
> >
> > void (*CallIAP)(unsigned int *cmd, unsigned int *resp) = 
0x7ffffff1;
> >
> > void My Func()
> > {
> >   .
> >   .
> >   CallIAP(cmd, resp);
> >   .
> >   .
> > }
> >
> > What does the assembler routine you wrote do different from this?
> 
> The above works when you have enabled interworking.  I think that 
Keil
> always uses interworking.  GCC only uses it when you enable it
> by -mthumb-interwork.
> 
> With interworking, the compiler always uses the mode-switching BX
> instruction for returns and indirect calls.  (For direct calls it 
uses a
> normal BL, and when the caller and callee are different mode, the 
linker
> then inserts a small piece of code between them that switches 
mode).  Using
> BX for returning often produces less efficient code.
> 
> Using the CallIAP assembler routine means that you can avoid
> -mthumb-interwork, and only use BX in the single place it is 
needed, i.e.
> when calling the IAP entry point (assuming that the whole program 
is in ARM
Show quoted textHide quoted text
> mode).
> 
> Karl Olsen
>

Re: LPC2138FBD64 - not possible to run from Flash and use IAP?

2005-10-29 by Guillermo Prandi

Sorry. I meant the lsb.

Guille

--- In lpc2000@yahoogroups.com, "Guillermo Prandi" 
<yahoo.messenger@m...> wrote:
>
> I thought that using the msb to switch between ARM/Thumb was common 
> to BL and BX. Now I see it's not. Thanks a lot, Karl, because I was 
> about to run into that very pit myself!
> 
> Guille
> 
> --- In lpc2000@yahoogroups.com, "Karl Olsen" <kro@p...> wrote:
> >
> > ---- Original Message ----
> > From: "Guillermo Prandi" <yahoo.messenger@m...>
> > To: <lpc2000@yahoogroups.com>
> > Sent: Saturday, October 29, 2005 2:22 AM
> > Subject: [lpc2000] Re: LPC2138FBD64 - not possible to run from 
Flash
> > and use IAP?
> > 
> > > Karl, I'm an LPC newbie so please excuse my silly question but, 
> why
> > > not just...?
> > >
> > > void (*CallIAP)(unsigned int *cmd, unsigned int *resp) = 
> 0x7ffffff1;
> > >
> > > void My Func()
> > > {
> > >   .
> > >   .
> > >   CallIAP(cmd, resp);
> > >   .
> > >   .
> > > }
> > >
> > > What does the assembler routine you wrote do different from 
this?
Show quoted textHide quoted text
> > 
> > The above works when you have enabled interworking.  I think that 
> Keil
> > always uses interworking.  GCC only uses it when you enable it
> > by -mthumb-interwork.
> > 
> > With interworking, the compiler always uses the mode-switching BX
> > instruction for returns and indirect calls.  (For direct calls it 
> uses a
> > normal BL, and when the caller and callee are different mode, the 
> linker
> > then inserts a small piece of code between them that switches 
> mode).  Using
> > BX for returning often produces less efficient code.
> > 
> > Using the CallIAP assembler routine means that you can avoid
> > -mthumb-interwork, and only use BX in the single place it is 
> needed, i.e.
> > when calling the IAP entry point (assuming that the whole program 
> is in ARM
> > mode).
> > 
> > Karl Olsen
> >
>

Philips Presentation...

2005-10-29 by Lasse Madsen

Here's a link to the most recent presentation 

http://www.arrowne.com/arm_dk/ARM_Philips.pdf

This both this group and Leon is mentioned, I think that's pretty cool.

Best regards
Lasse Madsen

Re: Philips Presentation...

2005-11-01 by Eric Engler

--- In lpc2000@yahoogroups.com, "Lasse Madsen" <Lasse.Madsen@E...> wrote:
>
> Here's a link to the most recent presentation 
> 
> http://www.arrowne.com/arm_dk/ARM_Philips.pdf

Cool - USB Host mode in 23xx and 24xx models due in 2006!

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.