cancel
Showing results for 
Search instead for 
Did you mean: 

Including a file

ssk
Associate II
Posted on January 20, 2015 at 14:56

Hello,

I am using SPC5Studio v3.3.1 and I want to add a C module and a header to the project created by SPC5Studio wizard. I tried adding the same to 'source' folder. I also modified the project properties to include the source folder. Still when I build the project, it is giving error for the new file as no such file or folder exists. What other settings are required? Please clarify as my project work is getting halted due to this.

Your earliest help in this regard will be highly appreciated. Thanks in advance.

Mike.

#adding-files-to-the-project
This discussion has been locked for participation. If you have a question, please start a new topic in order to ask your question
6 REPLIES 6
Erwan YVIN
ST Employee
Posted on January 20, 2015 at 18:23

Hello Mike ,

yes , you can put your own code in the source directory.

it is automatically compiled after the generation & compilation.

there is an example in ChibiOS-RT SPC560Bxx Test Application

user files can be put in user.mak file.

   Best regards

               Erwan

ssk
Associate II
Posted on January 21, 2015 at 10:49

Hello Erwan,

Thanks for your reply.

1. I checked the example and found that two file - 'shellcmd.c' and 'shellcmd.h' are added to the 'source' folder. But my requirement is that I want to add two folders, say 'Modules' and 'Headers'. Inside these two folders, I will add the C modules and Headers respectively. How to accomplish this?

2. How can I add individual files to these folders? Is drag n drop option available?

3. I don't see any differences in the 'user.mak' file. I checked with the one created by SPC5Studio for my project. Am I missing anything? Please clarify.

4. I checked the project properties for both the projects - example and one created by me. I see no differences for both for defining the additional files. Can you please explain what additional settings may be required when I add file/folder to the project?

Thanks in advance for your quick reply.

Mike.

Erwan YVIN
ST Employee
Posted on January 27, 2015 at 11:44

Hello Mike ,

1) you can add and create some folders as you want 

    (cf screenshot)

    The generation will check your source directory and build in the project your own files.

    WARNING : sometimes you have to play with ''extern'' to prevent some link errors ;)

2) Drag & Drop is working from Windows explorer to the eclipse world (SPC5Studio)

    Do not forget to regenerate

3) The generation will analyze the source directory and add automatically your files contained in the file.

4) user.mak is useful for specific reason if you put your files outside ''source'' directories (example if you put in root or an other directory)

Best regards

                     Erwan

Erwan YVIN
ST Employee
Posted on January 27, 2015 at 11:45

Attachment inside

my.st.com has again killed my attachment ;)

________________

Attachments :

2015-01-27_114043.png : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006qXPC&d=%2Fa%2F0X0000000bol%2FbrQ2mJIOmdytjj1D8G16MCYOa4XQ6RtQI5IqAmGntWc&asPdf=false
ssk
Associate II
Posted on January 28, 2015 at 14:45

Thanks Erwan. I tried creating two folders - common modules and common headers for my project. Earlier I was using a 'space' between the name which I corrected to common_modules and common_headers. That solved the issue. But is 'space' a culprit?

Thanks.

Mike.

Erwan YVIN
ST Employee
Posted on January 30, 2015 at 11:22

Hello Mike ,

Space is not recommended in a directory name , especially for Make.exe 

We will add a note in SPC5Studio Help

              Best Regards

                       Erwan