EmbeddedRelated.com
Forums
Memfault Beyond the Launch

lpc2148, newlib-lpc, math functions...

Started by tahoe_nanci February 23, 2009
anyone? I posted a couple messages last week and no responses.
Summarizing, I can compile, link, and download the bin/hex onto the
lpc2148. All examples work, until I use math functions. My simple
test is to simply calculate sin(PI) and dump to uart. Any hints? help?

An Engineer's Guide to the LPC2100 Series

On Tue, 24 Feb 2009, tahoe_nanci wrote:

> All examples work, until I use math functions.

Any chance you're using hardware floating point in your compiler? Put a
routine on your UNDEF handler (you should have one on all of 'em while
debugging anyway) and see if that's being raised, and what the offending
instruction is (it'll be at the LR of that handler's register file - 4).

-Kenny

--
Kenneth R. Crudup Sr. SW Engineer, Scott County Consulting, Los Angeles
O: 3630 S. Sepulveda Blvd. #138, L.A., CA 90034-6809 (888) 454-8181
ok, will try tonight when I get home. Thanks. btw, I have explicitly
built my toolchain with the -msoft-float option on my mac. And I am
using the winarm distro on my windows box trying the same thing (I did
not build the toolchain on my windows box).

--- In l..., Kenneth Crudup wrote:
> On Tue, 24 Feb 2009, tahoe_nanci wrote:
>
> > All examples work, until I use math functions.
>
> Any chance you're using hardware floating point in your compiler? Put a
> routine on your UNDEF handler (you should have one on all of 'em while
> debugging anyway) and see if that's being raised, and what the offending
> instruction is (it'll be at the LR of that handler's register file - 4).
>
> -Kenny
>
> --
> Kenneth R. Crudup Sr. SW Engineer, Scott County Consulting, Los Angeles
> O: 3630 S. Sepulveda Blvd. #138, L.A., CA 90034-6809 (888) 454-8181
>

On Tue, 24 Feb 2009, tahoe_nanci wrote:

> Thanks. btw, I have explicitly built my toolchain with the -msoft-float
> option on my mac.

OK, but:

- make sure the *target* is also soft-float (not from your E-mail)

- ensure you're building for the right processor; the 21[34]X are only
ARM7TDMI, arch arm4t(e?)

-Kenny

--
Kenneth R. Crudup Sr. SW Engineer, Scott County Consulting, Los Angeles
O: 3630 S. Sepulveda Blvd. #138, L.A., CA 90034-6809 (888) 454-8181
oh. I am pretty sure I was not adding that to my target build. It
would be awesome if that is my only problem. I've tried with
newlib-lpc, with including my own sbrk, etc.
--- In l..., Kenneth Crudup wrote:
> On Tue, 24 Feb 2009, tahoe_nanci wrote:
>
> > Thanks. btw, I have explicitly built my toolchain with the
-msoft-float
> > option on my mac.
>
> OK, but:
>
> - make sure the *target* is also soft-float (not from your E-mail)
>
> - ensure you're building for the right processor; the 21[34]X are only
> ARM7TDMI, arch arm4t(e?)
>
> -Kenny
>
> --
> Kenneth R. Crudup Sr. SW Engineer, Scott County Consulting, Los Angeles
> O: 3630 S. Sepulveda Blvd. #138, L.A., CA 90034-6809 (888) 454-8181
>

Well, that wasn't it. I have saved the last four builds of the
toolchain on my mac. All had the soft-float setting. So, went back
to the basics and tried the UART_POLLED example. It compiles,
downloads, but doesn't run from the mac. If works fine if compiled
and downloaded with the winarm windows distro. I guess I give up on
my mac for now and move to windows development. I will see if I can
do float math functions today on using winarm.

