This guide briefly describes how to get started using the IAR RISC-V GD32V Eval board with the I-jet Lite debug probe and how to run its example projects on the IAR Embedded Workbench for RISC-V.
Click on the board layout to enlarge.
- GD32VF103RBT6 RISC-V GigaDevice MCU
- User LEDs
- RGB LED
- User switches
- Potentiometer
- I²C 3-axis accelerometer
- I²C temperature-humidity sensors
- Light sensor
- On-board microphone
- iPhone compatible earbud jack
- SPI flash memory
- Reset button
- JTAG connector 20-pin 0.05”
- USB micro-B connector for USB/Serial converter
- Power can be supplied directly from the USB connector (J7) or from the I-jet Lite (J11 pins 11 and 13)
- CPU support: RISC-V cores, Arm Cortex-M/A/R cores
- Hi-speed USB 2.0 interface
- Debugging interfaces: JTAG, SWD
- Single-Wire Output (SWO) support
- Flash the firmware image into the MCU
- Target can be powered from the debugging interface (up to 5V)
- MIPI-20 flat cable and USB micro B cable are included
- Fully integrated with the IAR Embedded Workbench for RISC-V (and for Arm)
- RoHS/CE compliant (used with evaluation kit only)
Please refer to the installation instructions from the welcome e-mail for the RISC-V evaluation kit.
-
Connect one end of the MIPI-20 flat cable to the I-jet Lite and the other end of the cable to the J11 JTAG header on the evaluation board.
-
Connect the I-jet Lite to an USB port of the host PC using the USB micro B cable.
Note
The USB indicator on the I-jet Lite should turn on green as soon as Windows recognizes the device.
The I-jet Lite requires an USB 2.0 port on the host PC.
The I-jet Lite can power the evaluation board. Refer to the section Target power supply from I-jet Lite for more details.
The Debug Probes User Guide provides further information.
Once you have finished to install and setup the required software and hardware for the development environment, it is time to clone the repository containing the example projects.
Cloning the repository must be performed only once until decided to upgrade to the latest version available on the repository and there are many methods of cloning it. Below the steps for the two most common methods.
-
Using a Git client (such as Git for Windows), launch Git CMD.
-
Perform the following command to clone this repository with the GD32VF103 Firmware Library submodule.
git clone --recurse-submodules https://github.com/IARSystems/iar-risc-v-gd32v-eval.git %PROGRAMDATA%\IARSystems\EmbeddedWorkbench\DownloadedExamples\riscv\iar-risc-v-gd32v-eval
Note The projects in the master branch of this repository work with EWRISCV 3.10.1 (or later).
For using with earlier versions, perform the following (click to unfold)
cd %PROGRAMDATA%\IARSystems\EmbeddedWorkbench\DownloadedExamples\riscv\iar-risc-v-gd32v-eval git checkout tags/1.30.1
-
Create the folder
%PROGRAMDATA%\IARSystems\EmbeddedWorkbench\DownloadedExamples\riscv
if needed. -
Go to the tags page.
-
Download the
.zip
archive suitable for the version of the Embedded Workbench for RISC-V. -
Extract the
.zip
archive to theriscv
folder created on step 1. -
Download the GD32VF103 Firmware Library v1.1.1 available from the GigaDevice GitHub page.
-
Extract the Firmware folder from the
GD32VF103_Firmware_Library-1.1.1.zip
archive to the%PROGRAMDATA%\...\riscv\iar-risc-v-gd32v-eval-<tag>\GD32VF103_Firmware_Library
folder.
Note Replace
<tag>
by the chosen version on step 3.
-
From the Windows Start menu, launch the IAR Embedded Workbench IDE by choosing IAR Systems → IAR Embedded Workbench for RISC-V.
-
Go to
Help
→Information Center
→Example projects
→IAR RISC-V GD32V Eval
→IAR RISC-V GD32V Eval board examples
and finally click onSelect Folder
to save this Workspace to its default location, inside the%USERPROFILE%\Documents\IAR Embedded Workbench
folder.
-
Select the desired project: right-click on the project name in the Workspace window and
Set as Active
. The active project name is highlighted. -
Unfold the project in the Workspace window and open its README.md file. The README.md file provides any specific board setup or details specific to the active project.
-
Choose
Project
→Make
(or F7) or click theMake
button on the main toolbar to compile and link the project. -
Choose
Project
→Download and Debug
(or CTRL + D) or click theDownload and Debug
button on the Toolbar. This action will launch the IAR C-SPY Debugger.
Note
- When in an IAR C-SPY Debugger session, the IDE menu will slightly change, providing new menu options for debugging. Also, a new Debug Toolbar will appear, providing functionality to control the downloaded application's execution flow.
- The downloaded application will execute automatically on target until it reaches the entry point of the application's
main()
function, where its execution will remain paused until an user action changes the execution flow. The Code Editor window will display the source file containing themain()
function, highlighting the line where the application currently is.
-
Click
Debug
→Go
(or F5) or click theGo
button on the Debug Toolbar to resume the downloaded application execution. -
To halt the execution, choose
Debug
→Break
or click theBreak
button on the Debug Toolbar. -
To exit the IAR C-SPY Debugger, choose
Debug
→Stop Debugging
(or CTRL + SHIFT + D) or click theStop Debugging
button on the Debug Toolbar.
Note
- You can
Set as Active
any project from this workspace and repeat the process.- The board brings jumpers with user-selectable functionality for its buttons, LEDs and powering options. Refer to the respective example's README.md to know if the example requires any specific jumper settings. The table below brings the board's general jumper configuration.
Jumper Position Selection J5 1-2
2-3LED3
Green LEDJ6 1-2
2-3USB/Debug
J4J8 1-2
2-3SW4
Red LEDJ9 1-2
3-4
5-6SW5
Blue LED
LED4
- Make sure the desired project name is highlighted in the workspace window. On the
Project
menu, selectOptions
. An Options for node<active-project>
window will be displayed.
- The Project Options window offers a graphical user interface for conveniently setting all the options for the build configuration. For example, by selecting processor family and device under the Target tab of the General Options Category, the appropriate linker configuration and device description for the debugger are automatically selected for the chosen device.
- Select the Debugger in the category. The option
Run to
is used to specify a function for an automatic initial breakpoint when the application is executed during a C-SPY Debugger. By default, IAR Embedded Workbench will insert a breakpoint in themain()
function entry point. This is particularly useful for skipping the application's low-level initialization functions.
- Click
OK
if you want to save your settings.
To power the evaluation board directly from the I-jet Lite, proceed as follows.
- Choose
Project
→Options
→I-jet
→Setup
to enable Target power supply from the I-jet Lite.
- Then, on the board, use a jumper on J6 to connect the pins
1-2
(for USB/Debug).
If you are unable to find the cause of a problem, try the following:
- Try to press the board's
RESET
button. - Try to restart the C-SPY Debugger in the IAR Embedded Workbench IDE.
- Try disconnecting and reconnecting the power to the evaluation board and then repeat the previous sequence with the
RESET
followed by restarting of the C-SPY.
Information provided in this document is intended for helping new IAR Embedded Workbench users on how to get started. IAR Systems shall not be held liable for any losses or problems arising from using the information given in this document.