I'm coming from an entirely different platform and hardware family. So I'm a little lost.
Will be porting existing C code to the ESP32-S3
From what I can tell, the best path is to go with VS Code and install ESP-IDF in it.
When doing so, its offers 3 choices; Express, Advanced, "Use Existing Setup". Each seems to be focused on Python
Can someone point me to a document, page, video, which describes how to setup a C environment, in VS Code, for the ESP32?
I have installed the MS C/C++ extension in VS code
What headaches are ahead using C? I assume all the ESP32 libraries are all in Python?
Thanks,
C for ESP-IDF? Dev Environment?
-
- Posts: 9746
- Joined: Thu Nov 26, 2015 4:08 am
Re: C for ESP-IDF? Dev Environment?
Just go with the express setup then. The focus on Python is because a lot of ESP-IDF tools (which run on your PC to help generate/upload your ESP32 program) are written in Python.
No, all code that runs on the ESP32 itself is written in C/C++, so you should have few problems integrating existing C code (given it's written in a somewhat portable way)What headaches are ahead using C? I assume all the ESP32 libraries are all in Python?
Re: C for ESP-IDF? Dev Environment?
Same for me, I come from a different world.
Setting up a functional vs code environment took me a few retries and quite a lot of time before it works fine.
My advices :
-Fully uninstall vs code. The uninstaller does not erase all folders. Do it by hand (including a "code" folder that you will find somewhere in your directory tree under your user directory
-Erase all the folders with "espressif" and / or "idf" that you will find
-launch a brand new install of vs code
-in vs code, install the espressif extension, and only this one, no need for other extensions
-Express setup is fine
-From this point, always use the command palette tool for any action. It is in the "view" menu
-To create your project, in this palette use ESP-IDF: NewProject
-set up your params. You can leave le component field blank
-go to next page.
-Now it is very important to choose ESP-IDF in the first combo and then to select esp-idf/get-started/sample_projet
-Then click the "create project using template....." button which is top right of the screen. This will create for you an empty project AND set up all the environment so that all the tools work for you from inside vs code. If you don't do it this way, it will trough a lot of error at compile time
You can add c files and h files to you project using the + button locate in the explorer on the left side.
At some point you will have to launch "ESP-IDF: SDK configuration editor" to set the params of you target and preferably before your first compile
But remember that every time you change the structure of you project (add a file for exlample) you MUST re-run "ESP-IDF: SDK configuration editor" and click the save button even if you don't change any param. Otherwise it will not compile. Again it will set up the env accordingly to your project new structure.
Use the other "ESP-IDF:" commands that you will find in the palette to build you project
Setting up a functional vs code environment took me a few retries and quite a lot of time before it works fine.
My advices :
-Fully uninstall vs code. The uninstaller does not erase all folders. Do it by hand (including a "code" folder that you will find somewhere in your directory tree under your user directory
-Erase all the folders with "espressif" and / or "idf" that you will find
-launch a brand new install of vs code
-in vs code, install the espressif extension, and only this one, no need for other extensions
-Express setup is fine
-From this point, always use the command palette tool for any action. It is in the "view" menu
-To create your project, in this palette use ESP-IDF: NewProject
-set up your params. You can leave le component field blank
-go to next page.
-Now it is very important to choose ESP-IDF in the first combo and then to select esp-idf/get-started/sample_projet
-Then click the "create project using template....." button which is top right of the screen. This will create for you an empty project AND set up all the environment so that all the tools work for you from inside vs code. If you don't do it this way, it will trough a lot of error at compile time
You can add c files and h files to you project using the + button locate in the explorer on the left side.
At some point you will have to launch "ESP-IDF: SDK configuration editor" to set the params of you target and preferably before your first compile
But remember that every time you change the structure of you project (add a file for exlample) you MUST re-run "ESP-IDF: SDK configuration editor" and click the save button even if you don't change any param. Otherwise it will not compile. Again it will set up the env accordingly to your project new structure.
Use the other "ESP-IDF:" commands that you will find in the palette to build you project
-
- Posts: 94
- Joined: Tue Sep 07, 2021 12:07 pm
Re: C for ESP-IDF? Dev Environment?
agree, vs code is a good choice. Especially if you have used MS Visual Studio for development in the past: many of the keyboard short cuts will seem familiar.
It's still a long learning curve. I initially found the "flame" tool quite useful, then figured out control-e,d did the same thing...compile, upload, run. The top-left folder is the view you'll usually want.
I generally dislike dark mode, but the dark-high-contrast theme is working better for me than the light-high-contrast.
Use the View->CommandPalette and type to search. There is a lot of stuff hiding there.
It's still a long learning curve. I initially found the "flame" tool quite useful, then figured out control-e,d did the same thing...compile, upload, run. The top-left folder is the view you'll usually want.
I generally dislike dark mode, but the dark-high-contrast theme is working better for me than the light-high-contrast.
Use the View->CommandPalette and type to search. There is a lot of stuff hiding there.
Craige
-
- Posts: 1710
- Joined: Mon Oct 17, 2022 7:38 pm
- Location: Europe, Germany
Re: C for ESP-IDF? Dev Environment?
It's all there: https://docs.espressif.com/projects/esp ... index.htmlCan someone point me to a document, page, video, which describes how to setup a C environment, in VS Code, for the ESP32?
-
- Posts: 94
- Joined: Tue Sep 07, 2021 12:07 pm
Re: C for ESP-IDF? Dev Environment?
Especially the link at the bottom of the page
https://github.com/espressif/vscode-esp ... install.md
which will take you to Craige
-
- Posts: 2
- Joined: Fri Feb 03, 2023 2:20 pm
Re: C for ESP-IDF? Dev Environment?
I've been using VS code already for about 2 months.
I am running on a lyrat-mini, and I was very skeptic about the setup.
To my surprise the esp_idf extension works like a charm. I just had to set the default installation (express) and compile one of the examples.
The extension already comes with all the things you need to develop your project.
One thing to note, I am using both c and c++ code.
I am running on a lyrat-mini, and I was very skeptic about the setup.
To my surprise the esp_idf extension works like a charm. I just had to set the default installation (express) and compile one of the examples.
The extension already comes with all the things you need to develop your project.
One thing to note, I am using both c and c++ code.
klaatu2 wrote: ↑Mon Mar 06, 2023 5:39 pmI'm coming from an entirely different platform and hardware family. So I'm a little lost.
Will be porting existing C code to the ESP32-S3
From what I can tell, the best path is to go with VS Code and install ESP-IDF in it.
When doing so, its offers 3 choices; Express, Advanced, "Use Existing Setup". Each seems to be focused on Python
Can someone point me to a document, page, video, which describes how to setup a C environment, in VS Code, for the ESP32?
I have installed the MS C/C++ extension in VS code
What headaches are ahead using C? I assume all the ESP32 libraries are all in Python?
Thanks,
Who is online
Users browsing this forum: No registered users and 104 guests