RH850 D1M1A 设置指导

This topic helps you setup the development environment for Renesas' RH850.

设置开发环境

先决条件

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

  • Qt for MCUs SDK
  • Qt Creator v4.12.4 或更高版本
  • CMake 3.15 或更高版本
  • Ninja 1.10.0 或更高版本

    注意: Ninja is an optional build tool and can be replaced with others like JOM or NMake. It is not needed when using Qt Creator.

  • Install Green Hills Multi IDE. Qt for MCUs is tested against version 7.1.6 together with Compiler 2018.1.5 and Probe 5.6.4 for V800.
  • Install Renesas Graphics Library for D1M1/2(H) for Green Hills Compiler. Qt for MCUs is tested against version 1.9.1a

Qt Creator IDE

  • 发起 Qt Creator 并选择 工具 > 选项 > 设备 > MCU .
  • 选择 Qt for MCUs 1.7 - RH850-D1M1A-BAREMETAL 32bpp from the drop-down list for Target supported by the Qt for MCUs SDK .
  • Ensure that the Green Hills Compiler and Renesas Graphics Library path are correct.
  • 要求 section, ensure that the platform-specific requirements are met.
  • 选择 Automatically create kits for all available targets on start to create kits automatically.

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

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

注意: 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 .

命令行设置

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>
    									

    其中,

    • <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.1.0 .
  • 创建 GHS_COMPILER_DIR environment variable and set it to the GHS Compiler installation path. For example:
    GHS_COMPILER_DIR=C:\ghs\comp_201815
    									
  • 创建 RGL_DIR environment variable and set it to the Renesas Graphics Library installation path. For example:
    RGL_DIR=C:\Renesas_Electronics\D1x_RGL\rgl_ghs_D1Mx_obj_V1.9.1a
    									

构建配置

Qt Creator provides a build configuration with the kit that you created earlier for the Qt for MCUs 1.7 - RH850-D1M1A-BAREMETAL 32bpp target. If you are using a command-line setup, configure using the following CMake variables. For more information, see the CMake 手册 .

警告: Please note that Ninja Generator causes issues with an incremental build on GHS. It is recommended to use NMake Makefiles or NMake Makefiles JOM . If Ninja generator is still used CMake will display a warning.

  • QUL_PLATFORM

    The platform to build must be set to rh850-d1m1a-baremetal for this board.

    -DQUL_PLATFORM=rh850-d1m1a-baremetal
    									
  • CMAKE_TOOLCHAIN_FILE

    此平台支持 GHS 工具链 .

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

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

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

    -DQUL_COLOR_DEPTH=32
    									

板配置

Connect the Mango Adapter to the Main Board, and ensure that all jumpers and switches are set exactly as described.

启用 HDMI 输出

To enable HDMI video output, follow the jumper and dip-switch configuration.

On the Mango Main Board:

  • Connect the JP96 pins
  • Open JP98 pins 2 and 3, and connect pin PJ99 to JP98-2.
  • DSW31.7 switch set to OFF

On the Mango Adapter Board:

  • DSW1.1 switch set to OFF

启用刷新

To enable flashing and debugging, ensure that the following switch configuration is set:

Switch State
SW3 PU
SW5 OFF
SW9 OFF
SW2 PU
SW7 PD
SW1 OFF
SW4 OFF
SW6 PD
SW8 OFF
SW10 PD

启用 HMI (人机界面) 区间

To be able to use the HMI section on the board (HMI knob and 4-direction switch), open JP30 and set the DWS29.1-1 switches to ON.

注意: This setup can interfere with CAN. See Mango Main Board reference docs for more details.

采用预构建 Qt Quick Ultralite 库构建应用程序

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 运行 or press Ctrl+r on your keyboard to build and flash the binary to the target.

命令行

以下范例构建 automotive demo for RH850 D1M1A:

cd %Qul_DIR%\demos\automotive
mkdir build
cd build
cmake .. -G "Ninja" -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=%Qul_DIR%\lib\cmake\Qul\toolchain\ghs.cmake -DQUL_PLATFORM=RH850-D1M1A-baremetal
cmake --build .
							

The same procedure applies to any other application.

特定平台 CMake 选项

Following CMake options are available exclusively for this platform:

CMake Option 描述
QUL_USE_DEFAULT_RH850_STARTUP_FILE By default Qt Quick Ultralite is using startup file that comes with the RGL library. Set this global variable to OFF to disable this behavior. Then you are able to add your custom startup file to the executable target sources.

刷新

可以使用 Renesas Flash Programmer in order to flash the Automotive demo binary to the RH850 D1M1A board. The binary can be found in the following location build_rh850\demos\automotive\automotive.run

  1. Launch Renesas Flash Programmer
  2. Create a new project by using menu File > New Project...

  3. Enter desired project name and location. Click Connect button

  4. Set Clock window appears, enter 8 MHz as Main Clock Frequency and click OK button

  5. When the setup completes, you should see Operation Completed message in the output window
  6. In the main window, ensure that the Operation tab is selected. Click the Browse... button, and navigate to the directory that contains the compiled binary and select it.
  7. 点击 Start button and wait for the operation to complete
  8. Disconnect Renesas flash programmer from the board

调试

可以使用 Renesas e2 studio to debug applications built with QUL.

  1. 打开 Renesas e2 studio
  2. Create new C/C++ Project
  3. 选择 Renesas Debug Only Project
  4. Enter Project name and click Next >
  5. 选择 Debug hardware depends on which debug probe you have E1 (RH850) or E2 (RH850)
  6. 选择 RH850 > RH850/D1M1A-V2 > R7F701462 作为 Target Device
  7. Provide executable path to binary you want debug, e.g. %Qul_DIR%\build_rh850\examples\chess\chess.run
  8. 选择 Finish
  9. 选择 Launch in 'Debug' mode
  10. GDB server will upload your binary to the target and start debugging