1# Renesas RSK-RZT2M Development Board BSP Guide 2 3**English** | [**中文**](./README_zh.md) 4 5## Introduction 6 7This document provides the Board Support Package (BSP) guide for the Renesas RSK-RZT2M development board. By reading the quick start section, developers can quickly get started with this BSP and run RT-Thread on the development board. 8 9The main contents are as follows: 10 11- Board introduction 12- BSP quick start guide 13 14## Board Introduction 15 16The RSK-RZT2M MCU evaluation board, based on the Renesas RZ/T2M development, is designed to assist users in evaluating the features of the RA6M4 MCU group and developing embedded system applications through flexible configuration of software packages and IDEs. 17 18The front appearance of the development board is as follows: 19 20 21 22The commonly used **on-board resources** of this development board are as follows: 23 24- MCU: R9A07G075M24GBG, with a maximum operating frequency of 800MHz, dual Arm Cortex®-R52 cores, tightly coupled memory 576KB (with ECC), internal RAM 2 MB (with ECC) 25- Debug interface: On-board J-Link interface 26- Expansion interface: Two PMOD connectors 27 28**More detailed information and tools** 29 30## Peripheral Support 31 32The current support status of peripherals in this BSP is as follows: 33 34| **On-chip Peripheral** | **Support Status** | **Remarks** | 35| :--------------------- | :----------------- | :----------------------------------- | 36| UART | Supported | UART0 is the default log output port | 37| GPIO | Supported | | 38| HWIMER | Supported | | 39| I2C | Not supported | | 40| WDT | Not supported | | 41| RTC | Not supported | | 42| ADC | Not supported | | 43| DAC | Not supported | | 44| SPI | Not supported | | 45| FLASH | Not supported | | 46| PWM | Not supported | | 47| CAN | Not supported | | 48| ETH | Not supported | | 49| More to come... | | | 50 51## Usage Guide 52 53The usage guide is divided into the following two sections: 54 55- Quick Start 56 57 This section is prepared for beginners who are new to RT-Thread. Follow simple steps to run the RT-Thread operating system on this development board and see experimental results. 58 59- Advanced Usage 60 61 This section is prepared for developers who need to utilize more development board resources on the RT-Thread operating system. By using the ENV tool to configure the BSP, more on-board resources can be enabled to achieve more advanced functionalities. 62 63### Quick Start 64 65Currently, this BSP only provides an IAR project. Below is an example of how to get the system up and running using [IAR Embedded Workbench for Arm](https://www.iar.com/products/architectures/arm/iar-embedded-workbench-for-arm/) development environment. 66 67**Hardware Connection** 68 69Connect the development board to the PC using a USB data cable and use the J-link interface for downloading and debugging programs. 70 71**Compilation and Download** 72 73- Navigate to the bsp directory, open ENV, and use the command `scons --target=iar` to generate an IAR project. 74- Compilation: Double-click the project.eww file to open the IAR project and compile the program. 75- Debugging: Click `Project->Download and Debug` on the top-left navigation bar of IAR to download and start debugging. 76 77**Viewing Execution Results** 78 79After successfully downloading the program, the system will automatically run and print system information. 80 81Connect the corresponding serial port of the development board to the PC, open the terminal tool, and select the corresponding serial port (115200-8-1-N). After resetting the device, you can see the output information from RT-Thread. Enter the help command to view the supported commands in the system. 82 83```bash 84 \ | / 85- RT - Thread Operating System 86 / | \ 5.1.0 build Mar 14 2024 18:26:01 87 2006 - 2024 Copyright by RT-Thread team 88 89Hello RT-Thread! 90================================================== 91This is a iar project which mode is ram execution! 92================================================== 93msh >help 94RT-Thread shell commands: 95clear - clear the terminal screen 96version - show RT-Thread version information 97list - list objects 98backtrace - print backtrace of a thread 99help - RT-Thread shell help 100ps - List threads in the system 101free - Show the memory usage in the system 102pin - pin [option] 103 104msh > 105``` 106 107**Application Entry Function** 108 109The entry function of the application layer is in **src\hal_entry.c** under `void hal_entry(void)`. User-written source files can be directly placed in the src directory. 110 111```c 112void hal_entry(void) 113{ 114 rt_kprintf("\nHello RT-Thread!\n"); 115 rt_kprintf("==================================================\n"); 116 rt_kprintf("This is a iar project which mode is ram execution!\n"); 117 rt_kprintf("==================================================\n"); 118 119 while (1) 120 { 121 rt_pin_write(LED_PIN, PIN_HIGH); 122 rt_thread_mdelay(500); 123 rt_pin_write(LED_PIN, PIN_LOW); 124 rt_thread_mdelay(500); 125 } 126} 127``` 128 129### Advanced Usage 130 131**Documentation and Resources** 132 133- [Development Board Official Page](https://www.renesas.cn/cn/zh/products/microcontrollers-microprocessors/rz-mpus/rzt2m-high-performance-multi-function-mpu-realizing-high-speed-processing-and-high-precision-control#overview) 134- [Development Board Datasheet](https://www.renesas.cn/cn/zh/document/dst/rzt2m-group-datasheet?r=1574901) 135- [Development Board Hardware Manual](https://www.renesas.cn/cn/zh/document/mah/rzt2m-group-users-manual-hardware?r=1574901) 136- [RZ/T2M Easy Download Guide](https://www.renesas.cn/cn/zh/document/gde/rzt2m-easy-download-guide?r=1574901) 137- [Renesas RZ/T2M Group](https://www.renesas.cn/cn/zh/document/fly/renesas-rzt2m-group?r=1574901) 138 139**FSP Configuration** 140 141To modify Renesas BSP peripheral configurations or add new peripheral ports, the Renesas [Flexible Software Package (FSP)](https://www2.renesas.cn/jp/zh/software-tool/flexible-software-package-fsp#document) configuration tool is required. Please follow the steps below for configuration. For any configuration issues, feel free to ask in the [RT-Thread Community Forum](https://club.rt-thread.org/). 142 1431. [Download Flexible Software Package (FSP) | Renesas](https://github.com/renesas/rzn-fsp/releases/download/v1.3.0/setup_rznfsp_v1_3_0_rzsc_v2023-07.exe), please use FSP version 1.3.0. 144 1452. Refer to the document [How to import the board support package](https://www2.renesas.cn/document/ppt/1527171?language=zh&r=1527191) on how to add the "RSK-RZT2M board support package" to FSP. 1463. Refer to the document: [RA Series Using FSP to Configure Peripheral Drivers](https://www.rt-thread.org/document/site/#/rt-thread-version/rt-thread-standard/tutorial/make-bsp/renesas-ra/RA系列使用FSP配置外设驱动?id=ra系列使用-fsp-配置外设驱动). 147 148**ENV Configuration** 149 150- How to use the ENV tool: [RT-Thread env tool user manual](https://www.rt-thread.org/document/site/#/development-tools/env/env) 151 152This BSP only enables the UART1 function by default. If you need to use more advanced features such as components, software packages, etc., you need to configure it using the ENV tool. 153 154The steps are as follows: 1551. Open the env tool under bsp. 1562. Enter the `menuconfig` command to configure the project, save and exit after configuration. 1573. Enter the `pkgs --update` command to update the software packages. 1584. Enter the `scons --target=iar` command to regenerate the project. 159 160## Contact Information 161 162If you have any ideas or suggestions during use, we recommend contacting us through the [RT-Thread Community Forum](https://club.rt-thread.org/). 163 164## Code Contribution 165 166If you are interested in RSK-RZT2M and have some interesting projects to share with everyone, feel free to contribute code to us. You can refer to [How to Contribute to RT-Thread Code](https://www.rt-thread.org/document/site/#/rt-thread-version/rt-thread-standard/development-guide/github/github).