.. _rzg2l_install-ren-soft: Development environment setup ============================= This page describes the complete setup needed to develop and debug firmware on the Cortex®-M33 coprocessor of RZ/G2L modules (QSRZ-G2L, TXRZ-G2L): the host software (Renesas FSP and Multi-OS Package), the J-Link debug connection, and the BSP changes (``copro`` distro feature and ``karo-copro`` devicetree overlay). Renesas Flexible Software Package (FSP) --------------------------------------- The Renesas RZ/G2L CM33 Multi-OS Package is the software package consisting of RZ/G2L Cortex®-M33 Flexible Software Package (FSP) as software package for Renesas MCU with Arm® Cortex®-M33 Core and OpenAMP as standardization API of framework for interprocessor communication for developing multi OS solution. The Renesas Flexible Software Package (FSP) is an optimized software package designed to provide easy to use, scalable, high quality software for embedded system design. The primary goal is to provide lightweight, efficient drivers that meet common use cases in embedded systems. To install the FSP download the manual `Getting Started with Flexible Software Package `_ and follow the installation instructions. RZ/G2L Multi-OS Package ----------------------- After FSP is installed, you can download the RZ/G2L CM33 Multi-OS Package from `here `_ . Start the e² studio and load the CM33 Sample Program project. .. _rzg2l-cm33-evk-setup: Setting up the eval kit for CM33 debugging ------------------------------------------ This section describes how to debug the Cortex®-M33 firmware of a TXRZ-G2L module mounted on a TX Mainboard7 with a Segger J-Link. The document Release Note for RZ/G2L Multi-OS Package shows how to load and debug CM33 firmware with a Segger J-Link connection. Operating mode selection ~~~~~~~~~~~~~~~~~~~~~~~~ There are two processor signals, that must be setup correctly to enable JTAG debugging: **DEBUGEN:** Switches between normal operation and debug operation. **BSCANP:** Switches between normal operation and boundary scan test model. Operating Mode: +----------+----------+-------------------------------------+ | BSCANP | DEBUGEN | Operating mode | +==========+==========+=====================================+ | 0 | 0 | Normal operation | +----------+----------+-------------------------------------+ | 0 | 1 | Debug operations | +----------+----------+-------------------------------------+ | 1 | X | Boundary scan test mode | +----------+----------+-------------------------------------+ The two signals can be controlled with the jumper field JP5-JTAGMODE on the TX Mainboard7: .. figure:: images/mb7-jp5.png :scale: 80 % :align: left :figwidth: 100% To debug the Cortex®-M33 core via JTAG, the JP5 jumpers must be set in the following way: .. figure:: images/cm33-mb7-jp5.png :scale: 60 % :align: left :figwidth: 100% J-Link connection ~~~~~~~~~~~~~~~~~ The 10-pin haeder of the SEGGER J-Link adapter must be connected to the 20-pin JTAG header ST6 on the TX Mainboard7 with an appropriate adapter in the following way: +-------------------------+-------------------------+-------------------------+ | Segger J-Link mini | MB7 JTAG ICE Interface | Functionality | +=========================+=========================+=========================+ | 1 - VTref | 1 - 3V3 | IO voltage reference | +-------------------------+-------------------------+-------------------------+ | 2 - SWDIO/TMS | 7 - TMS | | +-------------------------+-------------------------+-------------------------+ | 3 - GND | 4-20 - GND | | +-------------------------+-------------------------+-------------------------+ | 4 - SWCLK/TCK | 9 - TCK | | +-------------------------+-------------------------+-------------------------+ | 5 - GND | 4-20 - GND | | +-------------------------+-------------------------+-------------------------+ | 6 - SWO/TDO | 13 - TDO | | +-------------------------+-------------------------+-------------------------+ | 7 - NC | | unused | +-------------------------+-------------------------+-------------------------+ | 8 - TDI | 5 - TDI | | +-------------------------+-------------------------+-------------------------+ | 9 - NC | | unused | +-------------------------+-------------------------+-------------------------+ | 10 - nRESET | 15 SRESET# | board reset | +-------------------------+-------------------------+-------------------------+ .. _rzg2l-cm33-copro-inst: Customizing the BSP for coprocessor support ------------------------------------------- The BSP changes needed to run Cortex®-M33 firmware on RZ/G2L modules are the ``copro`` distro feature and the ``karo-copro`` devicetree overlay. To download and start the Cortex®-M33 firmware from U-Boot, the U-Boot command **cm33** must be implemented. Also the Linux-kernel needs some features implemented to communicate between the main processors and the coprocessor. To support customers, Ka-Ro provides the distro feature **copro**. To add the distro feature to your build, edit the file conf/local.conf in your yocto build directory and add the line: .. code-block:: text DISTRO_FEATURES:append = " copro" Furthermore, some special entries into the device tree are necessary. These are provided by the devicetree overlay **karo-copro** To add the karo-copro overlay, the name of the copro-overlay should be added to the appropriate overlays_* variable: .. prompt:: :prompts: U-Boot > setenv overlays_ ${overlays_} karo-copro saveenv reset If you are working with a TX- module on the TX Mainboard 7 ready-to-use development system, then the setup looks like this: .. prompt:: :prompts: U-Boot > setenv overlays_mb7 ${overlays_mb7} karo-copro setenv baseboard mb7 saveenv Please note, the variable baseboard must be setup correctly for the overlay to be loaded.