Determining resource usage for BSP drivers

martinerikwerner.aac at gmail.com martinerikwerner.aac at gmail.com
Fri Feb 10 13:19:27 UTC 2023


Some BSP drivers use rtems objects in their implementation, for example
GRCAN creating semaphores in bsps/shared/grlib/can/grcan.c.

(GRCAN is only used as an example, there seems to be many BSP drivers
which do this, the fact that GRCAN use the driver manager might make it
not the best example..?)

How is the application supposed to calculate the correct resource
amount to set for the drivers it is using? Is there any support for
this in either code or documentation?

Or is the idea that a user needs to:
* Know exactly what drivers are used/available.
* Read the source code of each of these drivers and count up the rtems
resources used.

For example, in GRCAN, it looks like 4 semaphores are used for each
device, so a user would then do something like:

#define CONFIGURE_MAXIMUM_SEMAPHORES \
  (MY_SEMAPHORES + MY_GRCAN_MAXIMUM_DEVICES * 4)

As the number of drivers used increases, this seems like it could
become quite hard to manage and prone to errors, if this manual method
needs to be used.

Or is it assumed that the system will be configured with unlimited
resources instead in most cases where this could become an issue?

--
Martin Werner


More information about the users mailing list