BSP Driver not initialized

Hesham ALMatary heshamelmatary at gmail.com
Thu Jul 2 09:17:23 UTC 2015


On Thu, Jul 2, 2015 at 10:05 AM, Inderjit Singh
<inderjit.singh at aacmicrotec.com> wrote:
> Hi Hesham,
>
> We are using the 4.10.99 version with our own bsp so far. It's a new hardware (with FPGA) and we are creating this new bsp. for it So naturally It it's not part of RTEMS tree because it's incomplete.
>
> However, the comment from Joel and my 'guessing' has kicked the BSP at boot time. So all is good. However, I'm unsure if this is the way to do it. Properly i mean. Is there any doc on this or have I missed it?
>
This is a manual that may give you some guidance [1] how drivers work
in RTEMS. You may also want to have a look at the IO manager [2] and
how it works. This link [3] provides some application configurations
for device drivers. Hope that helps.

[1] https://docs.rtems.org/doc-current/share/rtems/html/bsp_howto/index.html
[2] https://docs.rtems.org/doc-current/share/rtems/html/c_user/I_002fO-Manager.html#I_002fO-Manager
[3] https://docs.rtems.org/doc-current/share/rtems/html/c_user/Configuring-a-System-Device-Driver-Table.html#Configuring-a-System-Device-Driver-Table
> ________________________________________
> From: Hesham ALMatary [heshamelmatary at gmail.com]
> Sent: 02 July 2015 10:44
> To: Inderjit Singh
> Cc: devel at rtems.org
> Subject: Re: BSP Driver not initialized
>
> Hi,
>
> On Wed, Jul 1, 2015 at 4:47 PM, 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.
>>
>> 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:
>> ---
> Just a note, is this the actual path for your RTEMS source? If so
> which RTEMS version are you using? I am asking because there is no BSP
> with "or1k-bsp" name. Also do you work on a simulator or an FPGA
> board?
>
>> #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
>>
>> _______________________________________________
>> devel mailing list
>> devel at rtems.org
>> http://lists.rtems.org/mailman/listinfo/devel
>
>
>
> --
> Hesham



-- 
Hesham


More information about the devel mailing list