1.. _ek_ra4m2:
2
3RA4M2 Evaluation Kit
4####################
5
6Overview
7********
8
9The Renesas RA4M2 group of 32-bit microcontrollers (MCUs) uses the high-performance Arm
10Cortex®-M33 core. In concert with the secure crypto engine, it offers secure element
11functionality. The RA4M2 is built on a highly efficient 40nm process, built on FreeRTOS—and
12is expandable to use other RTOSes and middleware. The RA4M2 is suitable for IoT applications
13requiring vast communication options, future proof security, large embedded RAM, and low
14active power consumption down to 81µA/MHz running the CoreMark® algorithm from Flash.
15
16The MCU in this series incorporates a high-performance Arm Cortex®-M33 core running up to
17100 MHz with the following features:
18
19**Renesas RA4M2 Microcontroller Group**
20- R7FA4M2AD3CFP
21- 100-pin LQFP package
22- 100 MHz Arm® Cortex®-M33 core
23- 512 kB Code Flash, 128 KB SRAM
24- Native pin access through 4 x 28-pin male headers
25- MCU current measurement points for precision current consumption measurement
26-  Multiple clock sources - RA MCU oscillator and sub-clock oscillator crystals, providing
27precision 24.000 MHz and 32,768 Hz reference clock. Additional low-precision clocks are
28available internal to the RA MCU
29
30**System Control and Ecosystem Access**
31- USB Full Speed Host and Device (micro AB connector)
32- Three 5 V input sources
33
34	- USB (Debug, Full Speed)
35	- External power supply (using surface mount clamp test points and power input vias)
36
37- Three Debug modes
38
39	- Debug on-board (SWD)
40	- Debug in (ETM, SWD, and JTAG)
41	- Debug out (SWD)
42
43- User LEDs and buttons
44
45	- Three User LEDs (red, blue, green)
46	- Power LED (white) indicating availability of regulated power
47	- Debug LED (yellow) indicating the debug connection
48	- Two User buttons
49	- One Reset button
50
51- Five most popular ecosystems expansions
52
53	- 2 Seeed Grove® system (I2C/Analog) connectors
54	- SparkFun® Qwiic® connector
55	- 2 Digilent PmodTM (SPI and UART) connectors
56	- ArduinoTM (Uno R3) connector
57	- MikroElektronikaTM mikroBUS connector
58
59- MCU boot configuration jumper
60
61**Special Feature Access**
62- 32 MB (256 Mb) External Quad-SPI Flash
63
64.. figure:: ek_ra4m2.webp
65	:align: center
66	:alt: RA4M2 Evaluation Kit
67
68	EK-RA4M2 Board Functional Area Definitions (Credit: Renesas Electronics Corporation)
69
70Hardware
71********
72Detail Hardware feature for the RA4M2 MCU group can be found at `RA4M2 Group User's Manual Hardware`_
73
74.. figure:: ra4m2_block_diagram.webp
75	:width: 442px
76	:align: center
77	:alt: RA4M2 MCU group feature
78
79	RA4M2 Block diagram (Credit: Renesas Electronics Corporation)
80
81Detail Hardware feature for the EK-RA4M2 MCU can be found at `EK-RA4M2 - User's Manual`_
82
83Supported Features
84==================
85
86The below features are currently supported on Zephyr OS for EK-RA4M2 board:
87
88+-----------+------------+----------------------+
89| Interface | Controller | Driver/Component     |
90+===========+============+======================+
91| GPIO      | on-chip    | gpio                 |
92+-----------+------------+----------------------+
93| MPU       | on-chip    | arch/arm             |
94+-----------+------------+----------------------+
95| NVIC      | on-chip    | arch/arm             |
96+-----------+------------+----------------------+
97| UART      | on-chip    | serial               |
98+-----------+------------+----------------------+
99| CLOCK     | on-chip    | clock control        |
100+-----------+------------+----------------------+
101| SPI       | on-chip    | spi                  |
102+-----------+------------+----------------------+
103| COUNTER   | on-chip    | counter              |
104+-----------+------------+----------------------+
105| ADC       | on-chip    | adc                  |
106+-----------+------------+----------------------+
107| PWM       | on-chip    | pwm                  |
108+-----------+------------+----------------------+
109| I2C       | on-chip    | i2c                  |
110+-----------+------------+----------------------+
111
112Other hardware features are currently not supported by the port.
113
114Programming and Debugging
115*************************
116
117Applications for the ``ek_ra4m2`` board target configuration can be
118built, flashed, and debugged in the usual way. See
119:ref:`build_an_application` and :ref:`application_run` for more details on
120building and running.
121
122Flashing
123========
124
125Program can be flashed to EK-RA4M2 via the on-board SEGGER J-Link debugger.
126SEGGER J-link's drivers are avaialbe at https://www.segger.com/downloads/jlink/
127
128To flash the program to board
129
130  1. Connect to J-Link OB via USB port to host PC
131
132  2. Make sure J-Link OB jumper is in default configuration as describe in `EK-RA4M2 - User's Manual`_
133
134  3. Execute west command
135
136	.. code-block:: console
137
138		west flash -r jlink
139
140Debugging
141=========
142
143You can use Segger Ozone (`Segger Ozone Download`_) for a visual debug interface
144
145Once downloaded and installed, open Segger Ozone and configure the debug project
146like so:
147
148* Target Device: R7FA4M2AD
149* Target Interface: SWD
150* Target Interface Speed: 4 MHz
151* Host Interface: USB
152* Program File: <path/to/your/build/zephyr.elf>
153
154**Note:** It's verified that we can debug OK on Segger Ozone v3.30d so please use this or later
155version of Segger Ozone
156
157References
158**********
159- `EK-RA4M2 Website`_
160- `RA4M2 MCU group Website`_
161
162.. _EK-RA4M2 Website:
163   https://www.renesas.com/us/en/products/microcontrollers-microprocessors/ra-cortex-m-mcus/ek-ra4m2-evaluation-kit-ra4m2-mcu-group
164
165.. _RA4M2 MCU group Website:
166   https://www.renesas.com/us/en/products/microcontrollers-microprocessors/ra-cortex-m-mcus/ra4m2-100mhz-arm-cortex-m33-trustzone-high-integration-lowest-active-power-consumption
167
168.. _EK-RA4M2 - User's Manual:
169   https://www.renesas.com/us/en/document/mat/ek-ra4m2-v1-users-manual
170
171.. _RA4M2 Group User's Manual Hardware:
172   https://www.renesas.com/us/en/document/man/ra4m2-group-users-manual-hardware
173
174.. _Segger Ozone Download:
175   https://www.segger.com/downloads/jlink#Ozone
176