Difference between revisions of "Compiler Toolchains"

From Flowcode Help
Jump to navigationJump to search
Line 30: Line 30:
  
 
Once the download has finished run the installation file.
 
Once the download has finished run the installation file.
[[File:ESP32_Setup1.png|left]]
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
  
 +
[[File:ESP32_Setup1.png]]
  
 
Select – I accept the agreement and click Next
 
Select – I accept the agreement and click Next
[[File:ESP32_Setup2.png|left]]
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
  
 +
[[File:ESP32_Setup2.png]]
  
 
If you have Python already installed then you can select your version of Python.
 
If you have Python already installed then you can select your version of Python.
Line 124: Line 46:
  
 
Otherwise select Install Git  
 
Otherwise select Install Git  
[[File:ESP32_Setup3.png|left]]
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
  
 +
[[File:ESP32_Setup3.png]]
  
 
If you have an ESP-IDF already downloaded then you can select your version of ESP-IDF.  
 
If you have an ESP-IDF already downloaded then you can select your version of ESP-IDF.  
  
 
Otherwise, select Download ESP-IDF
 
Otherwise, select Download ESP-IDF
[[File:ESP32_Setup4.png|left]]
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
  
 +
[[File:ESP32_Setup4.png]]
  
 
Select which ESP-IDF to install, we recommend the lowest version as the higher versions have not been tested.
 
Select which ESP-IDF to install, we recommend the lowest version as the higher versions have not been tested.
Line 213: Line 62:
  
 
For example C:\esp-idf
 
For example C:\esp-idf
[[File:ESP32_Setup5.png|left]]
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
  
 +
[[File:ESP32_Setup5.png]]
  
 
Select a location for the ESP-IDF Tools to be installed, again use a path that contains no spaces  
 
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  
 
For example C:\esp-idf-tools  
[[File:ESP32_Setup6.png|left]]
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
  
 +
[[File:ESP32_Setup6.png]]
  
 
Select addition tasks, recommend keeping all options checked and click Next.  
 
Select addition tasks, recommend keeping all options checked and click Next.  
[[File:ESP32_Setup7.png|left]]
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
  
 +
[[File:ESP32_Setup7.png]]
  
 
On the confirmation screen check the paths are correct and click Install
 
On the confirmation screen check the paths are correct and click Install
[[File:ESP32_Setup8.png|left]]
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
  
 +
[[File:ESP32_Setup8.png]]
  
 
During the installation process you may get some of the following pop-ups appearing
 
During the installation process you may get some of the following pop-ups appearing
  
 
Click Yes to allow Git to be installed
 
Click Yes to allow Git to be installed
[[File:ESP32_Setup9.png|left]]
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
  
 +
[[File:ESP32_Setup9.png]]
  
 
Click Yes to allow Windows PowerShell to be installed
 
Click Yes to allow Windows PowerShell to be installed
[[File:ESP32_Setup10.png|left]]
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
  
 +
[[File:ESP32_Setup10.png]]
  
 
Installation complete
 
Installation complete
  
 
You do not need to run the ESP-IDF command prompt as we will be invoking this from Flowcode:
 
You do not need to run the ESP-IDF command prompt as we will be invoking this from Flowcode:
[[File:ESP32_Setup11.png|left]]
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
  
 +
[[File:ESP32_Setup11.png]]
  
 
A PC reboot may be required after installation has been completed.
 
A PC reboot may be required after installation has been completed.
  
'''Setting up Flowcode for use with the Pico toolchain'''  
+
'''Setting up Flowcode for use with the ESP32 toolchain'''
  
 
Copy the location of the esp-idf (e.g. C:\esp-idf) into the
 
Copy the location of the esp-idf (e.g. C:\esp-idf) into the
Line 497: Line 106:
  
 
File > Global Settings > Locations tab:
 
File > Global Settings > Locations tab:
[[File:ESP32_Setup12.png|left]]
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
  
 +
[[File:ESP32_Setup12.png]]
  
 
Click OK
 
Click OK
Line 567: Line 130:
  
 
This will need to be selected and correct for the Compile to Chip menu option to function correctly.
 
