Console driver not working?

Chris Johns chrisj at rtems.org
Sun Apr 27 21:50:34 UTC 2025


On 27/4/2025 4:18 pm, James Fitzsimons wrote:
> Hi all,
> 
> I'm trying to get back into some embedded development using RTEMS after a number
> of years away and have resurrected an old project using the Beaglebone black as
> a starting point.

Welcome back.

> I have built the latest RTEMS and have some test applications running on the
> board ok, but today I was trying to build a basic UI task and try as I might I
> can't read input from the console.
> 
> I'm using the following code in the Init task:
> 
> char buf[80] = "";
> char *cmd, *sval, *rval;
> printf("cmd: ");
> 
> rval = fgets(buf, 80, stdin);
> if (rval == NULL) {
> printf("fgets returned NULL\n");
> } else {
> printf("fgets returned %s\n", rval);
> }
> 
> printf("buf = %s\n", buf);
> cmd = strtok(buf, " \t\n");
> printf("cmd = %s\n", cmd);
> 
> which outputs:
> 
> Starting kernel ...
> 
> 
> RTEMS Beagleboard: am335x-based
>         ARM Debug: 0x4b141000
> Starting Motor Testing
> cmd: fgets returned NULL
> buf =
> cmd = (null)
> 
> I know the hardware connections are fine as I can use the Linux console ok.
> 
> Am I doing something stupid, or is the console driver for this BSP not working
> as expected?
> 
> Many thanks for any advice you can provide!

I suggest you see if the `hello.exe` sample program runs? It would check the low
level hardware interface.

Chris


More information about the users mailing list