public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
* [ECOS] ecos application problem
@ 2007-08-23 11:28 albert prasetyo
  2007-08-23 22:47 ` Paul D. DeRocco
       [not found] ` <029201c7e5d3$ce0bd2d0$887ba8c0@PAULD>
  0 siblings, 2 replies; 13+ messages in thread
From: albert prasetyo @ 2007-08-23 11:28 UTC (permalink / raw)
  To: ecos-discuss

Hi everyone;
I am a newbie in redboot and ecos. Currently I am developing redboot
for AT91RM9200 board (ARM9). I am able to develop redboot (RAM)
version for this board but unable to run the application (app.srec).

Source code of app.srec:
#include <stdio.h>

int main(void)

{

printf("1\n");

return 0;

}


This is the message generated by redboot:

RedBoot> load -m y
CCEntry point: 0x21000040, address range: 0x21000000-0x210086c4
xyzModem - CRC mode, 2(SOH)/102(STX)/0(CAN) packets, 4 retries
RedBoot> go
$O310A#24

It somehow managed to print '1' but in ASCII mode. I don't know where
my configuration goes wrong.
Any help is much appreciated.

Thanks in advance;
Albert P

-- 
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] ecos application problem
  2007-08-23 11:28 [ECOS] ecos application problem albert prasetyo
@ 2007-08-23 22:47 ` Paul D. DeRocco
       [not found] ` <029201c7e5d3$ce0bd2d0$887ba8c0@PAULD>
  1 sibling, 0 replies; 13+ messages in thread
From: Paul D. DeRocco @ 2007-08-23 22:47 UTC (permalink / raw)
  To: 'ecos-discuss'

> From: albert prasetyo
> 
> I am a newbie in redboot and ecos. Currently I am developing
> redboot for AT91RM9200 board (ARM9). I am able to develop 
> redboot (RAM) version for this board but unable to run the 
> application (app.srec).
> 
> Source code of app.srec:
> #include <stdio.h>
> 
> int main(void)
> 
> {
> 
> printf("1\n");
> 
> return 0;
> 
> }
> 
> 
> This is the message generated by redboot:
> 
> RedBoot> load -m y
> CCEntry point: 0x21000040, address range:
> 0x21000000-0x210086c4 xyzModem - CRC mode, 
> 2(SOH)/102(STX)/0(CAN) packets, 4 retries
> RedBoot> go
> $O310A#24
> 
> It somehow managed to print '1' but in ASCII mode. I don't
> know where my configuration goes wrong. Any help is much appreciated.

That's a GDB packet, containing your output in hex (310A is "1\n"). This is
what you get when your program is sharing an interface with the GDB stubs.
If you communicated with the board using GDB, and loaded and ran the app
that way, GDB would display your output correctly in its console pane. Or if
you sent your output to a different device, it would look normal.

-- 

Ciao,               Paul D. DeRocco
Paul                mailto:pderocco@ix.netcom.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

* Re: [ECOS] ecos application problem
       [not found] ` <029201c7e5d3$ce0bd2d0$887ba8c0@PAULD>
@ 2007-08-24  2:30   ` albert prasetyo
  2007-08-24  3:53     ` Paul D. DeRocco
  2007-08-24  4:57     ` Alexey Shusharin
  0 siblings, 2 replies; 13+ messages in thread
From: albert prasetyo @ 2007-08-24  2:30 UTC (permalink / raw)
  To: Paul D. DeRocco; +Cc: ecos-discuss

Hi Paul;
Thanks for the reply. According to your remarks, is it means that
I need to exclude GDB stubs in HAL (redboot template)?
(i.e. disable CYDBG_HAL_DEBUG_GDB_INCLUDE_STUBS)
I tried to do that but the output is still the same.
I communicate with the board using hyperterminal.
Thank you for your attention.

Regards;
Albert P

On 8/24/07, Paul D. DeRocco <pderocco@ix.netcom.com> wrote:
> > From: albert prasetyo
> >
> > I am a newbie in redboot and ecos. Currently I am developing
> > redboot for AT91RM9200 board (ARM9). I am able to develop
> > redboot (RAM) version for this board but unable to run the
> > application (app.srec).
> >
> > Source code of app.srec:
> > #include <stdio.h>
> >
> > int main(void)
> >
> > {
> >
> > printf("1\n");
> >
> > return 0;
> >
> > }
> >
> >
> > This is the message generated by redboot:
> >
> > RedBoot> load -m y
> > CCEntry point: 0x21000040, address range:
> > 0x21000000-0x210086c4 xyzModem - CRC mode,
> > 2(SOH)/102(STX)/0(CAN) packets, 4 retries
> > RedBoot> go
> > $O310A#24
> >
> > It somehow managed to print '1' but in ASCII mode. I don't
> > know where my configuration goes wrong. Any help is much appreciated.
>
> That's a GDB packet, containing your output in hex (310A is "1\n"). This is
> what you get when your program is sharing an interface with the GDB stubs.
> If you communicated with the board using GDB, and loaded and ran the app
> that way, GDB would display your output correctly in its console pane. Or if
> you sent your output to a different device, it would look normal.
>
> --
>
> Ciao,               Paul D. DeRocco
> Paul                mailto:pderocco@ix.netcom.com
> >
> > Thanks in advance;
> > Albert P
> >
> > --
> > Before posting, please read the FAQ:
> > http://ecos.sourceware.org/fom/ecos
> > and search the list archive:
> > http://ecos.sourceware.org/ml/ecos-discuss
> >
>
>

