Shell in RTEMS

Vishav.Vishav at dlr.de Vishav.Vishav at dlr.de
Wed Dec 11 16:39:13 UTC 2019


Hi,


I want to have a simple shell application. I am compiling the application from RTEMS5 Toolchain and then booting this app from uboot on the target. Following is my source code:


#include <rtems.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <assert.h>
#include <rtems/console.h>
#include <rtems/shell.h>

extern "C" {
  rtems_task Init(
    rtems_task_argument ignored
  );
};
rtems_task Init(
    rtems_task_argument ignored
)
{
    rtems_status_code sc;
    puts("***TEST ***");
    sc = rtems_shell_init(
            "SHLL",
            32 * 1024,
            10,
            CONSOLE_DEVICE_NAME,
            false,
            true,
            NULL
        );
    assert(sc == RTEMS_SUCCESSFUL);

    puts("Exited shell");
    sc = rtems_task_delete( RTEMS_SELF );

}


//#define CONFIGURE_APPLICATION_DOES_NOT_NEED_CLOCK_DRIVER
#define CONFIGURE_APPLICATION_NEEDS_SIMPLE_CONSOLE_DRIVER
/* The Clock Driver supplies the clock tick. */
#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER
#define CONFIGURE_MAXIMUM_TASKS 4
#define CONFIGURE_INIT_TASK_NAME rtems_build_name( 'E', 'X', 'A', 'M' )
#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
#define CONFIGURE_INIT
#define CONFIGURE_SHELL_COMMANDS_INIT
#define CONFIGURE_SHELL_COMMANDS_ALL
#define CONFIGURE_APPLICATION_NEEDS_LIBBLOCK
#include <rtems/shellconfig.h>
#include <rtems/confdefs.h>


The problem is that I never see the shell in the console. The console output is :

***TEST ***
Exited shell


The application is booted from uboot using following commands:

Zynq> tftpboot 0x1000000 192.168.178.6:shell.img
Using ethernet at e000b000 device
TFTP from server 192.168.178.6; our IP address is 192.168.178.1
Filename 'shell.img'.
Load address: 0x1000000
Loading: ##############
         2.2 MiB/s
done
Bytes transferred = 196593 (2fff1 hex)
Zynq> bootm 0x1000000


I am not sure what the problem is. It would be great if someone can help.


Regards

Vishav
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/users/attachments/20191211/f3a9148a/attachment.html>


More information about the users mailing list