|
| 1 | +.. zephyr:board:: rzg2ul_smarc |
| 2 | +
|
| 3 | +Overview |
| 4 | +******** |
| 5 | + |
| 6 | +The Renesas RZ/G2UL SMARC Evaluation Board Kit (RZ/G2UL-EVKIT) consists of a SMARC v2.1 module board and a carrier board. |
| 7 | + |
| 8 | +* Device: RZ/G2UL (Type-1) R9A07G043U11GBG |
| 9 | + |
| 10 | + * Cortex-A55 Single, Cortex-M33 |
| 11 | + * BGA361pin, 13mmSq body, 0.5mm pitch |
| 12 | + |
| 13 | +* SMARC v2.1 Module Board Functions |
| 14 | + |
| 15 | + * DDR4 SDRAM: 1GB x 1pc |
| 16 | + * QSPI flash memory: 128Mb x 1pc `AT25QL128A <https://www.renesas.com/en/products/memory-logic/non-volatile-memory/spi-nor-flash/at25ql128a-128mbit-17v-minimum-spi-serial-flash-memory-dual-io-quad-io-and-qpi-support>`_ |
| 17 | + * eMMC memory: 64GB x 1pc |
| 18 | + * The microSD card slot is implemented and used as an eSD for boot |
| 19 | + * 5-output clock oscillator `5P35023 <https://www.renesas.com/en/products/clocks-timing/clock-generation/programmable-clocks/5p35023-versaclock-3s-programmable-clock-generator>`_ implemented |
| 20 | + * PMIC power supply `DA9062 <https://www.renesas.com/en/products/power-management/multi-channel-power-management-ics-pmics/da9062-pmic-designed-applications-requiring-85a>`_ implemented |
| 21 | + |
| 22 | +* Carrier Board Functions |
| 23 | + |
| 24 | + * The FFC/FPC connector is mounted as standard for connection to high-speed serial interface for camera module. |
| 25 | + * The Micro-HDMI connector via DSI/HDMI conversion module is mounted as standard for connection to high-speed serial interface for digital video module. |
| 26 | + * The Micro-AB receptacle (ch0: USB2.0 OTG) and A receptacle (ch1: USB2.0 Host) are respectively mounted as standard for connection to USB interface. |
| 27 | + * The RJ45 connector is mounted as standard for software development and evaluation using Ethernet. |
| 28 | + * The audio codec is mounted as standard for advance development of audio system. The audio jack is implemented for connection to audio interface. |
| 29 | + * The Micro-AB receptacles are implemented for connection to asynchronous serial port interface. |
| 30 | + * The microSD card slot and two sockets for PMOD are implemented as an interface for peripheral functions. |
| 31 | + * For power supply, a mounted USB Type-C receptacle supports the USB PD standard. |
| 32 | + |
| 33 | +Hardware |
| 34 | +******** |
| 35 | + |
| 36 | +The Renesas RZ/G2UL MPU documentation can be found at `RZ/G2UL Group Website`_ |
| 37 | + |
| 38 | +.. figure:: rzg2ul_block_diagram.webp |
| 39 | + :width: 600px |
| 40 | + :align: center |
| 41 | + :alt: RZ/G2UL group feature |
| 42 | + |
| 43 | + RZ/G2UL block diagram (Credit: Renesas Electronics Corporation) |
| 44 | + |
| 45 | +Supported Features |
| 46 | +================== |
| 47 | + |
| 48 | +.. zephyr:board-supported-hw:: |
| 49 | +
|
| 50 | +Programming and Debugging |
| 51 | +************************* |
| 52 | + |
| 53 | +Applications for the ``rzg2ul_smarc`` board can be built in the usual way as |
| 54 | +documented in :ref:`build_an_application`. |
| 55 | + |
| 56 | +Console |
| 57 | +======= |
| 58 | + |
| 59 | +By default, `J-Link RTT Viewer`_ is used by Zephyr running on CM33 for providing serial console. |
| 60 | +The only serial port (SER3_UART micro-USB) is reserved for CA55 to run Linux. |
| 61 | + |
| 62 | +.. note:: |
| 63 | + |
| 64 | + Set SW1-1 on the board to "OFF" to select JTAG debug mode, which is required for |
| 65 | + RTT to work. |
| 66 | + |
| 67 | +There are two ways to use the RTT Viewer on this board. The basic steps for each method are |
| 68 | +described below: |
| 69 | + |
| 70 | +1. Using with Ozone |
| 71 | +------------------- |
| 72 | + |
| 73 | +After the Zephyr application has been built successfully, open J-Link RTT Viewer and configure the |
| 74 | +connection as follows: |
| 75 | + |
| 76 | +- **Connect to J-Link**: Existing Session (enable Auto Reconnect) |
| 77 | +- **RTT Control Block**: Auto Detection |
| 78 | +- Click **OK** |
| 79 | + |
| 80 | +Next, open `Ozone Debugger`_ and choose "Create New Project". Inside the "New Project Wizard" |
| 81 | +configure the settings as follows: |
| 82 | + |
| 83 | +- **Device**: R9A07G043U11 |
| 84 | +- **Register Set**: Cortex-M33 |
| 85 | +- Click **Next** |
| 86 | +- **Target Interface**: SWD |
| 87 | +- **Target Interface Speed**: 4MHz |
| 88 | +- **Host Interface**: USB |
| 89 | +- Click **Next** |
| 90 | +- Set the full path of ``zephyr.elf`` file. The path should resemble ``zephyrproject/zephyr/build/zephyr/zephyr.elf`` |
| 91 | +- Click **Next**, leave all options by default, and click **Finish** |
| 92 | +- Press **F5** to download and reset program |
| 93 | + |
| 94 | +2. Using with U-Boot |
| 95 | +-------------------- |
| 96 | + |
| 97 | +After the Zephyr application has been built successfully, open the ``zephyr.map`` file located in |
| 98 | +``zephyrproject\zephyr\build\zephyr\zephyr.map``. Locate the symbol ``_SEGGER_RTT`` and copy its |
| 99 | +address value in hexadecimal. |
| 100 | + |
| 101 | +Then, perform the "Flashing" steps described below to run the Zephyr application using U-Boot. As soon as the |
| 102 | +application is invoked, open J-Link RTT Viewer and configure the connection as follows: |
| 103 | + |
| 104 | +- **Connect to J-Link**: USB |
| 105 | +- **Specify Target Device**: R9A07G043U11 (enable Force go on connect) |
| 106 | +- **Target Interface & Speed**: SWD @ 4000 kHz |
| 107 | +- **RTT Control Block**: Select "Address", then paste the address of the ``_SEGGER_RTT`` symbol copied earlier. |
| 108 | +- Click **OK** |
| 109 | + |
| 110 | +.. note:: |
| 111 | + |
| 112 | + When using RTT Viewer with a Zephyr application launched by U-Boot, it is important to connect |
| 113 | + the RTT Viewer immediately after executing the U-Boot command sequence. This helps avoid losing |
| 114 | + early log output. |
| 115 | + |
| 116 | +Debugging |
| 117 | +========= |
| 118 | + |
| 119 | +It is possible to load and execute a Zephyr application binary on |
| 120 | +this board on the Cortex-M33 System Core from |
| 121 | +the internal SRAM, using ``JLink`` debugger (:ref:`jlink-debug-host-tools`). |
| 122 | + |
| 123 | +Here is an example for building and debugging with the :zephyr:code-sample:`hello_world` application. |
| 124 | + |
| 125 | +.. zephyr-app-commands:: |
| 126 | + :zephyr-app: samples/hello_world |
| 127 | + :board: rzg2ul_smarc/r9a07g043u11gbg/cm33 |
| 128 | + :goals: build debug |
| 129 | + |
| 130 | +Flashing |
| 131 | +======== |
| 132 | + |
| 133 | +RZ/G2UL-EVKIT is designed to start different systems on different cores. |
| 134 | +It uses Yocto as the build system to build Linux system and boot loaders |
| 135 | +to run Zephyr on Cortex-M33 with u-boot. The minimal steps are described below. |
| 136 | + |
| 137 | +1. Follow "2.2 Building Images" of `SMARC EVK of RZ/G2L, RZ/G2LC, RZ/G2UL Linux Start-up Guide`_ to prepare the build environment. |
| 138 | + |
| 139 | +2. At step (4), follow step "2. Download Multi-OS Package" and "3. Add the layer for Multi-OS Package" |
| 140 | + of "3.2 OpenAMP related stuff Integration for RZ/G2L, RZ/G2LC and RZ/G2UL" of `Release Note for RZ/G Multi-OS Package V2.2.0`_ |
| 141 | + to add the layer for Multi-OS Package. |
| 142 | + |
| 143 | + .. code-block:: console |
| 144 | +
|
| 145 | + $ cd ~/rzg_vlp_<pkg ver> |
| 146 | + $ unzip <Multi-OS Dir>/r01an5869ej0220-rzg-multi-os-pkg.zip |
| 147 | + $ tar zxvf r01an5869ej0220-rzg-multi-os-pkg/meta-rz-features_multi-os_v2.2.0.tar.gz |
| 148 | + $ bitbake-layers add-layer ../meta-rz-features/meta-rz-multi-os/meta-rzg2l |
| 149 | +
|
| 150 | +3. Start the build: |
| 151 | + |
| 152 | + .. code-block:: console |
| 153 | +
|
| 154 | + $ MACHINE=smarc-rzg2ul bitbake core-image-minimal |
| 155 | +
|
| 156 | + The below necessary artifacts will be located in the build/tmp/deploy/images |
| 157 | + |
| 158 | + +---------------+------------------------------------------------------+ |
| 159 | + | Artifacts | File name | |
| 160 | + +===============+======================================================+ |
| 161 | + | Boot loader | bl2_bp-smarc-rzg2ul.srec | |
| 162 | + | | | |
| 163 | + | | fip-smarc-rzg2ul.srec | |
| 164 | + +---------------+------------------------------------------------------+ |
| 165 | + | Flash Writer | Flash_Writer_SCIF_RZG2UL_SMARC_DDR4_1GB_1PCS.mot | |
| 166 | + +---------------+------------------------------------------------------+ |
| 167 | + |
| 168 | +4. Follow "4.2 Startup Procedure" of `SMARC EVK of RZ/G2L, RZ/G2LC, RZ/G2UL Linux Start-up Guide`_ for power supply and board setting |
| 169 | + at SCIF download (SW11[1:4] = OFF, ON, OFF, ON) and (SW1[1:3] = ON, OFF, OFF) |
| 170 | + |
| 171 | +5. Follow "4.3 Download Flash Writer to RAM" of `SMARC EVK of RZ/G2L, RZ/G2LC, RZ/G2UL Linux Start-up Guide`_ to download Flash Writer to RAM |
| 172 | + |
| 173 | +6. Follow "4.4 Write the Bootloader" of `SMARC EVK of RZ/G2L, RZ/G2LC, RZ/G2UL Linux Start-up Guide`_ to write the boot loader |
| 174 | + to the target board by using Flash Writer. |
| 175 | + |
| 176 | +7. Follow "4.5 Change Back to Normal Boot Mode" with switch setting (SW11[1:4] = OFF, OFF, OFF, ON) and (SW1[1:2] = ON, OFF) |
| 177 | + |
| 178 | +8. Follow "3. Preparing the SD Card" of `SMARC EVK of RZ/G2L, RZ/G2LC, RZ/G2UL Linux Start-up Guide`_ to write files to the microSD Card |
| 179 | + |
| 180 | +9. Copy zephyr.bin file to microSD card |
| 181 | + |
| 182 | +10. Follow "4.4.2 CM33 Sample Program Invocation with u-boot" from the beginning to step 4 of `Release Note for RZ/G Multi-OS Package V2.2.0`_ |
| 183 | + |
| 184 | +11. Execute the commands stated below on the console to start zephyr application with CM33 core. |
| 185 | + Here, "N" stands for the partition number in which you stored zephyr.bin file. |
| 186 | + |
| 187 | + .. code-block:: console |
| 188 | +
|
| 189 | + Hit any key to stop autoboot: 2 |
| 190 | + => dcache off |
| 191 | + => mmc dev 1 |
| 192 | + => fatload mmc 1:N 0x00010000 zephyr.bin |
| 193 | + => fatload mmc 1:N 0x40010000 zephyr.bin |
| 194 | + => cm33 start_normal 0x00010000 0x40010000 |
| 195 | + => dcache on |
| 196 | +
|
| 197 | +Troubleshooting |
| 198 | +=============== |
| 199 | + |
| 200 | +By default, the only valid serial port (SER3_UART micro-USB port) controlled by SCIF0 is used by Linux to |
| 201 | +print Linux console output. Therefore, in order to use it from Zephyr, the Linux console must first be disabled. |
| 202 | +To do this, run the following command in the Linux console to unbind the SCIF0 driver: |
| 203 | + |
| 204 | +.. code-block:: console |
| 205 | +
|
| 206 | + $ echo 1004b800.serial | tee /sys/bus/platform/drivers/sh-sci/unbind |
| 207 | +
|
| 208 | +This allows the SCIF0 to be accessed from the Zephyr side in debug mode for providing serial console. |
| 209 | +Please note that the SCIF0 driver is disabled by default on the Zephyr side to prevent conflicts. |
| 210 | + |
| 211 | +References |
| 212 | +********** |
| 213 | + |
| 214 | +.. target-notes:: |
| 215 | + |
| 216 | +.. _RZ/G2UL Group Website: |
| 217 | + https://www.renesas.com/en/products/microcontrollers-microprocessors/rz-mpus/rzg2ul-general-purpose-microprocessors-single-core-arm-cortex-a55-10ghz-cpu-and-single-core-arm-cortex-m33 |
| 218 | + |
| 219 | +.. _RZG2UL-EVKIT Website: |
| 220 | + https://www.renesas.com/en/products/microcontrollers-microprocessors/rz-mpus/rzg2ul-evkit-evaluation-board-kit-rzg2ul-mpu |
| 221 | + |
| 222 | +.. _SMARC EVK of RZ/G2L, RZ/G2LC, RZ/G2UL Linux Start-up Guide: |
| 223 | + https://www.renesas.com/en/document/gde/smarc-evk-rzg2l-rzg2lc-rzg2ul-linux-start-guide-rev106 |
| 224 | + |
| 225 | +.. _Release Note for RZ/G Multi-OS Package V2.2.0: |
| 226 | + https://www.renesas.com/en/document/rln/release-note-rzg-multi-os-package-v220?r=1522841 |
| 227 | + |
| 228 | +.. _J-Link RTT Viewer: |
| 229 | + https://www.segger.com/products/debug-probes/j-link/tools/rtt-viewer |
| 230 | + |
| 231 | +.. _Ozone Debugger: |
| 232 | + https://www.segger.com/products/development-tools/ozone-j-link-debugger/ |
0 commit comments