# Project Name: CddUart_Idle_Demo

---
## Functional Description

+ This code is a demonstration showing how to use the CddUart Idle interrupt to receive variable-length data.
+ In this demo, the UART2 is used in UART mode with ***a baud rate of 115200, 8 data bits, 1 stop bit, and no parity***.  

---
## Usage Instructions

+ Open a serial debugger, set the baud rate to 115200, 8 data bits, 1 stop bit, and no parity, then debug and run the sample code.
+ The user can freely input a set of data smaller than the maximum receive length (32 bytes in this example), and the MCU will echo back the received data content.
+ Of course, if the input data length exceeds or equals the maximum length, the reception will complete, and the MCU will return the received data (up to the maximum receive length) to the user.
+ The complete example of this demo is shown in the figure below, where the blue text represents the data sent by the user to the MCU, and the green text represents the information echoed back by the MCU:![Demo Example](demo_example.png)

---
## Operation Instructions

+ ***Step 1***: Launch the sample YCT project file (**CddUart_Demo.yct**) using YCT tool and configure the toolchain as needed (default: VS Code + GCC).
+ ***Step 2***: Generate the code. Modify configurations if necessary (to accommodate your hardware design), ensuring all changes are correct and error-free before code generation.
+ ***Step 3***: Open the generated project in your preferred development environment (VS Code/IAR/Keil IDE) based on your configuration.
+ ***Step 4***: Compile the project, power on the EVB, and flash the compiled executable using an available debugger (e.g., J-Link debug probe).
+ ***Step 5***: Power off the board, disconnect JTAG/SWD debug cables, then power on again.
+ ***Step 6***: Configure a serial terminal with 115200 baud rate, 8 data bits, 1 stop bit, and no parity. Follow the steps in the Feature Description section to proceed.
---


## Hardware requirement
+ **EVB**: YTM32B1MD2-EVB-Q100-Rev.B
+ **Debugger**: J-Link HW v9 or later with YUNTU `YTM32B1MD2` patch(support package) installed.

---

## Software requirement

+ **Config & Code Generation Tool**
  + **MCAL**: Yuntu Config Tool(YCT) v2.7.8 or later version
+ **Compiler Toolchain**
  + **GCC**: GNU GCC v10.3 or later version
  + **Keil/MDK**: ARM Keil/MDK v5.36 or later version(`armclang v6.18.2` is recommended to be used as the compiler)
  + **IAR**: IAR v9.50 or later version
  + **VS Code**: Microsoft Visual Studio Code IDE v1.76 or later version(C/C++ support, GNU toolchain, CMake v3.25, ninja, Cortex-Debug extensions installation required)
+ **Debugger driver**
    + **J-Link**: SEGGER J-Link v7.82 or later version, YUNTU `YTM32B1MD2` patch(support package) installation required.
    + **Ozone Debugger tool**: SEGGER Ozone v3.28 or later version.

    ***Note***: **YTM32B1MD2** patch install required which can be obtained via **YCT** or contact ***YUNTU sales/FAE team***.

---