BSP Driver not initialized

Inderjit Singh inderjit.singh at aacmicrotec.com
Thu Jul 2 08:11:52 UTC 2015


Thanks for the response Joel,

So do you mean that I need to add something like this in cpukit/sapi/include/condefs.h:

#ifdef CONFIGURE_APPLICATION_NEEDS_MY_DRIVER
   #include <rtems/mydriver.h>
#endif
...
rtems_driver_address_table
  _IO_Driver_address_table[ CONFIGURE_MAXIMUM_DRIVERS] = {
...
#ifdef CONFIGURE_APPLICATION_NEEDS_MY_DRIVER
   AAC_MYDRIVER_DRIVER,
#endif
...

And then in the application:

#define CONFIGURE_APPLICATION_NEEDS_MY_DRIVER

Is this correct?


________________________________________
From: Joel Sherrill [joel.sherrill at oarcorp.com]
Sent: 01 July 2015 17:53
To: Inderjit Singh; devel at rtems.org
Subject: Re: BSP Driver not initialized

On July 1, 2015 10:47:16 AM CDT, Inderjit Singh <inderjit.singh at aacmicrotec.com> wrote:
>Hi,
>
>I'm trying to initialize (get up) my driver for a or1k target. I reused
>the the hello sample program to see if the driver ckicks in but nothing
>in th console (except the hello msg in Init fiunction. Does anyone know
>why?
>
>I updated the file as shown below. At this point I am only interested
>in to see the initialization kicking in but I don't seems to get
>anything.

Each application configures its own set of drivers, maximums, etc by specifying the CONFIGURE_ macros like at the bottom of hello and then including confdefs.h.

You need to add your driver to the set. From memory since on phone, this is via CONFIGURE_APPLICATION_DRIVERS or something similar.

This is in the users guide in the configuring a system chapter.

>rtems/c/src/lib/libbsp/or1k/or1k-bsp/mydriver/mydriver.c:
>---
>rtems_device_driver rtems_mydriver_initialize(rtems_device_major_number
>major,
>                                      rtems_device_major_number unused,
>                                              void *arg)
>{
>  printk("INIT\r\n");
>
>  // rtems_io_register_driver
>  // rtems_io_register_name (/dev/mydriver) with major
>
>  return RTEMS_SUCCESSFUL;
>}
>
>... (Empty functions for read write etc.) ...
>
>
>rtems/c/src/lib/libbsp/or1k/or1k-bsp/include/mydriver.h:
>---
>#include <bsp.h>
>
>static rtems_device_driver
>rtems_mydriver_initialize(rtems_device_major_number major,
>                                      rtems_device_minor_number unused,
>                                                     void *);
>
>... (Other definitions for read write etc.) ...
>
>#define AAC_MYDRIVER_DRIVER {                   \
>      rtems_mydriver_initialize,                \
>      rtems_mydriver_open,                      \
>      rtems_mydriver_close,                     \
>      rtems_mydriver_read,                      \
>      rtems_mydriver_write,                     \
>      rtems_mydriver_control }
>
>static rtems_driver_address_table mydriver = AAC_MYDRIVER_DRIVER;
>
>Makefile.am file rtems/c/src/lib/libbsp/or1k/or1k-bsp/Makefile.am:
>---
>...
>include_bsp_HEADERS += include/mydriver.h
>...
>libbsp_a_SOURCES += mydriver/mydriver.c
>
>Any help is appreciated.
>Thanks,
>Indy

--joel


More information about the devel mailing list