Difference between revisions of "ESP32 Toolchain"

From Flowcode Help
Jump to navigationJump to search
(Created page with "The ESP32 toolchain includes a lot more extras and so we have used the standard Espresif installer as that does all the extra functionality for you. The only downside to this...")
 
(Added a note for using it on PCs with restricted accounts)
 
(6 intermediate revisions by one other user not shown)
Line 1: Line 1:
The ESP32 toolchain includes a lot more extras and so we have used the standard Espresif installer as that does all the extra functionality for you.
+
Prior to installing the ESP32 toolchain, is vital that you [[Library_Updates|update Flowcode components]] using the Full database option, then reload (Fle > reload) your project or start a new one.
  
The only downside to this is you have to manually point Flowcode at the toolchain.
+
Note: If you are upgrading from a previous version of the ESP32 toolchain then either rename your project or select the folder for your project that was created using the previous version of the ESP32 toolchain.
  
  
The toolchain can be downloaded from here: https://flowcode.co.uk/download
+
Download the ESP32 toolchain from the Toolchain section of the [https://flowcode.co.uk/download/ Flowcode Downloads page].
  
Please report any problems or issues on the Flowcode user forum.
+
Save the ESP .msi file to your PC.
  
 +
Right-click on the file and select install you will see:
  
Installation
+
[[File:ESP32 Toolchain1.png]]
  
Once the download has finished run the installation file.
 
  
[[File:ESP32_Setup1.png]]
 
  
Select – I accept the agreement and click Next
 
  
[[File:ESP32_Setup2.png]]
+
Click '''Next'''
  
If you have a different version of Python installed, then I would recommend sicking with Python 3.7
 
  
''<span style="color:red;">Please note some versions of Python may cause the installer to fail, if this happens then try again and use the supplied version 3.7</span>''
+
Select checkbox for I accept the terms of this Licence Agreement, then click '''Next''' again
  
If you have Git already installed then you can select your version of Git.  
+
The default drive will be on the same drive that the msi file is saved on.
  
Otherwise select Install Git
+
You can change the drive, but you must leave FC_ESP as the default directory.
  
[[File:ESP32_Setup3.png]]
+
[[File:ESP32 Toolchain2.png]]
  
If you have an ESP-IDF already downloaded then you can select your version of ESP-IDF.
 
  
Otherwise, select Download ESP-IDF
 
  
[[File:ESP32_Setup4.png]]
 
  
Select which ESP-IDF to install, we recommend the lowest version as the higher versions have not been tested.
+
After clicking on '''Next''' you will need to click on Install, which will require Administration rights
  
At the time of writing  5.1 (Release branch is OK to use)
+
[[File:ESP32 Toolchain3.png]]
  
Install to a location on your system with no spaces in the path.
 
  
For example C:\esp-idf
+
There will be a User Account elevated prompt, which you will need to select Yes
  
[[File:ESP32_Setup5.png]]
+
[[File:ESP32 Toolchain4.png]]
  
Select a location for the ESP-IDF Tools to be installed, again use a path that contains no spaces
 
  
For example C:\esp-idf-tools
 
  
[[File:ESP32_Setup6.png]]
 
  
Select addition tasks, recommend keeping all options checked and click Next.  
+
The ESP32 Toolchain will now be installed.
  
[[File:ESP32_Setup7.png]]
+
Finally, click on Finish
  
On the confirmation screen check the paths are correct and click Install
+
[[File:ESP32 Toolchain5.png]]
  
[[File:ESP32_Setup8.png]]
 
  
During the installation process you may get some of the following pop-ups appearing
+
If there was an issue with installing, then Add the msi file to the antivirus safe/whitelist and try again
  
Click Yes to allow Git to be installed
 
  
[[File:ESP32_Setup9.png]]
+
When you compile for the first time, it will take considerably longer then subsequence compiles.
  
Click Yes to allow Windows PowerShell to be installed
 
  
[[File:ESP32_Setup10.png]]
+
If there is the following error message:
  
Installation complete
+
'idf.py' is not recognized as an internal or external command
  
You do not need to run the ESP-IDF command prompt as we will be invoking this from Flowcode:
+
Then either Flowcode project was not reloaded after full component database update, or all the components have not been updated with the latest Version.
  
[[File:ESP32_Setup11.png]]
 
  
A PC reboot may be required after installation has been completed.
+
The following message can be ignored:
  
'''Setting up Flowcode for use with the ESP32 toolchain'''
+
fatal: not a git repository (or any of the parent directories): .git
  
Copy the location of the esp-idf (e.g. C:\esp-idf) into the
 
  
Global Settings > Locations tab.
+
=== Important note for ESP32 users using restricted multiuser Windows accounts ===
 +
[[File:CreateSingleCFile.png|thumb|Set Flowcode to create a single .c file]]
 +
When using the ESP32 toolchain in a multiuser environment, it is important that Flowcode is set to create a single .c file instead of using separate .c and .h files.  This setting can be found in the “Application” tab of Flowcode’s “Global Options” and needs to be unticked for each user as shown in the image.
  
Or if you have a project loaded
+
Note that the default setting is for this to be ticked.  This setting is controlled by the following per-user registry key and IT administrators may find it more convenient to set the following key for all users during the installation of Flowcode:
 +
* [HKEY_CURRENT_USER\SOFTWARE\MatrixTSL\FlowcodeV10\Options\compilation]
 +
* "SeparateHeader"=dword:00000000
  
File > Global Settings > Locations tab:
 
  
[[File:ESP32_Setup12.png]]
+
In addition, it is important that all users of Flowcode have read/write/execute access to the following subfolders of the ESP32 installation (by default, this will be in C:\FC_ESP). These are temporary folders used during the compilation process by the ESP32 toolchain.
 +
* \mtxlolin32_lite_sdkconfig
 +
* \mtxesp32_c3_sdkconfig
 +
* \mtxesp32_c6_sdkconfig
 +
* \mtxesp32_s2_sdkconfig
 +
* \mtxesp32_s3_sdkconfig
 +
* \mtxesp32s_sdkconfig
 +
* \mtxheltec_sdkconfig
 +
* \mtxlolinD32_Pro_sdkconfig
 +
* \mtxttgo_td_sdkconfig
 +
* \mtx
  
Click OK
+
The latest installer of this toolchain (from 18th Oct 2024) will attempt to create these folders with appropriate user privileges. If an earlier installer is used or the installer fails to set the permissions appropriately, an IT administrator will need to ensure that network users have generic read/write/execute access to these folders.
 
 
'''Flowcode ESP32 Projects'''
 
 
 
When you create a new Flowcode ESP32 project the first time you compile a folder will be created in
 
the Flowcode project directory with the same name as the Flowcde project file.
 
 
 
The folder contains all the standard build output for an ESP32 project.
 
 
 
The first compilation of a project will take a while to complete – around 5 minutes as all of the ESP32
 
libraries are pulled in from the ESP-IDF and compiled one by one. After the initial compilation
 
subsequent compilations will be much faster.
 
 
 
Inside the folder is a file called sdkconfig, this file is a text file that contains the configuration for the
 
ESP32 device.
 
 
 
Any changes to this file will automatically trigger another extended compilation.
 
 
 
If you connect your ESP board before running Flowcode then the boards COM port will appear in the Flowcode project options.
 
 
 
This will need to be selected and correct for the Compile to Chip menu option to function correctly.
 
 
 
[[File:ESP32_Setup13.png]]
 

Latest revision as of 15:21, 17 October 2024

Prior to installing the ESP32 toolchain, is vital that you update Flowcode components using the Full database option, then reload (Fle > reload) your project or start a new one.

Note: If you are upgrading from a previous version of the ESP32 toolchain then either rename your project or select the folder for your project that was created using the previous version of the ESP32 toolchain.


Download the ESP32 toolchain from the Toolchain section of the Flowcode Downloads page.

Save the ESP .msi file to your PC.

Right-click on the file and select install you will see:

ESP32 Toolchain1.png



Click Next


Select checkbox for I accept the terms of this Licence Agreement, then click Next again

The default drive will be on the same drive that the msi file is saved on.

You can change the drive, but you must leave FC_ESP as the default directory.

ESP32 Toolchain2.png



After clicking on Next you will need to click on Install, which will require Administration rights

ESP32 Toolchain3.png


There will be a User Account elevated prompt, which you will need to select Yes

ESP32 Toolchain4.png



The ESP32 Toolchain will now be installed.

Finally, click on Finish

ESP32 Toolchain5.png


If there was an issue with installing, then Add the msi file to the antivirus safe/whitelist and try again


When you compile for the first time, it will take considerably longer then subsequence compiles.


If there is the following error message:

'idf.py' is not recognized as an internal or external command

Then either Flowcode project was not reloaded after full component database update, or all the components have not been updated with the latest Version.


The following message can be ignored:

fatal: not a git repository (or any of the parent directories): .git


Important note for ESP32 users using restricted multiuser Windows accounts

Set Flowcode to create a single .c file

When using the ESP32 toolchain in a multiuser environment, it is important that Flowcode is set to create a single .c file instead of using separate .c and .h files. This setting can be found in the “Application” tab of Flowcode’s “Global Options” and needs to be unticked for each user as shown in the image.

Note that the default setting is for this to be ticked. This setting is controlled by the following per-user registry key and IT administrators may find it more convenient to set the following key for all users during the installation of Flowcode:

  • [HKEY_CURRENT_USER\SOFTWARE\MatrixTSL\FlowcodeV10\Options\compilation]
  • "SeparateHeader"=dword:00000000


In addition, it is important that all users of Flowcode have read/write/execute access to the following subfolders of the ESP32 installation (by default, this will be in C:\FC_ESP). These are temporary folders used during the compilation process by the ESP32 toolchain.

  • \mtxlolin32_lite_sdkconfig
  • \mtxesp32_c3_sdkconfig
  • \mtxesp32_c6_sdkconfig
  • \mtxesp32_s2_sdkconfig
  • \mtxesp32_s3_sdkconfig
  • \mtxesp32s_sdkconfig
  • \mtxheltec_sdkconfig
  • \mtxlolinD32_Pro_sdkconfig
  • \mtxttgo_td_sdkconfig
  • \mtx

The latest installer of this toolchain (from 18th Oct 2024) will attempt to create these folders with appropriate user privileges. If an earlier installer is used or the installer fails to set the permissions appropriately, an IT administrator will need to ensure that network users have generic read/write/execute access to these folders.