On Mon, 16 Aug 2010, Slide wrote:
On Mon, Aug 16, 2010 Sergei Gavrikov wrote:
On Fri, 13 Aug 2010, Slide wrote:
I am bringing up eCos on a custom internal board,
^^^^^^^^^^^^^^^^^^^^^^^^^^
Hi Slide,
So, does this mean that you have some new untested H/W and and a
fresh eCos port for it or your port closely depends on some known
target in eCos World?
Yes, it is a board that has a PXA9XX part, which is similar to PXA3X0,
which is similar to PXA2X0.
I have diag_printf working just fine,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Good news, at the least you managed a polled (non-interrupt driven)
diagnostic *output* for the UART, and as you say that diag_printf()
works smoothly, then try the simplest diagnostic *input* with
HAL_DIAG_READ_CHAR(_c_) macro
I'll give this a shot.
BUT,
I only have one serial port on the board,
^^^^^^^^^^^^^^^^^^^^^^^^^
It's good to know, How you download and run your test printf(),
gets() application? Do you share diagnostic and debug channels on
that UART or use an alternate communication channel for testing
(debugging)? If you use GDB remote protocol via that serial port...,
well I won't guess, write a bit, please, about your startup and debug
environment.
I load my image onto a microSD card. The PXA9XX supports loading
images from SD, so I have it load the image into RAM and then branch
to the load location to start running. Currently (until I get some
other method going) I am just removing the microSD from the system,
reprogramming the image and then putting it back in the system. I
haven't not developed an SD stack yet for loading things to the card
over serial port, or some other means.
I see. I want to be sure that your eCos config options are correct, but,
I cannot provide a guide with eCos configtool... So, I attached 2 ECM
files to play with. The first ECM does not disable ROM monitor, and the
second does. As you do not use RedBoot, try console2.ecm and I hope you
will get printf() on your UART.
SYNOPSYS
NOTE: builds for PC and uE250 targets were tested. Run only on PC target.
export TARGET=<yours>
cp console{1,2}.ecm /var/tmp
mkdir /var/tmp/console2 &&
cd /var/tmp/console2 &&
ecosconfig new $TARGET &&
ecosconfig import /var/tmp/console2.ecm &&
ecosconfig tree &&
make -s &&
cp $ECOS_REPOSITORY/../examples/build_Make* . &&
./build_Make.params &&
SRCS=con.c DST=con ./build_Makefile &&
cat >con.c<<EOF &&
main(){char x[256];while(1){puts("?");if(gets(x)>0)puts(x);}return(0);}
EOF
make -f Makefile
Try that 'con' ELF. With config above your UART must behave as a
tty-like console and gets(), printf(), etc. must work as you could
expect. If your eCos build is configured properly, you have to see in
minicom something like this (though this is output for PC target):
Init device '/dev/ser0'
16x5x SERIAL init - dev: 3f8.36
Set output buffer - buf: 0x00118f80 len: 128
Set input buffer - buf: 0x00119000 len: 128
Init device '/dev/ttydiag'
Init tty channel: 0x00117de0
Init device '/dev/tty0'
Init tty channel: 0x00117e00
Init device '/dev/haldiag'
HAL/diag SERIAL init
?
foo
foo
?
bar
bar
?
In two words: *at the least 3 options* I touch for your request (to get
the simplest tty-like console with stdio)
cdl_component CYGPKG_IO_SERIAL_DEVICES {user_value 1};
cdl_component CYGPKG_IO_SERIAL_TTY_TTY0 {user_value 1};
cdl_option CYGDAT_IO_SERIAL_TTY_CONSOLE {user_value "\"/dev/tty0\""};
And do not forget that with gets() you get a blocking input :-) If you
will manage printf on your UART, look then either on termios or curses
as your target has 64M.
HTH
Sergei
but I can't seem to get printf or gets to work correctly.
Let's leave this a while, especially gets().
Sergei
Agreed, I would assume that if printf was working, then gets/etc would
probably be working as well.
Thanks,
slide
cdl_configuration eCos {
template default ;
};
cdl_component CYGDBG_HAL_DIAG_TO_DEBUG_CHAN {
user_value 0
};
cdl_option CYGSEM_HAL_DIAG_MANGLER {
user_value None
};
cdl_option CYGSEM_HAL_USE_ROM_MONITOR {
user_value 0 0
};
cdl_option CYGDBG_IO_INIT {
user_value 1
};
cdl_option CYGDAT_IO_SERIAL_TTY_CONSOLE {
user_value "\"/dev/tty0\""
};
cdl_component CYGPKG_IO_SERIAL_TTY_TTY0 {
user_value 1
};
cdl_component CYGPKG_IO_SERIAL_DEVICES {
user_value 1
};
cdl_component CYGPKG_INFRA_DEBUG {
user_value 1
};
cdl_configuration eCos {
template default ;
};
cdl_option CYGDBG_IO_INIT {
user_value 1
};
cdl_option CYGDAT_IO_SERIAL_TTY_CONSOLE {
user_value "\"/dev/tty0\""
};
cdl_component CYGPKG_IO_SERIAL_TTY_TTY0 {
user_value 1
};
cdl_component CYGPKG_IO_SERIAL_DEVICES {
user_value 1
};
cdl_component CYGPKG_INFRA_DEBUG {
user_value 1
};
--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss