My Visual Studio code/ PlatformIO experience is less than a week, please tolerate the Newbieness.
I have installed platformio, I have created a project and it compiles.
While compiling it compiles driver files under ~/.platformio/packages/frameworktobeused/lib
All this is fine.
The framework installed under packages has to be changed to a development framework codebase. I have moved the “frameworktobeused” to “old_frameworktobeused” and install the development framework inside packages as “frameworktobeused”.
I did a build clean, removed the .cache folder under .platformio.
When I rebuild the project, I still see the compiler picking up include files from the old frame work- it is using the directory path “old_frameworktobeused”
How do I make it use the newly installed framework.
I’d not remove the .platformio\.cache folder, if you want to regenerate the project files for intellisense you have to execute the “Rebuild Intellisense” index task (Redirecting...) .
This regenerates the .vscode\* files in the project, most importantly the c_cpp_properties.json.
If there are still errors after that you’d need to show the content of that file and the path of the files you want to include.
Many thanks for trying to help me. The following is the extract of c_cpp_properties.json
If you notice the include path, it has /home/krishnak/.platformio/packages/old-framework-kendryte-standalone-sdk-old/lib/bsp"
When the platformio was installed for kendryte-stand-alone-sdk - that folder used to be /home/krishnak/.platformio/packages/framework-kendryte-standalone-sdk/lib/bsp", however I had to install a newer version of the SDK than what is available using platform IO to get my code compiled, hence I moved the kendryte-standalone-sdk to old-framework-kendryte-standalone-sdk-old. I copied the latest SDK to ./platformio/packages/framework-kendryte-standalone-sdk
However when I rebuild as you notice below, the properties file has changed itself to the old-framework-kendryte-standalone-sdk-old
I did as per your suggestion, but this file gets regenerated with the old sdk folder name in the includes even if I change the folder name of the sdk, I want the include path to have the new sdk path.
configurations": [
{
"name": "!!! WARNING !!! AUTO-GENERATED FILE, PLEASE DO NOT MODIFY IT AND USE https://docs.platformio.org/page/projectconf/section_env_build.html#build-flags"
},
{
"name": "Linux",
"includePath": [
"/home/krishnak/visualstudioworkspace/freshdownloadfastface/include",
"/home/krishnak/visualstudioworkspace/freshdownloadfastface/src",
"/home/krishnak/.platformio/packages/old-framework-kendryte-standalone-sdk-old/lib/bsp",
"/home/krishnak/.platformio/packages/old-framework-kendryte-standalone-sdk-old/lib/bsp/include",
"/home/krishnak/.platformio/packages/old-framework-kendryte-standalone-sdk-old/lib/drivers",
"/home/krishnak/.platformio/packages/old-framework-kendryte-standalone-sdk-old/lib/drivers/include",
"/home/krishnak/.platformio/packages/old-framework-kendryte-standalone-sdk-old/lib/utils/include",
"/home/krishnak/.platformio/packages/tool-unity",
""
],
"browse": {
"limitSymbolsToIncludedHeaders": true,
"path": [
"/home/krishnak/visualstudioworkspace/freshdownloadfastface/include",
"/home/krishnak/visualstudioworkspace/freshdownloadfastface/src",
"/home/krishnak/.platformio/packages/old-framework-kendryte-standalone-sdk-old/lib/bsp",
"/home/krishnak/.platformio/packages/old-framework-kendryte-standalone-sdk-old/lib/bsp/include",
"/home/krishnak/.platformio/packages/old-framework-kendryte-standalone-sdk-old/lib/drivers",
"/home/krishnak/.platformio/packages/old-framework-kendryte-standalone-sdk-old/lib/drivers/include",
"/home/krishnak/.platformio/packages/old-framework-kendryte-standalone-sdk-old/lib/utils/include",
"/home/krishnak/.platformio/packages/tool-unity",
""
]
},
So what exactly do you have as your platformio.ini?
I’m not sure if this is going to work. To setup a framework correctly you also have to add the correct package.json which identifies the new version and reference the new version / package in the platformio.ini. Can you give the output of ls for /home/krishnak/.platformio/packages/old-framework-kendryte-standalone-sdk-old and your new SDK folder?
/packages/framework-kendryte-standalone-sdk$ more package.json
{
"name": "framework-kendryte210-standalone-sdk",
"description": "This SDK is for Kendryte K210 without OS support.",
"version": "0.5.4",
"url": "https://github.com/kendryte/kendryte-standalone-sdk"
}
old-framework-kendryte-standalone-sdk-old$ more package.json
{
"name": "framework-kendryte-standalone-sdk",
"description": "This SDK is for Kendryte K210 without OS support.",
"version": "0.5.6",
"url": "https://github.com/kendryte/kendryte-standalone-sdk"
}
The version number inside the “old sdk” is higher than the version number of the sdk in development release, however what is inside framework-kendryte-standalone-sdk is the one which I want to use, as it is the latest development code.
I just did another test by changing name field inside the package…json of old-frame-work-kendryte-standalone-sd,
from
“name”: “framework-kendryte-standalone-sdk”,
to
“name”: “old-framework-kendryte-standalone-sdk”,
I did a intellisense rebuild, what has happened is a new folder called /.platformio/packages/framework-kendryte-standalone-sdk@0.5.6$
has been created by the IDE with the code base from the released version 0.5.6.
So the IDE is looking at some where else to determine which code base to use, probably the git url?
I tried to sort this to use the correct SDK folder by following this, version number has to match with the latest released version number for the directory to be used. So I changed the version number in package.json of the development version to match the released version 0.5.6.
Note: version number even if it is greater didn’t work.
Though the above version numbering prevented the build system from picking the incorrect directory, what has happened actually is that source files have been synced to 0.5.6 and the development release code has been over written, now back to catch 22
my new frame work is called kendryte-standalone-sdk-develop
I have created a folder framework-kendryte-standalone-sdk-develop under packages and added the code there
I have added this frame work in sipeed-maix-one-dock.json inside boards folder
“frameworks”: [
“kendryte-standalone-sdk-develop”,
“kendryte-standalone-sdk”,
“kendryte-freertos-sdk”,
“arduino”
],
I have updated platform.json and followed all the steps.
When I rebuild intellisense task, I get this one line error
Executing task: platformio init --ide vscode <
The current working directory /home/krishnak/visualstudioworkspace/fastfacedtect will be used for the project.
The next files/directories have been created in /home/krishnak/visualstudioworkspace/fastfacedtect
include - Put project header files here
lib - Put here project specific (private) libraries
src - Put project source files here
platformio.ini - Project Configuration File
Error: Detected unknown package 'framework-kendryte-standalone-sdk-develop'
The terminal process terminated with exit code: 1
I have added the necessary code in the boards/appropriate.json file as well