On Tue, Jun 27, 2023 at 5:13 PM Chris Johns <chr...@rtems.org> wrote: > > On 28/6/2023 6:48 am, Zainab Olalekan wrote: > > I am encountering difficulties with initializing I2C on the RTEMS6 MVME3100 > > BSP, > > required to run EPICS test. I have made adaptations based on Heinz's patch > > for > > RTEMS5, but I am experiencing an error. Here is the specific error message > > alongside an attached file showing the modifications made. > > The trace shows the code is crashing somewhere. > > Has Heinz run I2C on the MVME3100? > > We now have an #epics channel on our discord server > (https://devel.rtems.org/wiki/Developer/discord) which can be more interactive > depending on timezones. > +1 Discord is a better way to get (somewhat) interactive help. However, here is how to chase this down further:
The error shows return code of 10. You can find in cpukit/include/rtems/rtems/status.h that this means RTEMS_INVALID_NUMBER. Based on the print statement, it is coming from the call to rtems_io_register_driver(). This is defined in sapi/src/ioregisterdriver.c. You can find that this error is reached in: if ( major >= major_limit ) return RTEMS_INVALID_NUMBER; Earlier, we have: rtems_device_major_number major_limit = _IO_Number_of_drivers; _IO_Number_of_drivers is defined in include/rtems/confdefs/iodrivers.h It is determined from the size of the _IO_Driver_address_table, which is controlled by CONFIGURE_MAXIMUM_DRIVERS (line 126). Almost certainly, your application lacks a sufficient number of driver table entries for you to register the i2c driver. You may try an application that already uses the i2c driver, or you might be able to add #define CONFIGURE_MAXIMUM_DRIVERS (2) before the #include <rtems/confdefs.h> in the application code. Note that hello world is fairly bare bones. If you want to test threading and timing, you might prefer to use ticker as a starting point. If you want to test console interaction with libi2c, you might use a shell example. Gedare > Chris > _______________________________________________ > users mailing list > users@rtems.org > http://lists.rtems.org/mailman/listinfo/users _______________________________________________ users mailing list users@rtems.org http://lists.rtems.org/mailman/listinfo/users