Skip to content

Latest commit

 

History

History
183 lines (119 loc) · 9.73 KB

getting-started.md

File metadata and controls

183 lines (119 loc) · 9.73 KB

Getting started with the IAR RISC-V GD32V Eval board

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.

Getting Started

Evaluation board at-a-glance

Click on the board layout to enlarge.

Board specifications

  • 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)

I-jet Lite debug probe

  • 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)

Install IAR Embedded Workbench for RISC-V

Please refer to the installation instructions from the welcome e-mail for the RISC-V evaluation kit.

Set up the evaluation board

  1. 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.

  2. 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.

Clone the repository

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 Git (preferred way)

  1. Using a Git client (such as Git for Windows), launch Git CMD.

  2. 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

Using ZIP (alternate way)

  1. Create the folder %PROGRAMDATA%\IARSystems\EmbeddedWorkbench\DownloadedExamples\riscv if needed.

  2. Go to the tags page.

  3. Download the .zip archive suitable for the version of the Embedded Workbench for RISC-V.

  4. Extract the .zip archive to the riscv folder created on step 1.

  5. Download the GD32VF103 Firmware Library v1.1.1 available from the GigaDevice GitHub page.

  6. 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.

Build and Debug the example projects

  1. From the Windows Start menu, launch the IAR Embedded Workbench IDE by choosing IAR SystemsIAR Embedded Workbench for RISC-V.

  2. Go to HelpInformation CenterExample projectsIAR RISC-V GD32V EvalIAR RISC-V GD32V Eval board examples and finally click on Select Folder to save this Workspace to its default location, inside the %USERPROFILE%\Documents\IAR Embedded Workbench folder.

  1. Select the desired project: right-click on the project name in the Workspace window and Set as Active. The active project name is highlighted.

  2. 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.

  3. Choose ProjectMake (or F7) or click the Make button on the main toolbar to compile and link the project.

  4. Choose ProjectDownload and Debug (or CTRL + D) or click the Download 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 the main() function, highlighting the line where the application currently is.
  1. Click DebugGo (or F5) or click the Go button on the Debug Toolbar to resume the downloaded application execution.

  2. To halt the execution, choose DebugBreak or click the Break button on the Debug Toolbar.

  3. To exit the IAR C-SPY Debugger, choose DebugStop Debugging (or CTRL + SHIFT + D) or click the Stop 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-3
LED3
Green LED
J6 1-2
2-3
USB/Debug
J4
J8 1-2
2-3
SW4
Red LED
J9 1-2
3-4
5-6
SW5
Blue LED
LED4

View and edit project options

  1. Make sure the desired project name is highlighted in the workspace window. On the Project menu, select Options. An Options for node <active-project> window will be displayed.

  1. 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.

  1. 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 the main() function entry point. This is particularly useful for skipping the application's low-level initialization functions.

  1. Click OK if you want to save your settings.

Target power supply from I-jet Lite

To power the evaluation board directly from the I-jet Lite, proceed as follows.

  1. Choose ProjectOptionsI-jetSetup to enable Target power supply from the I-jet Lite.

  1. Then, on the board, use a jumper on J6 to connect the pins 1-2 (for USB/Debug).

Troubleshooting

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.

Disclaimer

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.