-- 
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] ecos application problem
  2007-08-24  2:30   ` albert prasetyo
@ 2007-08-24  3:53     ` Paul D. DeRocco
  2007-08-24  6:06       ` Sergei Gavrikov
  2007-08-24  4:57     ` Alexey Shusharin
  1 sibling, 1 reply; 13+ messages in thread
From: Paul D. DeRocco @ 2007-08-24  3:53 UTC (permalink / raw)
  To: 'albert prasetyo', 'ecos-discuss'

> From: albert prasetyo [mailto:prasetyoalbert@gmail.com] 
> 
> Thanks for the reply. According to your remarks, is it means 
> that I need to exclude GDB stubs in HAL (redboot template)? 
> (i.e. disable CYDBG_HAL_DEBUG_GDB_INCLUDE_STUBS)
> I tried to do that but the output is still the same.
> I communicate with the board using hyperterminal.

I'm no expert in this area, because my ARM7 board has a second serial port
that I use for my application, leaving the first for the GDB stubs. I'm
under the impression that the application accesses the serial port through
the virtual vector table, so it is still the Redboot code in flash that is
doing the output mangling. Maybe someone else can point to the particular
option that makes the application not use the VV table for serial I/O. Of
course, this would prevent serial debugging.

-- 

Ciao,               Paul D. DeRocco
Paul                mailto:pderocco@ix.netcom.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

* Re: [ECOS] ecos application problem
  2007-08-24  2:30   ` albert prasetyo
  2007-08-24  3:53     ` Paul D. DeRocco
@ 2007-08-24  4:57     ` Alexey Shusharin
  1 sibling, 0 replies; 13+ messages in thread
From: Alexey Shusharin @ 2007-08-24  4:57 UTC (permalink / raw)
  To: albert prasetyo; +Cc: Paul D. DeRocco, ecos-discuss

Hi Albert

I think you should look at eCos documentation about COMM channels:
http://ecos.sourceware.org/docs-latest/ref/hal-calling-if.html

regards
Alexey

В Птн, 24/08/2007 в 10:30 +0800, albert prasetyo пишет:
> Hi Paul;
> Thanks for the reply. According to your remarks, is it means that
> I need to exclude GDB stubs in HAL (redboot template)?
> (i.e. disable CYDBG_HAL_DEBUG_GDB_INCLUDE_STUBS)
> I tried to do that but the output is still the same.
> I communicate with the board using hyperterminal.
> Thank you for your attention.
> 
> Regards;
> Albert P
> 
> On 8/24/07, Paul D. DeRocco <pderocco@ix.netcom.com> wrote:
> > > From: albert prasetyo
> > >
> > > I am a newbie in redboot and ecos. Currently I am developing
> > > redboot for AT91RM9200 board (ARM9). I am able to develop
> > > redboot (RAM) version for this board but unable to run the
> > > application (app.srec).
> > >
> > > Source code of app.srec:
> > > #include <stdio.h>
> > >
> > > int main(void)
> > >
> > > {
> > >
> > > printf("1\n");
> > >
> > > return 0;
> > >
> > > }
> > >
> > >
> > > This is the message generated by redboot:
> > >
> > > RedBoot> load -m y
> > > CCEntry point: 0x21000040, address range:
> > > 0x21000000-0x210086c4 xyzModem - CRC mode,
> > > 2(SOH)/102(STX)/0(CAN) packets, 4 retries
> > > RedBoot> go
> > > $O310A#24
> > >
> > > It somehow managed to print '1' but in ASCII mode. I don't
> > > know where my configuration goes wrong. Any help is much appreciated.
> >
> > That's a GDB packet, containing your output in hex (310A is "1\n"). This is
> > what you get when your program is sharing an interface with the GDB stubs.
> > If you communicated with the board using GDB, and loaded and ran the app
> > that way, GDB would display your output correctly in its console pane. Or if
> > you sent your output to a different device, it would look normal.
> >
> > --
> >
> > Ciao,               Paul D. DeRocco
> > Paul                mailto:pderocco@ix.netcom.com
> > >
> > > Thanks in advance;
> > > Albert P
> > >
> > > --
> > > Before posting, please read the FAQ:
> > > http://ecos.sourceware.org/fom/ecos
> > > and search the list archive:
> > > http://ecos.sourceware.org/ml/ecos-discuss
> > >
> >
> >
> 


-- 
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] ecos application problem
  2007-08-24  3:53     ` Paul D. DeRocco