This will need to be selected and correct for the Compile to Chip menu option to function correctly.
[[File:ESP32_Setup13.png|left]]
+
 
 +
[[File:ESP32_Setup13.png]]
  
 
==Pico Toolchain==
 
==Pico Toolchain==
Line 579: Line 143:
  
 
'''Installing ARM GCC Compiler'''
 
'''Installing ARM GCC Compiler'''
 +
 
Download the Windows Installer from:
 
Download the Windows Installer from:
 +
 
https://developer.arm.com/downloads/-/gnu-rm
 
https://developer.arm.com/downloads/-/gnu-rm
  
[[File:Pico_Toolchain1.png|left]]
+
[[File:Pico_Toolchain1.png]]
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
  
 
During installation, you should tick the box to register the path to the ARM compiler as an
 
During installation, you should tick the box to register the path to the ARM compiler as an
 
environment variable in the Windows shell:
 
environment variable in the Windows shell:
[[File:Pico_Toolchain2.png|left]]
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
  
 +
[[File:Pico_Toolchain2.png]]
  
  
Line 674: Line 164:
  
 
During the installation add CMake to the system PATH for all users:
 
During the installation add CMake to the system PATH for all users:
[[File:Pico_Toolchain3.png|left]]
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
  
 +
[[File:Pico_Toolchain3.png]]
  
 
A PC reboot is recommended after installing CMake.
 
A PC reboot is recommended after installing CMake.
Line 720: Line 180:
  
 
You must install the full "Windows 10 SDK" package and leave the path as the default value:
 
You must install the full "Windows 10 SDK" package and leave the path as the default value:
[[File:Pico_Toolchain4.png|left]]
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
  
 +
[[File:Pico_Toolchain4.png]]
  
 
At around 21% completed its takes a little while to continue, this is normal
 
At around 21% completed its takes a little while to continue, this is normal
  
  
''Installing Python 3''
+
'''Installing Python 3'''
  
 
''<span style="color:red;">If you already have Python 3 installed on your PC (for example if you have already installed the ESP toolchain) skip this section and do not re-install Python.</span>''
 
''<span style="color:red;">If you already have Python 3 installed on your PC (for example if you have already installed the ESP toolchain) skip this section and do not re-install Python.</span>''
Line 752: Line 193:
  
 
Look for version 3.9.6:
 
Look for version 3.9.6:
[[File:Pico_Toolchain5.png|left]]
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
  
 +
[[File:Pico_Toolchain5.png]]
  
 
Ensure that it’s installed 'for all users' and add Python 3.9 to the system PATH:
 
Ensure that it’s installed 'for all users' and add Python 3.9 to the system PATH:
[[File:Pico_Toolchain6.png|left]]
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
  
 +
[[File:Pico_Toolchain6.png]]
  
 
Disable the MAX_PATH length limit when prompted at the end of the Python installation:
 
Disable the MAX_PATH length limit when prompted at the end of the Python installation:
[[File:Pico_Toolchain7.png|left]]
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
  
 +
[[File:Pico_Toolchain7.png]]
  
 
'''Installing Git'''
 
'''Installing Git'''
Line 856: Line 213:
  
 
Ensure that you change the default editor away from vim, for example if you have notepad++:
 
Ensure that you change the default editor away from vim, for example if you have notepad++:
[[File:Pico_Toolchain8.png|left]]
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
  
 +
[[File:Pico_Toolchain8.png]]
  
 
Ensure you tick the checkbox to allow Git to be used from third-party tools:
 
Ensure you tick the checkbox to allow Git to be used from third-party tools:
[[File:Pico_Toolchain9.png|left]]
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
  
 +
[[File:Pico_Toolchain9.png]]
  
 
Don't select any NEW! options, leave options as default.
 
Don't select any NEW! options, leave options as default.
 
Select "Checkout as is, commit as-is":
 
Select "Checkout as is, commit as-is":
[[File:Pico_Toolchain10.png|left]]
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
  
 +
[[File:Pico_Toolchain10.png]]
  
 
Select "Use Windows' default console window":
 
Select "Use Windows' default console window":
[[File:Pico_Toolchain11.png|left]]
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
  
 +
