public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
* [ECOS] LPC2214 Porting issue: Garbage data on Serial Console
@ 2006-06-02 16:55 Tom B
  2006-06-05 17:08 ` [ECOS] " Tom B
  0 siblings, 1 reply; 13+ messages in thread
From: Tom B @ 2006-06-02 16:55 UTC (permalink / raw)
  To: ecos-discuss

Hello eCos list,

  In my effort to port eCos to a LPC2214-based board, I'm running into
some troubles with the serial port.  When I load Redboot and execute
it, I get garbage data outputted on the serial port, about 80 bytes.
The execution then gets stuck attempting to read a character from the
console - here is the backtrace at this point:

#0  hal_clock_read (pvalue=0x8101afbc)
    at /opt/ecos/ecos-cvs/packages/hal/arm/lpc2xxx/var/current/src/lpc2xxx_misc.
c:124
#1  0x81006ac0 in delay_us (usecs=0x64)
    at /opt/ecos/ecos-cvs/packages/hal/common/current/src/hal_if.c:226
#2  0x810126fc in cyg_hal_plf_serial_getc_timeout (__ch_data=0x81018cdc,
    ch=0x8101b04f "\201dù\001\201\001") at hal_if.h:639
#3  0x8100fe6c in mon_read_char_with_timeout (
    c=0x8101b04f "\201dù\001\201\001") at hal_if.h:335
#4  0x81010114 in $a ()
    at /opt/ecos/ecos-cvs/packages/redboot/current/src/io.c:386
#5  0x81010114 in $a ()
    at /opt/ecos/ecos-cvs/packages/redboot/current/src/io.c:386

The key is frame 2, as 1 and 0 are just delaying before polling the
device again for data.  If I attempt to enter characters, it is not
detected by the program.

If I build eCos as a library, and build and link a "hello world" app,
I get no serial output, but instead for some reason my call to printf
prompts a chain of events that ends up calling cyg_hal_plf_serial_getc
(which I find odd, since I'm telling it to print to the console, not
read from the console..).  Here is the stack trace when it is waiting
for a character, initially prompted by a call to printf:

(arm-gdb) bt
#0  cyg_hal_plf_serial_getc_nonblock (__ch_data=0xe0010000,
    ch=0x81027cbb "_\217")
    at /opt/ecos/ecos-cvs/packages/hal/arm/lpc2xxx/var/current/src/hal_diag.c:12
4
#1  0x81012a38 in cyg_hal_plf_serial_getc (__ch_data=0x81021298)
    at /opt/ecos/ecos-cvs/packages/hal/arm/lpc2xxx/var/current/src/hal_diag.c:13
7
#2  0x81003608 in cyg_hal_diag_mangler_gdb_flush (__ch_data=0xe0010000)
    at hal_if.h:311
#3  0x81003a08 in hal_if_diag_write_char (c=0x0) at hal_if.h:305
#4  0x81015c44 in haldiag_putc (chan=0xe0010000, c=0xbb)
    at /opt/ecos/ecos-cvs/packages/io/serial/current/src/common/haldiag.c:114
#5  0x81015200 in serial_write (handle=0xe0010000, _buf=0x81027cbb,
    len=0x81027d7c)
    at /opt/ecos/ecos-cvs/packages/io/serial/current/src/common/serial.c:331
#6  0x81012f78 in cyg_io_write (handle=0xe0010000, buf=0x81027cbb, len=0x60)
    at /opt/ecos/ecos-cvs/packages/io/common/current/src/iosys.c:178
#7  0x81015978 in tty_write (handle=0xe0010000, _buf=0x81027cbb,
    len=0x81027e00)
    at /opt/ecos/ecos-cvs/packages/io/serial/current/src/common/tty.c:190
#8  0x81012f78 in cyg_io_write (handle=0xe0010000, buf=0x81027cbb, len=0x60)
    at /opt/ecos/ecos-cvs/packages/io/common/current/src/iosys.c:178
#9  0x8101156c in Cyg_StdioStream::flush_output_unlocked (this=0x81025b14)
    at io.inl:229
#10 0x81012300 in Cyg_StdioStream::write (this=0x81025b14,
    buffer=0x8101c9eb "", buffer_length=0x0, bytes_written=0x81027f08)
    at /opt/ecos/ecos-cvs/packages/language/c/libc/stdio/current/src/common/stre
am.cxx:701
#11 0x81006534 in $a ()
    at /opt/ecos/ecos-cvs/packages/language/c/libc/stdio/current/src/output/vfnp
rintf.cxx:277
#12 0x81006534 in $a ()
    at /opt/ecos/ecos-cvs/packages/language/c/libc/stdio/current/src/output/vfnp
rintf.cxx:277
(arm-gdb)

Again, entering a character does not force the application to exit the
getc call (I am sure of this, I set a breakpoint following the getc).

I know that the serial port and interface to the computer is working
fine, as I've tested both with loopback devices and also I have code
that manually manipulates the LPC registers to interact with the
serial port, and both work fine.

Anyone have any suggestions on how I can debug this problem, or ideas
on what's causing it?

Cheers,
Tom Burns

--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

^ permalink raw reply	[flat|nested] 13+ messages in thread
* Re: [ECOS] Dynamic IP/DHCP/Routing the 'right way'
@ 2006-06-06 12:38 FALL
  2006-06-06 21:26 ` Laurie Gellatly
  0 siblings, 1 reply; 13+ messages in thread
