Using Eclipse With QORC SDK
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.
It is recommended to keep a separate workspace for the QORC SDK applications, but it is not mandatory.
Convert Existing Makefile GCC_Project to an Eclipse Project
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_projectin the application’sGCC_Project dir.Create a file
eclipse_custom_build_command.shin 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.shOpen Eclipse and Select Preferred Workspace.
Select
File -> New -> ProjectFrom the
New Projectdialog box,Select
Makefile project with existing codeunderC++and click Next.Specify the Project Name (“Use Your Preferred Name”) in the
Project Nametext box.Specify the path to
eclipse_make_projectthat was created in Step [1] in theExisting Code Locationtext boxKeep both
CandC++checked inLanguagesSelect
ARM Cross GCCin theToolchain for Indexer SettingsoptionsClick Finish
Add files and folder to the Eclipse Virtual Filesystem
Select the following directories in the
File Explorerfrom 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 Operationdialog pops up.Choose
Link to files and recreate folder structure with virtual foldersoption.Ensure that the option
Check the Create link locations relative to PROJECT_LOCis 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 -> FolderSpecify folder name as
AppClick the
Advancedtab and ensure to select the optionFolder is not located in the file system (Virtual Folder)Click
FinishSelect the following directories in the
File Explorerfrom the application directory:GCC_Project
src
inc
Drag the selected directories and drop them onto the newly
AppVirtual Folder in Eclipse IDE
Now, the project structure is ready.
Setup Build Configuration For Project
Ensure that the newly create project is selected in Eclipse IDE
Select
Project -> PropertiesSelect C/C++ Build from the left pane
Select the
Builder SettingstabDeselect
Use default build commandEnter the following in the
Build commandtext box:${workspace_loc:/${ProjName}}/../eclipse_custom_build_command.sh ${workspace_loc:/${ProjName}}/../Select sub option
SettingsunderC/C++ BuildSelect
Toolchainstab and pull-downNameoption and selectGNU Tools for ARM Embedded Processors (arm-none-eabi-gcc)Select sub option
EnvironmentunderC/C++ BuildClick option
Add, inputNameasINSTALL_DIRandValueas"Path to the FPGA Toolchain Installation Directory"(same as in regular setup)Click option
Add, inputNameasPATHandValueas"Path to the ARM GCC Toolchain Directory":"$INSTALL_DIR/install/bin:$INSTALL_DIR/install/bin/python:$PATH
Click
Apply and ClosetheProject PropertiesRight-Click on the project in
Project Explorer, selectClean ProjectYou should be able to see the project cleaned successfully.
The
CDT Build Consoleoutput should look to be the same as what you would see while executingmake cleanfrom the command line.Right-Click on the project in
Project Explorer, selectBuild ProjectYou should be able to see the project build successfully.
The
CDT Build Consoleoutput should look to be the same as what you would see while executingmakefrom the command line.Select the
bindirectory in theFile Explorerfrom 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.
Setup Debug Configuration For Project
Segger J-Link
Install the Segger J-Link Software Package for Ubuntu:
Recommended to use the
tgzarchive (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 ExplorerSelect
Run -> Debug ConfigurationsSelect
GDB SEGGER J-Link Debugging, and then click onNew launch configuration(the top left most icon with only a “+” in the corner)On the
Maintab :Select the
Project(It should show the project you created)Specify the
C/C++ ApplicationasApp/GCC_Project/output/bin/"application_name".elf(Ideally, this should have been automatically selected by Eclipse)Click on
Search Projectand select the correctelffile.
On the
Debuggertab :Set the
Executable pathto point to theJLinkGDBServerCLExefile in the Segger J-Link Installation above.Set the
Device nametoCortex-M4
On the
Startuptab :set
Initial Reset and Halttype to0Check the
RAM application (reload after reach reset/restart)optionUncheck the
Pre-run/Restart resetoption
Click on
DebugbuttonThe debug session should start launching (Answer
Yesif Eclipse asks to switch to Debug Perspective)You should be able to see the code loaded and debugger halted on
int main()
OpenOCD
coming soon!