@ 2007-08-24  6:06       ` Sergei Gavrikov
  2007-08-27  5:53         ` albert prasetyo
  0 siblings, 1 reply; 13+ messages in thread
From: Sergei Gavrikov @ 2007-08-24  6:06 UTC (permalink / raw)
  To: Paul D. DeRocco; +Cc: 'albert prasetyo', 'ecos-discuss'

Paul D. DeRocco writes:
> > From: albert prasetyo [mailto:prasetyoalbert@gmail.com] 
> > 
> > Thanks for the reply. According to your remarks, is it means 
> > that I need to exclude GDB stubs in HAL (redboot template)? 
> > (i.e. disable CYDBG_HAL_DEBUG_GDB_INCLUDE_STUBS)
> > I tried to do that but the output is still the same.
> > I communicate with the board using hyperterminal.
> 
> I'm no expert in this area, because my ARM7 board has a second serial port
> that I use for my application, leaving the first for the GDB stubs. I'm
> under the impression that the application accesses the serial port through
> the virtual vector table, so it is still the Redboot code in flash that is
> doing the output mangling. Maybe someone else can point to the particular
> option that makes the application not use the VV table for serial I/O. Of
> course, this would prevent serial debugging.

Try to import this

cat <<_EOF | ecosconfig import /dev/stdin
cdl_option CYGSEM_HAL_USE_ROM_MONITOR {inferred_value 0 Generic};
cdl_option CYGSEM_HAL_DIAG_MANGLER {user_value None};
_EOF

before the build the eCos stuff

	Sergei


> 
> -- 
> 
> Ciao,               Paul D. DeRocco
> Paul                mailto:pderocco@ix.netcom.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

* Re: [ECOS] ecos application problem
  2007-08-24  6:06       ` Sergei Gavrikov
@ 2007-08-27  5:53         ` albert prasetyo
  2007-08-27  6:28           ` Sergei Gavrikov
  0 siblings, 1 reply; 13+ messages in thread
From: albert prasetyo @ 2007-08-27  5:53 UTC (permalink / raw)
  To: Sergei Gavrikov; +Cc: Paul D. DeRocco, ecos-discuss

Hi all;

>
> Try to import this
>
> cat <<_EOF | ecosconfig import /dev/stdin
> cdl_option CYGSEM_HAL_USE_ROM_MONITOR {inferred_value 0 Generic};
> cdl_option CYGSEM_HAL_DIAG_MANGLER {user_value None};
> _EOF
>
> before the build the eCos stuff

I have applied above, but still can't get the expected result. The
output of redboot
become as follows:

RedBoot> load -m y
CCEntry point: 0x21000040, address range: 0x21000000-0x210082b0
xyzModem - CRC mode, 3(SOH)/98(STX)/0(CAN) packets, 4 retries
RedBoot> go

After go command was executed, the redboot seems to 'hang' . I think redboot
expected some input from user. I tried to input '+' but nothing happened.

I read from other threads and conclude that it is possible to run
application by disabling debug channel. I intend to do it by disable
'debug serial port'
(i.e. CYGNUM_HAL_VIRTUAL_VECTOR_DEBUG_CHANNEL) but cannot do it
(cannot find CYGPRI_HAL_VIRTUAL_VECTOR_DEBUG_CHANNEL_CONFIGURABLE).
Is it the right thing to do?

By the way I run my redboot on RAM mode, maybe it's the cause the
update can't work. When I try to use redboot in ROM mode, even the
application cannot be downloaded at all. (as described by Henry Wong
in this link :
http://ecos.sourceware.org/ml/ecos-discuss/2006-05/msg00047.html )
Thank you for your attention.

Regards;
Albert P

-- 
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] ecos application problem
  2007-08-27  5:53         ` albert prasetyo
@ 2007-08-27  6:28           ` Sergei Gavrikov
  2007-09-01  9:35             ` albert prasetyo
  0 siblings, 1 reply; 13+ messages in thread
From: Sergei Gavrikov @ 2007-08-27  6:28 UTC (permalink / raw)
  To: albert prasetyo; +Cc: ecos-discuss

