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 1.8 - 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 example1.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 1.8 - 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 mode | Jumper J16 | USB port for the connection |
---|---|---|
Normal/Single-Chip mode | Open | J10 |
SCI/USB Boot mode | Closed | J11 |
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.
Software | MCU Boot mode |
---|---|
Renesas e2 studio | Normal/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 number | Board pin type | TTL-232-USB cable pin |
---|---|---|
GND | Ground | GND |
P410 | RXD0 | TXD |
P411 | TXD0 | RXD |
Port settings
Setting | Value |
---|---|
Bits per second | 115200 |
Data bits | 8 |
Parity | None |
Stop bits | 1 |
Flow control | None |
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
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 usingNote: 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.
D/AVE 2D Port Interface on r_drw
Property | Value |
---|---|
Allow Indirect Mode | Enabled |
Memory Allocation | Default |
D2 Device Handle Name | d2_handle0 |
DRW Interrupt Priority | Priority 2 |
Display Driver on r_glcdc
Property | Value |
---|---|
Name | g_display0 |
Callback Function | glcdc_callback |
Line Detect Interrupt Priority | Priority 2 |
External IRQ Driver on r_icu
Property | Value |
---|---|
Name | g_touch_irq |
Channel | 0 |
Trigger | Falling |
Digital Filtering | Enabled |
Trigger | Falling |
Digital Filtering | Enabled |
Digital Filtering Sample Clock | PCLK / 64 |
Callback | touch_irq_cb |
Pin Interrupt Priority | Priority 5 |
IRQ00 | P206 |
I2C Master Driver on r_iic_master
Property | Value |
---|---|
Name | g_i2c_touch |
Channel | 2 |
Rate | Fast-mode |
Rise Time (ns) | 120 |
Fall Time (ns) | 120 |
Duty Cycle (%) | 50 |
Slave Address | 0x38 |
Address Mode | 7-bit |
Timeout Mode | Short Mode |
Callback | touch_i2c_callback |
Interrupt Priority Level | Priority 6 |
SDA | P511 |
SCL | P512 |
QSPI Driver on r_qspi
Property | Value |
---|---|
Name | g_qspi0 |
Minimum QSSL Deselect Cycles | 8 QSPCLK |
Timer Driver on r_gpt
Property | Value |
---|---|
Name | g_timer_PWM |
Channel | 7 |
Mode | PWM |
Period | 10 |
Period Unit | Milliseconds |
Duty Cycle Percent | 75 |
GTIOCA Output Enabled | True |
GTIOCA | P603 |
UART Driver on r_sci_uart
Property | Value |
---|---|
Name | g_uart0 |
Channel | 0 |
Data Bits | 8bits |
Parity | None |
Stop Bits | 1bit |
TXD_MOSI | P411 |
RXD_MISO | P410 |
Available under certain Qt licenses.
Find out more.