C

EK-RA6M3G Kit Setup Instructions

This topic helps you setup the development environment for Renesas' EK-RA6M3G.

Board features

  • R7FA6M3AH3CFC MCU featuring ARM® Cortex®-M4, 2 MB Flash, 640 KB RAM
  • 4.3” 480x272 LCD Touch Display
  • 32 MB External QSPI Flash

Setting up development environment

Prerequisites

Use the Qt online installer to install the following prerequisites. You can download the installer from your Qt account.

Qt Creator IDE

  • Launch Qt Creator and select Tools > Options > Devices > MCU.
  • Select the Qt for MCUs dev - EK-RA6M3G-BAREMETAL 16bpp from the drop-down list for Target supported by the Qt for MCUs SDK.
  • Provide the Renesas Flexible Software Package (FSP) installation path if it is not installed in the default location.
  • In the Requirements section, ensure that the platform-specific requirements are met.
  • Select Automatically create kits for all available targets on start to create kits automatically.

    Note: You could also manually create/remove kits using Create Kit and Remove Kit.

  • Click Apply and restart Qt Creator if you choose to create kits automatically.

Note: The Automatically create kits for all available targets on start option is available from Qt Creator v4.14 onwards. On older versions of Qt Creator, you have to explictly create or remove kits using Create kit or Remove kit.

In addition, install the following separately as the Qt online installer does not provide these:

  • Install Renesas e2 studio 2020-10 (20.10.0) or newer (Download)

For flashing and using GDB server for debugging:

  • Install SEGGER J-Link Software and Documentation pack V6.96 or newer (Download)

Command line setup

To get started from the command line, ensure that the following environment variables are set:

  • Qul_DIR to the Qt for MCUs SDK install path.
    <QT_INSTALL_PATH>\QtMCUs\<VERSION>

    where,

    • <QT_INSTALL_PATH> is the Qt install directory,
    • and <VERSION> is the directory containing the Qt Quick Ultralite version you are using, for example 1.8.0.
  • Set the EK_RA6M3G_FSP_PATH environment variable to:
    <QT_INSTALL_PATH>\Tools\QtMCUs\Renesas\fsp-<version>

    where, <QT_INSTALL_PATH> is the Qt install directory.

Optional environment variables

  • Set the JLINK_PATH environment variable to the SEGGER J-Link installation path if it is not installed in the default location. For example:
    C:\tools\SEGGER\JLink

    Note: Ensure that the environment variable value does not contain spaces.

    Flash targets are created if the J-Link software kit is found.

  • To provide customized Renesas e2 generated project files, set the EK_RA6M3G_E2_PROJECT_PATH environment variable to the root of the Renesas e2 studio project. For example:
    C:\Users\<user>\e2_studio\workspace\<project_name>

Build configuration

Qt Creator provides a build configuration with the kit that you created earlier for the Qt for MCUs dev - EK-RA6M3G-BAREMETAL 16bpp target. If you are using a command-line setup, configure using the following CMake variables. For more information, see the CMake Manual.

  • QUL_PLATFORM

    The platform to build must be set to EK-RA6M3G-baremetal for this board.

    -DQUL_PLATFORM=EK-RA6M3G-baremetal
  • CMAKE_TOOLCHAIN_FILE

    This platform supports the armgcc and IAR toolchains.

    -DCMAKE_TOOLCHAIN_FILE=%Qul_DIR%\lib\cmake\Qul\toolchain\armgcc.cmake

    OR

    -DCMAKE_TOOLCHAIN_FILE=%Qul_DIR%\lib\cmake\Qul\toolchain\iar.cmake
  • QUL_COLOR_DEPTH

    The supported color depth by this platform is 16-bit.

    Note: If this variable is not set, default color depth is used while configuring for the platform.

    -DQUL_COLOR_DEPTH=16

Board configuration

MCU operating mode

MCU operating mode needs to be selected correctly depending on the software that is used with the MCU. Use jumper J16 on the board to select the operating mode for the MCU.

MCU Boot modeJumper J16USB port for the connection
Normal/Single-Chip modeOpenJ10
SCI/USB Boot modeClosedJ11

See Renesas RA6M3 Group - User’s Manual: Hardware for the details.

Flashing the firmware

Firmware can be flashed to the MCU using one of the software kit listed below. Depending on the selected software MCU Boot mode needs to be selected accordingly.

SoftwareMCU Boot mode
Renesas e2 studioNormal/Single-Chip mode
SEGGER J-Link/J-Flash (Lite)Normal/Single-Chip mode

Prebuilt demos and examples

The package for EK-RA6M3G board comes with a prebuilt watch demo binary. You can find it in the demos_images directory.

Building applications with prebuilt Qt Quick Ultralite libraries