albert prasetyo writes:
> Hi all;
> 
> >
> > Try to import this
> >
> > cat <<_EOF | ecosconfig import /dev/stdin
> > cdl_option CYGSEM_HAL_USE_ROM_MONITOR {inferred_value 0 Generic};
> > cdl_option CYGSEM_HAL_DIAG_MANGLER {user_value None};
> > _EOF
> >
> > before the build the eCos stuff
> 
> I have applied above, but still can't get the expected result. The
> output of redboot
> become as follows:
> 
> RedBoot> load -m y
> CCEntry point: 0x21000040, address range: 0x21000000-0x210082b0
> xyzModem - CRC mode, 3(SOH)/98(STX)/0(CAN) packets, 4 retries
> RedBoot> go
> 
> After go command was executed, the redboot seems to 'hang' . I think redboot
                                 ^^^^^^^^^^^^^^^^^^^^^^^^^^

Do you check an output on both channels? Read this recent thread (Gary
did a tip about similar issue):

http://ecos.sourceware.org/ml/ecos-discuss/2007-07/msg00204.html

Has your target any LED? Make it to blink when application is run/done.


	Sergei


> expected some input from user. I tried to input '+' but nothing happened.
> 
> I read from other threads and conclude that it is possible to run
> application by disabling debug channel. I intend to do it by disable
> 'debug serial port'
> (i.e. CYGNUM_HAL_VIRTUAL_VECTOR_DEBUG_CHANNEL) but cannot do it
> (cannot find CYGPRI_HAL_VIRTUAL_VECTOR_DEBUG_CHANNEL_CONFIGURABLE).
> Is it the right thing to do?
> 
> By the way I run my redboot on RAM mode, maybe it's the cause the
> update can't work. When I try to use redboot in ROM mode, even the
> application cannot be downloaded at all. (as described by Henry Wong
> in this link :
> http://ecos.sourceware.org/ml/ecos-discuss/2006-05/msg00047.html )
> Thank you for your attention.
> 
> Regards;
> Albert P
> 


-- 
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] ecos application problem
  2007-08-27  6:28           ` Sergei Gavrikov
@ 2007-09-01  9:35             ` albert prasetyo
  2007-09-01 17:49               ` Sergei Gavrikov
  0 siblings, 1 reply; 13+ messages in thread
From: albert prasetyo @ 2007-09-01  9:35 UTC (permalink / raw)
  To: Sergei Gavrikov; +Cc: ecos-discuss

Hi Sergey;
Thank you for your info. It provides me further understanding on how redboot
and ecos work.
Actually, my board (AT91RM9200) is designed to communicate through
PC using 1 serial port only (DBGU port). Is there any way to print
"Hello World" (i.e. Application message) using only one port?
Moreover, my board does not have spare LED, the LEDs are only used
to signal whether the board is turned on or not and Ethernet connection.
Thank you for your attention.

Regards;
Albert P

On 8/27/07, Sergei Gavrikov <w3sg@softhome.net> wrote:
> albert prasetyo writes:
> > Hi all;
> >
> > >
> > > Try to import this
> > >
> > > cat <<_EOF | ecosconfig import /dev/stdin
> > > cdl_option CYGSEM_HAL_USE_ROM_MONITOR {inferred_value 0 Generic};
> > > cdl_option CYGSEM_HAL_DIAG_MANGLER {user_value None};
> > > _EOF
> > >
> > > before the build the eCos stuff
> >
> > I have applied above, but still can't get the expected result. The
> > output of redboot
> > become as follows:
> >
> > RedBoot> load -m y
> > CCEntry point: 0x21000040, address range: 0x21000000-0x210082b0
> > xyzModem - CRC mode, 3(SOH)/98(STX)/0(CAN) packets, 4 retries
> > RedBoot> go
> >
> > After go command was executed, the redboot seems to 'hang' . I think redboot
>                                  ^^^^^^^^^^^^^^^^^^^^^^^^^^
>
> Do you check an output on both channels? Read this recent thread (Gary
> did a tip about similar issue):
>
> http://ecos.sourceware.org/ml/ecos-discuss/2007-07/msg00204.html
>
> Has your target any LED? Make it to blink when application is run/done.
>
>
>         Sergei

-- 
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] ecos application problem
  2007-09-01  9:35             ` albert prasetyo
@ 2007-09-01 17:49               ` Sergei Gavrikov
  2007-09-03  3:58                 ` albert prasetyo
  0 siblings, 1 reply; 13+ messages in thread
From: Sergei Gavrikov @ 2007-09-01 17:49 UTC (permalink / raw)
  To: albert prasetyo; +Cc: ecos-discuss

On Sat, Sep 01, 2007 at 05:35:47PM +0800, albert prasetyo wrote:
> Hi Sergey;
> Thank you for your info. It provides me further understanding on how
> redboot and ecos work.  Actually, my board (AT91RM9200) is designed to
> communicate through PC using 1 serial port only (DBGU port). Is there
> any way to print "Hello World" (i.e. Application message) using only
> one port?  Moreover, my board does not have spare LED, the LEDs are
> only used to signal whether the board is turned on or not and Ethernet
> connection.  Thank you for your attention.