--- In l..., "tahoe_nanci" wrote:
>
> oh. I am pretty sure I was not adding that to my target build. It
> would be awesome if that is my only problem. I've tried with
> newlib-lpc, with including my own sbrk, etc.
> --- In l..., Kenneth Crudup wrote:
> >
> >
> > On Tue, 24 Feb 2009, tahoe_nanci wrote:
> >
> > > Thanks. btw, I have explicitly built my toolchain with the
> -msoft-float
> > > option on my mac.
> >
> > OK, but:
> >
> > - make sure the *target* is also soft-float (not from your E-mail)
> >
> > - ensure you're building for the right processor; the 21[34]X are only
> > ARM7TDMI, arch arm4t(e?)
> >
> > -Kenny
> >
> > --
> > Kenneth R. Crudup Sr. SW Engineer, Scott County Consulting, Los
Angeles
> > O: 3630 S. Sepulveda Blvd. #138, L.A., CA 90034-6809 (888)
454-8181
>

On Tue, 24 Feb 2009, tahoe_nanci wrote:

> Well, that wasn't it.

Are you raising any exceptions?!

-Kenny

--
Kenneth R. Crudup Sr. SW Engineer, Scott County Consulting, Los Angeles
O: 3630 S. Sepulveda Blvd. #138, L.A., CA 90034-6809 (888) 454-8181
I neglected to write code for the exception handling. I will try
again tonight. In the mean time, I verified that winarm on my windows
machine seems to run all lpc213x_lpc214x examples in the distribution.

So, to test the math functionality there, I took the UART_POLLED
project and made some modifications. I added a syscalls.c with
_sbrk_r method. Well this isn't working on the winarm!!!!

I have to be missing the most obvious thing!

I uploaded uart_polled.zip in the files section. If anyone can tell
me where I am being stupid.
--- In l..., Kenneth Crudup wrote:
> On Tue, 24 Feb 2009, tahoe_nanci wrote:
>
> > Well, that wasn't it.
>
> Are you raising any exceptions?!
>
> -Kenny
>
> --
> Kenneth R. Crudup Sr. SW Engineer, Scott County Consulting, Los Angeles
> O: 3630 S. Sepulveda Blvd. #138, L.A., CA 90034-6809 (888) 454-8181
>

tahoe_nanci wrote:
> I neglected to write code for the exception handling. I will try
> again tonight. In the mean time, I verified that winarm on my windows
> machine seems to run all lpc213x_lpc214x examples in the distribution.
>
> So, to test the math functionality there, I took the UART_POLLED
> project and made some modifications. I added a syscalls.c with
> _sbrk_r method. Well this isn't working on the winarm!!!!
>
> I have to be missing the most obvious thing!

Do you use printf?

Robert

--
http://www.aeolusdevelopment.com/

From the Divided by a Common Language File (Edited to protect the guilty)
ME - "I'd like to get Price and delivery for connector Part # XXXXX"
Dist./Rep - "$X.XX Lead time 37 days"
ME - "Anything we can do about lead time? 37 days seems a bit high."
Dist./Rep - "that is the lead time given because our stock is live....
we currently have stock."
no, I don't use printf. I can't figure it out. oh well. I can do what
I need to do in crossworks, so I guess that's the route I'm going. I
deleted my upload to free your space up. Not much help in this group,
thanks anyways.

--- In l..., Robert Adsett wrote:
>
> tahoe_nanci wrote:
> > I neglected to write code for the exception handling. I will try
> > again tonight. In the mean time, I verified that winarm on my windows
> > machine seems to run all lpc213x_lpc214x examples in the distribution.
> >
> > So, to test the math functionality there, I took the UART_POLLED
> > project and made some modifications. I added a syscalls.c with
> > _sbrk_r method. Well this isn't working on the winarm!!!!
> >
> > I have to be missing the most obvious thing!
>
> Do you use printf?
>
> Robert
>
> --
> http://www.aeolusdevelopment.com/
>
> From the Divided by a Common Language File (Edited to protect the
guilty)
> ME - "I'd like to get Price and delivery for connector Part # XXXXX"
> Dist./Rep - "$X.XX Lead time 37 days"
> ME - "Anything we can do about lead time? 37 days seems a bit high."
> Dist./Rep - "that is the lead time given because our stock is live....
> we currently have stock."
>


Memfault Beyond the Launch