Overriding mtb-shared folders

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

cross mob
Lavanya
Level 3
Level 3
25 sign-ins 5 questions asked 10 replies posted

We want to have *.h and *.c files to customize the MTB folder structure. I wanted to add all required *.c and *.h file and other depended files in flat folder architecture like under MTB just have three folders src, inc and dep and bring in corresponding files to it. How to do that ?

0 Likes
6 Replies
Sidramesh_S
Moderator
Moderator
Moderator
250 sign-ins 100 replies posted 25 solutions authored

Hi @Lavanya ,

You can add the New Folder ,source files and header files as I shown in below snapshots.

Here I added New Folder with New_Folder Name  :-

Sidramesh_0-1678082000195.png

after adding it is looks like below

 

Sidramesh_1-1678082111287.png

I added source file and header file inside New_Folder  :-

Sidramesh_2-1678082242348.png

Sidramesh_4-1678082330964.png

after adding source and headed files ,it looks like below

Sidramesh_6-1678083092487.png

Another way, You can create a folder somewhere ,copy that and directly paste upon left click on the project directory as shown below.

Sidramesh_7-1678083485662.png

I have added New_Folder_1 

Sidramesh_8-1678083691747.png

Similarly we can add source and header files.

Hope you got the answer you are looking for.

Please let us know if your issue is not resolved.also please elaborate on Flat folder architecture  you are motioned in your previous response.

Thanks and regards,
Sidramesh





0 Likes

Hi Sidramesh,

   Thank you for the detailed explanation, I wanted to add few files existing in mtb_shared folder pulled to top level folder and do the necessary changes in the make file to pick this new path is that doable?

Thanks,

Lavanya

0 Likes
Sidramesh_S
Moderator
Moderator
Moderator
250 sign-ins 100 replies posted 25 solutions authored

Hi @Lavanya ,

It is doable.

You can refer to the below details for adding header and source files :-

For header file , Remember .h files should be in a folder and you have to include the path of the folder containing the .h file in the INCLUDES section in makefile.

Sidramesh_0-1678444069611.png

In case if you have only  1 .h file the path of folder which contains the .h should be given in INCLUDES.

In case If you has multiple .h file that should be included then all those .h files should be copied to a new folder. Copy that folder to the project and then give the path of the new folder in the INCLUDES.

For source file you need to give the exact location of the source .c file in the SOURCES section

Sidramesh_1-1678444171797.png


Let me know if you face any issues.

Thanks and regards,
Sidramesh


 

 

0 Likes
Lavanya
Level 3
Level 3
25 sign-ins 5 questions asked 10 replies posted

Hi Sidramesh,

  I tried including the one folder it does not help. I wanted to add a custom target, the Library manager shows the specific set of targets, is there any way to add target with some custom modification on certain GPIO pins. What is the procedure for me to get that modified target to be displayed in the library manager.

For example, in the eval kit I use target=CYW920721M2EVK-01 after I run the library manager also shows this target and generates the mtb-shared folder with bsp under dev-kit with the name TARGET_CYW920721M2EVK-01 which also has design.modus automatically generated.  Few pins in this need customization. How to do that. Also I wanted to place this TARGET_CYW920721M2EVK-01 folder out of mtb-shared. How to that?

0 Likes
Sidramesh_S
Moderator
Moderator
Moderator
250 sign-ins 100 replies posted 25 solutions authored

Hi @Lavanya ,

Apologies for the delay.

For the target =CYW920721M2EVK-01,  you can customize the pins in Device Configurator and then Save it which will update the design. modus file.

You also mentioned you want to place the TARGET_CYW920721M2EVK-01 folder out of mtb-shared, please check the location of the TARGET_CYW920721M2EVK-01 folder is correct.
Generally, TARGET_CYW920721M2EVK-01 will be generated automatically in the bsps folder, TARGET_CYW920721M2EVK-01 folder will not be present in mtb-shared.
The mtb-shared folder will only contain the libraries used by the Applications. It is shown below.

Sidramesh_0-1691740114199.png

Thanks and regards,
Sidramesh

 

0 Likes
Sidramesh_S
Moderator
Moderator
Moderator
250 sign-ins 100 replies posted 25 solutions authored

Hi @Lavanya ,

I found that BTSDK BSPs by default are created under mtb_shared folder, they are not created under bsps application folder.
So  I build the HAL_UART_Raw_Mode Code Example with TARGET_CYW920721M2EVK-01.

It is generating a TARGET_CYW920721M2EVK-01 folder under mtb_shared.

Sidramesh_0-1692699037975.png

It is not the case with PSoC4 BSPs and PSoC6 BSPs.

If you wanted to have a BTSDK BSP as local BSP under their project rather than mtb-shared, it can easily be changed using Library Manager after creating the project, just change Type from Shared Git Repo to Local Git Repo:

Sidramesh_3-1692699543130.png


It will create TARGET_CYW920721M2EVK-01 folder out of mtb-shared :-

Sidramesh_2-1692699353788.png

Thanks and regards,
Sidramesh

0 Likes