Be sure! I don't know your hardware, sorry. But, If I remember, you ran
that eCos application using the RedBoot 'go' command and saw a mangled
output, is it right? So, your eCos application works! Did you try to use
GDB to download and run any eCos test? If you have a working RedBoot for
your target and it (RedBoot) contains the GDB interface (cdl_interface
CYGINT_HAL_DEBUG_GDB_STUBS), try to use even GDB 5.3 from eCosCentric.

Just a conspectus (1-2-3), if you did install eCos stuff on Linux box...

1. Build eCos

ecosconfig new "your_target_name" minimal \
&& ecosconfig tree \
&& make -s

2. Build a minimalist 'hello'

cat <<_EOF>hello.c
cyg_start(){diag_printf("hello, world!\n");}
_EOF

make hello CFLAGS='-O0 -g' LDFLAGS='-Linstall/lib -Ttarget.ld -nostdlib'

3. Run that 'hello' using GDB

arm-elf-gdb -nw -nx -q hello

Note: at the least, it's needed to connect itself using the GDB remote
protocol (suppose, /dev/ttyS0 is your port), reset a board before to do
this.

On GDB promp (gdb) just try to enter commands (again, it's 1-2-3)

target remote /dev/ttyS0
load
cont

Are you seeing something now? 

If you aren't... Sorry. They talk that M$ + Cygwin + Insight + Java +
Eclipse IDE + ... are good things for beginners. Sorry, I don't believe
them.  They cannot say you, Let's do '1-2-3' and get the result. They
offer a tour is containing a lot of screenshots...

But, it's pretty simple just to grab and unpack ONE gnutools tarball for
Linux (ftp://ecos.sourceware.org/pub/ecos/gnutools/i386linux) and get
the result in a few minutes.


	Sergei


-- 
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] ecos application problem
  2007-09-01 17:49               ` Sergei Gavrikov
@ 2007-09-03  3:58                 ` albert prasetyo
  2007-09-03  7:05                   ` Sergei Gavrikov
  0 siblings, 1 reply; 13+ messages in thread
From: albert prasetyo @ 2007-09-03  3:58 UTC (permalink / raw)
  To: Sergei Gavrikov; +Cc: ecos-discuss

Hi Sergei;
Thank you very much! Now everything just works.
It is arguable that the cause of my problem (i.e. mangled output) is the cflags.
The original compiler flags that i used is '-I$(INSTALL_DIR)/include'
replace it with your recommended cflags and my application runs properly.
Allow me to reproduce what I did earlier:
ROM mode
Using cygwin and hyperterminal in Windows environment:
1) Compile redboot using AT91RM9200 template with redboot packages.
2) Using ROM mode and without any Ethernet package, I modify nothing
else and start building the library.
3) put the redboot on the board
4) For building application library, repeat step 1 and 2 (only mode used is RAM)
5) start cygwin, go to ecos example folder, and open makefile
6) change the CFLAGS variable to '-O0 -g'
7) compile the application (e.g. hello.c from the ecos example, havent
tried Sergei's hello.c)
8) As Sergei advised, start gdb (only now from cygwin)
arm-elf-gdb -nw -nx -q hello
(gdb) set remotebaud 115200
(gdb) target remote /dev/com1
......//some characters printed (in my case "0x100054b4 in ?? ()")
(gdb) load
loading section .rom_vectors, size xxx lma yyy
loading section .text, size xxx lma yyy
loading section .rodata, size xxx lma yyy
loading section .data, size xxx lma yyy
start address xxx, load size yyy
transfer rate: xxx bits/sec, yyy bytes/write.
(gdb) cont
continuing.

Hello ecos World!

Hope this will help anyone that encounter same problem as me.

On 9/2/07, Sergei Gavrikov <w3sg@softhome.net> wrote:
> On Sat, Sep 01, 2007 at 05:35:47PM +0800, albert prasetyo wrote:
> > Hi Sergey;
> > Thank you for your info. It provides me further understanding on how
> > redboot and ecos work.  Actually, my board (AT91RM9200) is designed to
> > communicate through PC using 1 serial port only (DBGU port). Is there
> > any way to print "Hello World" (i.e. Application message) using only
> > one port?  Moreover, my board does not have spare LED, the LEDs are
> > only used to signal whether the board is turned on or not and Ethernet
> > connection.  Thank you for your attention.
>
> Be sure! I don't know your hardware, sorry. But, If I remember, you ran
> that eCos application using the RedBoot 'go' command and saw a mangled
> output, is it right? So, your eCos application works! Did you try to use
> GDB to download and run any eCos test? If you have a working RedBoot for
> your target and it (RedBoot) contains the GDB interface (cdl_interface
> CYGINT_HAL_DEBUG_GDB_STUBS), try to use even GDB 5.3 from eCosCentric.
>
> Just a conspectus (1-2-3), if you did install eCos stuff on Linux box...
>
> 1. Build eCos
>
> ecosconfig new "your_target_name" minimal \
> && ecosconfig tree \
> && make -s
>
> 2. Build a minimalist 'hello'
>
> cat <<_EOF>hello.c
> cyg_start(){diag_printf("hello, world!\n");}
> _EOF
>
> make hello CFLAGS='-O0 -g' LDFLAGS='-Linstall/lib -Ttarget.ld -nostdlib'
>
> 3. Run that 'hello' using GDB
>
> arm-elf-gdb -nw -nx -q hello
>
> Note: at the least, it's needed to connect itself using the GDB remote
> protocol (suppose, /dev/ttyS0 is your port), reset a board before to do
> this.
>
> On GDB promp (gdb) just try to enter commands (again, it's 1-2-3)
>
> target remote /dev/ttyS0
> load
> cont
>
> Are you seeing something now?
>
> If you aren't... Sorry. They talk that M$ + Cygwin + Insight + Java +
> Eclipse IDE + ... are good things for beginners. Sorry, I don't believe
> them.  They cannot say you, Let's do '1-2-3' and get the result. They
> offer a tour is containing a lot of screenshots...
>
> But, it's pretty simple just to grab and unpack ONE gnutools tarball for
> Linux (ftp://ecos.sourceware.org/pub/ecos/gnutools/i386linux) and get
> the result in a few minutes.
>
>
>        Sergei
>
>

PS: Sergei, when will you come to Singapore? I owe you a treat! =>

Regards;
Albert P

-- 
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] ecos application problem
  2007-09-03  3:58                 ` albert prasetyo
@ 2007-09-03  7:05                   ` Sergei Gavrikov
  2007-09-04  3:27                     ` albert prasetyo
  0 siblings, 1 reply; 13+ messages in thread
From: Sergei Gavrikov @ 2007-09-03  7:05 UTC (permalink / raw)
  To: albert prasetyo; +Cc: ecos-discuss

albert prasetyo writes:
> Hi Sergei;
> Thank you very much! Now everything just works.
> It is arguable that the cause of my problem (i.e. mangled output) is the cflags.

It seems, this is a wrong conclusion. I known no one GCC flag which
occurs mangled output. You set type of diag output when you configure
ecos.ecc. I just did limit CFLAGS sequence because I did demo how to
build a _minimalist_ eCos application.

I sure that CFLAGS='-Iinstall/include -O0 -g' in my 1-2-3 example will
be work too.

Look closely at your build defaults (ecos.ecc): CYGBLD_GLOBAL_CFLAGS,
CYGBLD_GLOBAL_LDFLAGS. You can just quite overwrite those before the
making of the eCos libraries just edited the ecos.ecc. Those flags to
include itself (install/include/pkgconf/ecos.mak) in your final build.
Try to replace -O2 by -O0 optimization flag there when you build debug
image.

	Sergei

> The original compiler flags that i used is '-I$(INSTALL_DIR)/include'
> replace it with your recommended cflags and my application runs properly.
> Allow me to reproduce what I did earlier:
> ROM mode
> Using cygwin and hyperterminal in Windows environment:
> 1) Compile redboot using AT91RM9200 template with redboot packages.
> 2) Using ROM mode and without any Ethernet package, I modify nothing
> else and start building the library.
> 3) put the redboot on the board
> 4) For building application library, repeat step 1 and 2 (only mode used is RAM)
> 5) start cygwin, go to ecos example folder, and open makefile
> 6) change the CFLAGS variable to '-O0 -g'
> 7) compile the application (e.g. hello.c from the ecos example, havent
> tried Sergei's hello.c)
> 8) As Sergei advised, start gdb (only now from cygwin)
> arm-elf-gdb -nw -nx -q hello
> (gdb) set remotebaud 115200
> (gdb) target remote /dev/com1
> ......//some characters printed (in my case "0x100054b4 in ?? ()")
> (gdb) load
> loading section .rom_vectors, size xxx lma yyy
> loading section .text, size xxx lma yyy
> loading section .rodata, size xxx lma yyy
> loading section .data, size xxx lma yyy
> start address xxx, load size yyy
> transfer rate: xxx bits/sec, yyy bytes/write.
> (gdb) cont
> continuing.
> 
> Hello ecos World!
> 
> Hope this will help anyone that encounter same problem as me.
> 
> On 9/2/07, Sergei Gavrikov <w3sg@softhome.net> wrote:
> > On Sat, Sep 01, 2007 at 05:35:47PM +0800, albert prasetyo wrote:
> > > Hi Sergey;
> > > Thank you for your info. It provides me further understanding on how
> > > redboot and ecos work.  Actually, my board (AT91RM9200) is designed to
> > > communicate through PC using 1 serial port only (DBGU port). Is there
> > > any way to print "Hello World" (i.e. Application message) using only
> > > one port?  Moreover, my board does not have spare LED, the LEDs are
> > > only used to signal whether the board is turned on or not and Ethernet
> > > connection.  Thank you for your attention.
> >
> > Be sure! I don't know your hardware, sorry. But, If I remember, you ran
> > that eCos application using the RedBoot 'go' command and saw a mangled
> > output, is it right? So, your eCos application works! Did you try to use
> > GDB to download and run any eCos test? If you have a working RedBoot for
> > your target and it (RedBoot) contains the GDB interface (cdl_interface
> > CYGINT_HAL_DEBUG_GDB_STUBS), try to use even GDB 5.3 from eCosCentric.
> >
> > Just a conspectus (1-2-3), if you did install eCos stuff on Linux box...
> >
> > 1. Build eCos
> >
> > ecosconfig new "your_target_name" minimal \
> > && ecosconfig tree \
> > && make -s
> >
> > 2. Build a minimalist 'hello'
> >
> > cat <<_EOF>hello.c
> > cyg_start(){diag_printf("hello, world!\n");}
> > _EOF
> >
> > make hello CFLAGS='-O0 -g' LDFLAGS='-Linstall/lib -Ttarget.ld -nostdlib'
> >
> > 3. Run that 'hello' using GDB
> >
> > arm-elf-gdb -nw -nx -q hello
> >
> > Note: at the least, it's needed to connect itself using the GDB remote
> > protocol (suppose, /dev/ttyS0 is your port), reset a board before to do
> > this.
> >
> > On GDB promp (gdb) just try to enter commands (again, it's 1-2-3)
> >
> > target remote /dev/ttyS0
> > load
> > cont
> >
> > Are you seeing something now?
> >
> > If you aren't... Sorry. They talk that M$ + Cygwin + Insight + Java +
> > Eclipse IDE + ... are good things for beginners. Sorry, I don't believe
> > them.  They cannot say you, Let's do '1-2-3' and get the result. They
> > offer a tour is containing a lot of screenshots...
> >
> > But, it's pretty simple just to grab and unpack ONE gnutools tarball for
> > Linux (ftp://ecos.sourceware.org/pub/ecos/gnutools/i386linux) and get
> > the result in a few minutes.
> >
> >
> >        Sergei
> >
> >
> 
> PS: Sergei, when will you come to Singapore? I owe you a treat! =>
> 
> Regards;
> Albert P
> 


-- 
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] ecos application problem
  2007-09-03  7:05                   ` Sergei Gavrikov
@ 2007-09-04  3:27                     ` albert prasetyo
  0 siblings, 0 replies; 13+ messages in thread
From: albert prasetyo @ 2007-09-04  3:27 UTC (permalink / raw)
  To: Sergei Gavrikov; +Cc: ecos-discuss

Hi Sergei;
Sorry for making a hasty conclusion before. As you said, there is no relation
between setting of the compiler flags and the mangled output.
The problem is located in my ecos configuration to build the library for
application (e.g HelloWorld.c).
Thank you for your attention and support.

Regards;
Albert P

On 9/3/07, Sergei Gavrikov <w3sg@softhome.net> wrote:
> albert prasetyo writes:
> > Hi Sergei;
> > Thank you very much! Now everything just works.
> > It is arguable that the cause of my problem (i.e. mangled output) is the cflags.
>
> It seems, this is a wrong conclusion. I known no one GCC flag which
> occurs mangled output. You set type of diag output when you configure
> ecos.ecc. I just did limit CFLAGS sequence because I did demo how to
> build a _minimalist_ eCos application.
>
> I sure that CFLAGS='-Iinstall/include -O0 -g' in my 1-2-3 example will
> be work too.
>
> Look closely at your build defaults (ecos.ecc): CYGBLD_GLOBAL_CFLAGS,
> CYGBLD_GLOBAL_LDFLAGS. You can just quite overwrite those before the
> making of the eCos libraries just edited the ecos.ecc. Those flags to
> include itself (install/include/pkgconf/ecos.mak) in your final build.
> Try to replace -O2 by -O0 optimization flag there when you build debug
> image.
>
>        Sergei
>
> > The original compiler flags that i used is '-I$(INSTALL_DIR)/include'
> > replace it with your recommended cflags and my application runs properly.
> > Allow me to reproduce what I did earlier:
> > ROM mode
> > Using cygwin and hyperterminal in Windows environment:
> > 1) Compile redboot using AT91RM9200 template with redboot packages.
> > 2) Using ROM mode and without any Ethernet package, I modify nothing
> > else and start building the library.
> > 3) put the redboot on the board
> > 4) For building application library, repeat step 1 and 2 (only mode used is RAM)
> > 5) start cygwin, go to ecos example folder, and open makefile
> > 6) change the CFLAGS variable to '-O0 -g'
> > 7) compile the application (e.g. hello.c from the ecos example, havent
> > tried Sergei's hello.c)
> > 8) As Sergei advised, start gdb (only now from cygwin)
> > arm-elf-gdb -nw -nx -q hello
> > (gdb) set remotebaud 115200
> > (gdb) target remote /dev/com1
> > ......//some characters printed (in my case "0x100054b4 in ?? ()")
> > (gdb) load
> > loading section .rom_vectors, size xxx lma yyy
> > loading section .text, size xxx lma yyy
> > loading section .rodata, size xxx lma yyy
> > loading section .data, size xxx lma yyy
> > start address xxx, load size yyy
> > transfer rate: xxx bits/sec, yyy bytes/write.
> > (gdb) cont
> > continuing.
> >
> > Hello ecos World!
> >
> > Hope this will help anyone that encounter same problem as me.
> >
> > On 9/2/07, Sergei Gavrikov <w3sg@softhome.net> wrote:
> > > On Sat, Sep 01, 2007 at 05:35:47PM +0800, albert prasetyo wrote:
> > > > Hi Sergey;
> > > > Thank you for your info. It provides me further understanding on how
> > > > redboot and ecos work.  Actually, my board (AT91RM9200) is designed to
> > > > communicate through PC using 1 serial port only (DBGU port). Is there
> > > > any way to print "Hello World" (i.e. Application message) using only
> > > > one port?  Moreover, my board does not have spare LED, the LEDs are
> > > > only used to signal whether the board is turned on or not and Ethernet
> > > > connection.  Thank you for your attention.
> > >
> > > Be sure! I don't know your hardware, sorry. But, If I remember, you ran
> > > that eCos application using the RedBoot 'go' command and saw a mangled
> > > output, is it right? So, your eCos application works! Did you try to use
> > > GDB to download and run any eCos test? If you have a working RedBoot for
> > > your target and it (RedBoot) contains the GDB interface (cdl_interface
> > > CYGINT_HAL_DEBUG_GDB_STUBS), try to use even GDB 5.3 from eCosCentric.
> > >
> > > Just a conspectus (1-2-3), if you did install eCos stuff on Linux box...
> > >
> > > 1. Build eCos
> > >
> > > ecosconfig new "your_target_name" minimal \
> > > && ecosconfig tree \
> > > && make -s
> > >
> > > 2. Build a minimalist 'hello'
> > >
> > > cat <<_EOF>hello.c
> > > cyg_start(){diag_printf("hello, world!\n");}
> > > _EOF
> > >
> > > make hello CFLAGS='-O0 -g' LDFLAGS='-Linstall/lib -Ttarget.ld -nostdlib'
> > >
> > > 3. Run that 'hello' using GDB
> > >
> > > arm-elf-gdb -nw -nx -q hello
> > >
> > > Note: at the least, it's needed to connect itself using the GDB remote
> > > protocol (suppose, /dev/ttyS0 is your port), reset a board before to do
> > > this.
> > >
> > > On GDB promp (gdb) just try to enter commands (again, it's 1-2-3)
> > >
> > > target remote /dev/ttyS0
> > > load
> > > cont
> > >
> > > Are you seeing something now?
> > >
> > > If you aren't... Sorry. They talk that M$ + Cygwin + Insight + Java +
> > > Eclipse IDE + ... are good things for beginners. Sorry, I don't believe
> > > them.  They cannot say you, Let's do '1-2-3' and get the result. They
> > > offer a tour is containing a lot of screenshots...
> > >
> > > But, it's pretty simple just to grab and unpack ONE gnutools tarball for
> > > Linux (ftp://ecos.sourceware.org/pub/ecos/gnutools/i386linux) and get
> > > the result in a few minutes.
> > >
> > >
> > >        Sergei
> > >
> > >
> >
> > PS: Sergei, when will you come to Singapore? I owe you a treat! =>
> >
> > Regards;
> > Albert P
> >
>
>

-- 
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:[~2007-09-04  3:27 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-08-23 11:28 [ECOS] ecos application problem albert prasetyo
2007-08-23 22:47 ` Paul D. DeRocco
     [not found] ` <029201c7e5d3$ce0bd2d0$887ba8c0@PAULD>
2007-08-24  2:30   ` albert prasetyo
2007-08-24  3:53     ` Paul D. DeRocco
2007-08-24  6:06       ` Sergei Gavrikov
2007-08-27  5:53         ` albert prasetyo
2007-08-27  6:28           ` Sergei Gavrikov
2007-09-01  9:35             ` albert prasetyo
2007-09-01 17:49               ` Sergei Gavrikov
2007-09-03  3:58                 ` albert prasetyo
2007-09-03  7:05                   ` Sergei Gavrikov
2007-09-04  3:27                     ` albert prasetyo
2007-08-24  4:57     ` Alexey Shusharin

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).