Qt Creator IDE

Open the CMake project file for the example you want to build and configure it with the kit you created earlier. Once the project is configured, select Run or press Ctrl+r on your keyboard to build and flash the binary to the target.

Command line

The following example builds the watch demo for this board:

cd %Qul_DIR%\demos\watch
mkdir build
cd build
cmake .. -G "Ninja" -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=%Qul_DIR%\lib\cmake\Qul\toolchain\armgcc.cmake -DQUL_PLATFORM=EK-RA6M3G-baremetal
cmake --build .

Once you have successfully built the watch demo, you can flash it from the command line:

cmake --build . --target flash_watch

The same procedure applies to any other application.

Reading debug messages

By default, the output of printf calls are redirected to UART in Serial Communications Interface channel 0 (SCI0).

Board pin numberBoard pin typeTTL-232-USB cable pin
GNDGroundGND
P410RXD0TXD
P411TXD0RXD

Port settings

SettingValue
Bits per second115200
Data bits8
ParityNone
Stop bits1
Flow controlNone

Debugging

Renesas e2 studio

Renesas e2 studio can be used for debugging by setting custom debug configuration in a project.

  • Open Run from the top menu
  • Select Debug Configurations...
  • Select Renesas GDB Hardware Debugging
  • Click Browse... from the C/C++ Application: and select .elf file to be debugged
  • Click Apply and Close
  • Click Launch in 'Debug' mode

SEGGER J-Link GDB Server can be used to create GDB server.

  • Select Connection to J-Link as USB
  • Select Target device as R7FA6M3AH
  • Select Target interface as SWD
  • Select Speed as Fixed 4000 kHz
  • Click OK

    GDB Server is now listening for TCP connections on the default port, 2331.

  • Run arm-none-eabi-gdb in a separate console
    %ARMGCC_DIR%\bin\arm-none-eabi-gdb.exe <PATH_TO>\your_app.elf
  • Connect to the target via the gdbserver in the arm-none-eabi-gdb console using

    Note: Actual TCP port used is printed out on gdbserver's console.

    (gdb) target remote 127.0.0.1:2331

Notes

  • Demos, examples, and tests that do not fit into the flash memory or require more RAM than available on the MCU have been excluded.
  • Stack region is set to overlap with the heap region in the default platform adaptation to enable building of tests and demos, which have differing stack and heap requirements.
  • Size for the stack and heap must be defined to ensure that the Memory Protection Unit detects stack overflow and underflow.
  • Asset preloading is not supported due to limited amount of RAM and non-availability of SDRAM on the evaluation kit board.
  • One framebuffer (single-buffering) is used by default due to limited amount of RAM. This might be observed as flickering on the screen. Double-buffering can be enabled from the Renesas e2 studio FSP configuration files.

Default FSP Stacks Configuration in Renesas e2 studio

Note: Use the default value for the property if not specified in the table.

ADC Driver on r_adc

PropertyValue
Nameg_adc0
Input / Channel Scan Mask / Channel 2Selected
AN02P002

D/AVE 2D Port Interface on r_drw

PropertyValue
Allow Indirect ModeEnabled
Memory AllocationDefault
D2 Device Handle Named2_handle0
DRW Interrupt PriorityPriority 2

Display Driver on r_glcdc

PropertyValue
Nameg_display0
Callback Functionglcdc_callback
Line Detect Interrupt PriorityPriority 2

External IRQ Driver on r_icu

PropertyValue
Nameg_touch_irq
Channel0
TriggerFalling
Digital FilteringEnabled
TriggerFalling
Digital FilteringEnabled
Digital Filtering Sample ClockPCLK / 64
Callbacktouch_irq_cb
Pin Interrupt PriorityPriority 5
IRQ00P206

I2C Master Driver on r_iic_master

PropertyValue
Nameg_i2c_touch
Channel2
RateFast-mode
Rise Time (ns)120
Fall Time (ns)120
Duty Cycle (%)50
Slave Address0x38
Address Mode7-bit
Timeout ModeShort Mode
Callbacktouch_i2c_callback
Interrupt Priority LevelPriority 6
SDAP511
SCLP512

QSPI Driver on r_qspi

PropertyValue
Nameg_qspi0
Minimum QSSL Deselect Cycles8 QSPCLK

Timer Driver on r_gpt

PropertyValue
Nameg_timer_PWM
Channel7
ModePWM
Period10
Period UnitMilliseconds
Duty Cycle Percent75
GTIOCA Output EnabledTrue
GTIOCAP603

UART Driver on r_sci_uart

PropertyValue
Nameg_uart0
Channel0
Data Bits8bits
ParityNone
Stop Bits1bit
TXD_MOSIP411
RXD_MISOP410

Available under certain Qt licenses.
Find out more.