[[File:Pico_Toolchain11.png]]
  
 
Leave all the defaults Ticked
 
Leave all the defaults Ticked
  
 
Check "Enable experimental support for pseudo consoles" during the installation process:
 
Check "Enable experimental support for pseudo consoles" during the installation process:
[[File:Pico_Toolchain12.png|left]]
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
  
 +
[[File:Pico_Toolchain12.png]]
  
 
'''Installing the Pico SDK'''
 
'''Installing the Pico SDK'''
Line 1,059: Line 258:
  
 
File > Global Settings > Locations tab:
 
File > Global Settings > Locations tab:
[[File:Pico_Toolchain13.png|left]]
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
  
 +
[[File:Pico_Toolchain13.png]]
  
 
'''Programming The Pico'''
 
'''Programming The Pico'''
Line 1,116: Line 268:
  
 
Either right-click on any target & select ''Search...'' and enter  ''pico'', then select ''Find Next'':
 
Either right-click on any target & select ''Search...'' and enter  ''pico'', then select ''Find Next'':
[[File:Pico_Toolchain14.png|left]]
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
  
 +
[[File:Pico_Toolchain14.png]]
  
 
Or Go to the Free targets section, expand  ''Free targets'' and scroll down and select ''Raspberry_Pi_Pico''
 
Or Go to the Free targets section, expand  ''Free targets'' and scroll down and select ''Raspberry_Pi_Pico''
  
 
Select ''New <Raspberry_Pi_Pico> Embedded Project:
 
Select ''New <Raspberry_Pi_Pico> Embedded Project:
[[File:Pico_Toolchain15.png|left]]
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
  
 +
[[File:Pico_Toolchain15.png]]
  
  
Line 1,192: Line 287:
  
 
If you hear the USB connected sound and you also get a popup like this:
 
If you hear the USB connected sound and you also get a popup like this:
[[File:Pico_Toolchain16.png|left]]
 
 
 
 
 
 
 
 
 
 
  
 +
[[File:Pico_Toolchain16.png]]
  
 
Then your Pico is ready to be programmed.
 
Then your Pico is ready to be programmed.

Revision as of 11:22, 9 July 2023

Compiler Toolchain

The compiler toolchain is used to allow Flowcode to compile the generated C code into a binary file that can be executed on your target microcontroller device.

The "Compile to Hex" and "Compile to Target" options in Flowcode require that a toolchain is installed for your selected microcontroller device.


Downloading and installing toolchain

Most of the toolchains can be found here on the main Flowcode download page.

Download and run the toolchain installation file and that will do everything required to allow Flowcode to compile to that range of target devices.

Note if you have Flowcode open when installing the toolchain then you may need to restart Flowcode once the toolchain is installed.


ESP32 Toolchain

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 is you have to manually point Flowcode at the toolchain.


The toolchain can be downloaded from here: https://flowcode.co.uk/download

Please report any problems or issues on the Flowcode user forum.


Installation

Once the download has finished run the installation file.

ESP32 Setup1.png

Select – I accept the agreement and click Next

ESP32 Setup2.png

If you have Python already installed then you can select your version of Python.

Otherwise, select Install Python 3.7

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

If you have Git already installed then you can select your version of Git.

Otherwise select Install Git

ESP32 Setup3.png

If you have an ESP-IDF already downloaded then you can select your version of ESP-IDF.

Otherwise, select Download ESP-IDF

ESP32 Setup4.png

Select which ESP-IDF to install, we recommend the lowest version as the higher versions have not been tested.

At the time of writing 4.2 (Release branch is OK to use)

Install to a location on your system with no spaces in the path.

For example C:\esp-idf

ESP32 Setup5.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

ESP32 Setup6.png

Select addition tasks, recommend keeping all options checked and click Next.

ESP32 Setup7.png

On the confirmation screen check the paths are correct and click Install

ESP32 Setup8.png

During the installation process you may get some of the following pop-ups appearing

Click Yes to allow Git to be installed

ESP32 Setup9.png

Click Yes to allow Windows PowerShell to be installed

ESP32 Setup10.png

Installation complete