From: FALL @ 2006-06-06 12:38 UTC (permalink / raw)
  To: ecos-discuss, laurie.gellatly

I suppose you use LWIP stack. At the end of your mail, you write tat you will do the same for DNS, I don't think that LWIP supports DNS. If you want to change IP/gateway... while your programme is running, i think the best way is to use ioctl functions. Most of  ioctl commands are not supported by LWIP. I think you should chose freebsd stack for your project. Of course LWIP is very light and simple to undestand but freebsd is more complete. you have to make a choice:)
FALL Birahim
Elsys-Design 
PACA

---------- Original Message ----------------------------------
From: "Laurie Gellatly" <laurie.gellatly@netic.com>
Reply-To: <laurie.gellatly@netic.com>
Date:  Tue, 6 Jun 2006 20:36:52 +1000

>Hi All,
>I'll be working with the PHYTEC2294 board in preparation to using the
>Philips LPC2210 and LPC2102 in production.
>
>My project will allow the user to change the various IP settings
>(Address/Mask/gateway/DHCP) while the system is running. I.E. address
>and mask are updated (old addresses are deleted).
>Gateway changes cause the default route to be updated. DHCP can be
>turned off/on.
>
>I've found some older posts about this and tried them. Maybe I missed
>something but so far I've not found a single solution that covers all my
>needs. Is there such a solution or is there a 'right way' to achieve
>this?
>
>Also saw a post about using an incoming packet to learn the IP when the
>device is ping'ed for instance. This could be quite useful as well.
>Anyone have this in code already or can at least point me in the right
>direction of what to do?
>
>After these I'll need to do the same for NTP and DNS.
>
>Cheers			...Laurie:{)
>
>
>-- 
>Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
>and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss
>
>
 




________________________________________________________________
Sent via the WebMail system at elsys-design.com


 
                   

-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2006-07-31  7:32 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-06-02 16:55 [ECOS] LPC2214 Porting issue: Garbage data on Serial Console Tom B
2006-06-05 17:08 ` [ECOS] " Tom B
2006-06-06 10:37   ` [ECOS] Dynamic IP/DHCP/Routing the 'right way' Laurie Gellatly
2006-06-06 10:56     ` Andrew Lunn
2006-06-06 11:09       ` Laurie Gellatly
2006-06-06 11:19         ` Andrew Lunn
2006-07-28 21:30           ` Joe Porthouse
2006-07-28 21:59             ` Laurie Gellatly
2006-07-29  1:52               ` Joe Porthouse
2006-07-31  7:32                 ` Laurie Gellatly
2006-06-06 11:16   ` [ECOS] eCos meets SHTTPD (web server) Laurie Gellatly
2006-06-06 12:38 [ECOS] Dynamic IP/DHCP/Routing the 'right way' FALL
2006-06-06 21:26 ` Laurie Gellatly

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).