Where to add the source file(*.c and *.h) path in VS Code?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Where to add the source file(*.c and *.h) path in VS Code?

2,081 Views
Lurkersoo
Contributor III

Hello, I try to use VS Code to develop MCU project. If I create some folder to store the source file(*.c and *.h), how to add the path setting in VS Code?

And how to modify the "Optimization" level?

 

Thanks!

Lurker

0 Kudos
Reply
3 Replies

2,049 Views
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello @Lurkersoo 

Thanks for your valuable question.

For better help you, please tell us below informations.

1) Part number of your MCU.

2) Based on SDK driver do development?

Thanks.

 

BR

Alice

0 Kudos
Reply

2,046 Views
Lurkersoo
Contributor III

Hi Alice,

Please find below reply:

1) Part number of your MCU.---LPC55S69

2) Based on SDK driver do development? ---Yes, SDK 2.14.0(

"SdkRootDirPath": "c:/nxp/NXDSDK/SDK_2_14_0_LPCXpresso55S69")
 
BR,
Lurkersoo
0 Kudos
Reply

1,963 Views
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello @Lurkersoo 

Please refer to blow steps from my colleague:

"

To add a file to the project, the user will need to create the file in VSCode, then add the file path to the CMakeLists.txt manually:

Open the armgcc/CMakeLists.txt then navigate to "add_executable" command:

Alice_Yang_0-1706495488598.png

 

Then add your files shown above.

 

To add include directories to the project, add the path to the "target_include_directories" command:

Alice_Yang_1-1706495488039.png

 

 

To change the optimization level, open the armgcc/flags.cmake and edit all compiler flags accordingly:

Alice_Yang_2-1706495489077.png

 

The default optimization level for Debug build is -O0, and -Os for release build.

"

 

BR

Alice

0 Kudos
Reply