Is it possible to detect if a given component is present?

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
RaAl_264636
Level 6
Level 6
50 sign-ins 25 sign-ins 10 solutions authored

Hi,

   

 

   

is it possible to detect if a given component is present and to retrieve it's informations?

   

For example, the Bootloadable and Bootloader components seem to be able to detect if their counterpart is already present in a design. But I don't know if they check the project type or if it's possible to check if a component of a given type is present.

   

 

   

Regards,

   

 

   

Ralf

0 Likes
5 Replies
ETRO_SSN583
Level 9
Level 9
100 sign-ins 5 likes given 1000 replies posted

One could imagine a version control system incorporated in the code at

   

an absolute address to accomplish this ? Then a script or other code could

   

read that area for version/config info.

   

 

   

Regards, Dana.

0 Likes
RaAl_264636
Level 6
Level 6
50 sign-ins 25 sign-ins 10 solutions authored

Hi Dana,

   

 

   

I'm not sure if we are talking about the same. I want to know if a component can detect the presence of another component.

   

 

   

Regards,

   

 

   

Ralf

0 Likes
Anonymous
Not applicable

 Simple check for the presence of the components API #define (look into their api.h):

   

 

   

    #if defined(CY_PRS_COMP_NAME_H)    

   

        COMP_NAME_Start(param);

   

    #endif  

0 Likes
RaAl_264636
Level 6
Level 6
50 sign-ins 25 sign-ins 10 solutions authored

Hi abnoname,

   

 

   

okay, simple solution, but in this case you've to know the name of the component.

   

 

   

Regards,

   

 

   

Ralf

0 Likes
ETRO_SSN583
Level 9
Level 9
100 sign-ins 5 likes given 1000 replies posted

I might be confused here but the #if defined is a Linker command so

   

the module start command gets incorporated into the code, started,

   

but no other module is "aware" of it other than its impact (having been

   

started, like a clock) HW wise on another module.

   

 

   

I still think that product to product variations have to be taken care of with

   

a descriptor table of some sort, known part to part, or an incredibly complex

   

binary code parser that pulls apart the code base seeking out module

   

"footprints" from a rule based on how they were created.

   

 

   

Regards, Dana.

0 Likes