You do not need to run the ESP-IDF command prompt as we will be invoking this from Flowcode:

ESP32 Setup11.png

A PC reboot may be required after installation has been completed.

Setting up Flowcode for use with the ESP32 toolchain

Copy the location of the esp-idf (e.g. C:\esp-idf) into the

Global Settings > Locations tab.

Or if you have a project loaded

File > Global Settings > Locations tab:

ESP32 Setup12.png

Click OK

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.

ESP32 Setup13.png

Pico Toolchain

Note: Using Raspberry Pi Pico with Windows 7 or 8 is not officially supported. To build Pico projects you will need to install the following tools:

ARM GCC compiler
CMake
Build Tools for Visual Studio 2019
Python 3
Git

Installing ARM GCC Compiler

Download the Windows Installer from:

https://developer.arm.com/downloads/-/gnu-rm

Pico Toolchain1.png

During installation, you should tick the box to register the path to the ARM compiler as an environment variable in the Windows shell:

Pico Toolchain2.png


The command prompt that the installation opened can be closed.

Installing CMake

Download the Windows CMake3.20.5 Installer from: https://cmake.org/files/v3.20/


During the installation add CMake to the system PATH for all users:

Pico Toolchain3.png

A PC reboot is recommended after installing CMake.

Installing Build Tools for Visual Studio 2022

Download the Windows Installer from:

https://aka.ms/vs/17/release/vs_BuildTools.exe


When prompted by the Build Tools for Visual Studio installer you need to install the C++ build tools only.

You must install the full "Windows 10 SDK" package and leave the path as the default value:

Pico Toolchain4.png

At around 21% completed its takes a little while to continue, this is normal


Installing Python 3

If you already have Python 3 installed on your PC (for example if you have already installed the ESP toolchain) skip this section and do not re-install Python.

Download Windows Installer from: https://www.python.org/downloads/windows/

Look for version 3.9.6:

Pico Toolchain5.png

Ensure that it’s installed 'for all users' and add Python 3.9 to the system PATH:

Pico Toolchain6.png

Disable the MAX_PATH length limit when prompted at the end of the Python installation:

Pico Toolchain7.png

Installing Git

Download the Windows Installer from: https://git-scm.com/download/win

When installing Git you should have Only show new options unselected.

There is no need to change any default setting for all the checkboxes

Ensure that you change the default editor away from vim, for example if you have notepad++:

Pico Toolchain8.png

Ensure you tick the checkbox to allow Git to be used from third-party tools:

Pico Toolchain9.png

Don't select any NEW! options, leave options as default. Select "Checkout as is, commit as-is":

Pico Toolchain10.png

Select "Use Windows' default console window":

Pico Toolchain11.png

Leave all the defaults Ticked

Check "Enable experimental support for pseudo consoles" during the installation process:

Pico Toolchain12.png

Installing the Pico SDK

Use Git to download the Pico SDK to a location on your PC.

For example, install to your user Downloads directory:

C:\Users\YourName\Downloads\pico-sdk

Run a command prompt (type "cmd" at the start search box) and run the following commands: cd Downloads

git clone -b master https://github.com/raspberrypi/pico-sdk.git

cd pico-sdk

git submodule update --init

Setting up Flowcode for use with the Pico toolchain Copy the location of the Pico sdk (e.g. C:\Users\YourName\Downloads\pico-sdk) into the

Global Settings > Locations tab or if you have a project loaded

File > Global Settings > Locations tab:

Pico Toolchain13.png

Programming The Pico

The Pico is a free target device.

Run Flowcode & Select New Project

Either right-click on any target & select Search... and enter pico, then select Find Next:

Pico Toolchain14.png

Or Go to the Free targets section, expand Free targets and scroll down and select Raspberry_Pi_Pico

Select New <Raspberry_Pi_Pico> Embedded Project:

Pico Toolchain15.png


Sending Your First Program

Before sending your flowchart to the Pico, you must first enable boot mode.

To do that, make sure the pico is not connected to your PC.

Hold the BOOTSEL down and plug the Pico into your PC.

If you hear the USB connected sound and you also get a popup like this:

Pico Toolchain16.png

Then your Pico is ready to be programmed.