some newbie questions

Joel Sherrill joel.sherrill at
Wed Feb 18 20:33:42 UTC 2004

sebastian ssmoller wrote:

> ok two more questions :)
> - to be able to use printk i have to set the hook bsp_output_char which
> does the actual "displaying" of the char, right ? but how could i put
> something on the console without the rtems init process ? the only idea
> i have at the moment is to use the "user led" at the front panel of my
> board ...

The output char routine in this case is the dumbest simplest way you
can force a character out any device to look at it.  You may be able
to use the ROM monitor and trap to an output routine.  You should be
able to assume that the "console serial port" is initialized since
you interact with it to load an executable.  So you can probably
just poll a single byte out using the same physical device with
something like this rough logic:

   while (!TX_empty);
   put byte

Look at the mips/jmr3904 for a simple example.  It just calls
the polled output a character routine and hopes the port is initialized.
Since you have a ROM monitor, it should be.

> - using the approach with incrementing a variable and seeing where the
> app hangs leaves one problem: how could i display/look into the variable
> when the board hangs ? i am not able to enter any commands so i cannot
> use any feature of the monitor in this situation ...

Ed's suggestion is the right way with a ROM monitor.  Otherwise,
you have to have some hardware assistance.

Do you have LEDs?  With 4 LEDs you could count to sixteen.


> thx
> regards,
> seb
>>On the other hand, if printk() works, then you're much
>>futher along than originally suspected, so try that first.
> (...)

More information about the users mailing list