The recommended Eclipse for QORC SDK is Eclipse IDE for Embedded C/C++ Developers
.
The IDE is available for download from : https://projects.eclipse.org/projects/iot.embed-cdt/downloads
The current tested version with QORC SDK is Eclipse IDE for Embedded C/C++ Developers 2020-09
.
This Eclipse IDE is a continuation of the GNU MCU Eclipse project (https://gnu-mcu-eclipse.github.io/) and is now an Eclipse Incubation Project, and is recommended over the older GNU MCU for new installations.
This guide assumes that all the pre-requisites for the QORC SDK applications are already installed and you are able to build the applications using make
from the command line.
Contents
It is recommended to keep a separate workspace for the QORC SDK applications, but it is not mandatory.
All QORC SDK applications have Makefile support, and the application_dir/GCC_Project/
contains the necessary Makefiles.
To convert this to an Eclipse Project, the following steps can be followed:
Create a directory
eclipse_make_project
in the application'sGCC_Project dir
.Create a file
eclipse_custom_build_command.sh
in the application'sGCC_Project dir
.Copy the below content into the file :
#!/usr/bin/env bash cd $1 echo $INSTALL_DIR export PATH="$INSTALL_DIR/quicklogic-arch-defs/bin:$INSTALL_DIR/quicklogic-arch-defs/bin/python:$PATH" source "$INSTALL_DIR/conda/etc/profile.d/conda.sh" conda activate make $2
Save the file, and mark it executable with
chmod +x eclipse_custom_build_command.sh
Open Eclipse and Select Preferred Workspace.
Select
File -> New -> Project
From the
New Project
dialog box,Select
Makefile project with existing code
underC++
and click Next.Specify the Project Name ("Use Your Preferred Name") in the
Project Name
text box.Specify the path to
eclipse_make_project
that was created in Step [1] in theExisting Code Location
text boxKeep both
C
andC++
checked inLanguages
Select
ARM Cross GCC
in theToolchain for Indexer Settings
optionsClick Finish
Add files and folder to the Eclipse Virtual Filesystem
Select the following directories in the
File Explorer
from the QORC SDK repo directory:- BSP
- HAL
- FreeRTOS
- Libraries
- Tasks
Drag the selected directories and drop them onto the newly created project in Eclipse IDE
Once dropped, a
File and Folder Operation
dialog pops up.Choose
Link to files and recreate folder structure with virtual folders
option.Ensure that the option
Check the Create link locations relative to PROJECT_LOC
is checked.Click OK.
Any other QORC SDK directories can be added to the eclipse project in the same way.
Create Virtual Folder named "App".
Ensure that the newly create project is selected in Eclipse IDE
Select
File -> New -> Folder
Specify folder name as
App
Click the
Advanced
tab and ensure to select the optionFolder is not located in the file system (Virtual Folder)
Click
Finish
Select the following directories in the
File Explorer
from the application directory:- GCC_Project
- src
- inc
Drag the selected directories and drop them onto the newly
App
Virtual Folder in Eclipse IDE
Now, the project structure is ready.
Ensure that the newly create project is selected in Eclipse IDE
Select
Project -> Properties
Select C/C++ Build from the left pane
Select the
Builder Settings
tabDeselect
Use default build command
Enter the following in the
Build command
text box:${workspace_loc:/${ProjName}}/../eclipse_custom_build_command.sh ${workspace_loc:/${ProjName}}/../
Select sub option
Settings
underC/C++ Build
Select
Toolchains
tab and pull-downName
option and selectGNU Tools for ARM Embedded Processors (arm-none-eabi-gcc)
Select sub option
Environment
underC/C++ Build
Click option
Add
, inputName
asINSTALL_DIR
andValue
as"Path to the FPGA Toolchain Installation Directory"
(same as in regular setup)Click option
Add
, inputName
asPATH
andValue
as"Path to the ARM GCC Toolchain Directory":"$INSTALL_DIR/install/bin:$INSTALL_DIR/install/bin/python:$PATH
Click
Apply and Close
theProject Properties
Right-Click on the project in
Project Explorer
, selectClean Project
You should be able to see the project cleaned successfully.
The
CDT Build Console
output should look to be the same as what you would see while executingmake clean
from the command line.Right-Click on the project in
Project Explorer
, selectBuild Project
You should be able to see the project build successfully.
The
CDT Build Console
output should look to be the same as what you would see while executingmake
from the command line.Select the
bin
directory in theFile Explorer
from the application'sGCC_Project/output/
directory.Drag the selected directory and drop it onto the
App/GCC_Project/output/
Virtual Folder in Eclipse IDEThis is required for setting up the Debug Configuration in the next section.
Install the Segger J-Link Software Package for Ubuntu:
Recommended to use the
tgz
archive (J-Link Software and Documentation pack for Linux, TGZ archive, 32 or 64 bit according to host architecture) from :https://www.segger.com/downloads/jlink/#J-LinkSoftwareAndDocumentationPack
Tested with v6.92 at the time of writing this guide.
Extract the archive to any preferred location.
Ensure the project is selected in Eclipse IDE
Project Explorer
Select
Run -> Debug Configurations
Select
GDB SEGGER J-Link Debugging
, and then click onNew launch configuration
(the top left most icon with only a "+" in the corner)On the
Main
tab :Select the
Project
(It should show the project you created)Specify the
C/C++ Application
asApp/GCC_Project/output/bin/"application_name".elf
(Ideally, this should have been automatically selected by Eclipse)Click on
Search Project
and select the correctelf
file.
On the
Debugger
tab :- Set the
Executable path
to point to theJLinkGDBServerCLExe
file in the Segger J-Link Installation above. - Set the
Device name
toCortex-M4
- Set the
On the
Startup
tab :- set
Initial Reset and Halt
type to0
- Check the
RAM application (reload after reach reset/restart)
option - Uncheck the
Pre-run/Restart reset
option
- set
Click on
Debug
buttonThe debug session should start launching (Answer
Yes
if Eclipse asks to switch to Debug Perspective)You should be able to see the code loaded and debugger halted on
int main()
coming soon!