-
Notifications
You must be signed in to change notification settings - Fork 6.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
boards: renesas: Add support for Renesas EK-RA4M1 #82092
Draft
quytranpzz
wants to merge
6
commits into
zephyrproject-rtos:main
Choose a base branch
from
renesas:renesas_ek_ra4m1
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+579
−2
Draft
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
8e5c2d1
boards: renesas: Add support for Renesas EK-RA4M1 board
quytranpzz 31afb4d
soc: renesas: ra: Add SoC support for Renesas RA4M1
quytranpzz 5833612
dts: renesas: Add device tree support for Renesas RA4M1 SoC
quytranpzz 1208e64
boards: renesas: Add board device tree support for SPI on EK-RA4M1
quytranpzz 5cfd3e5
samples: drivers: counter: Add overlay for Renesas EK-RA4M1
quytranpzz 0c2ad5d
tests: drivers: uart: Add overlay for EK-RA4M1
quytranpzz File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# Copyright (c) 2024 Renesas Electronics Corporation | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
config BOARD_EK_RA4M1 | ||
select SOC_R7FA4M1AB3CFP |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# Copyright (c) 2024 Renesas Electronics Corporation | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
board_runner_args(jlink "--device=R7FA4M1AB") | ||
|
||
include(${ZEPHYR_BASE}/boards/common/jlink.board.cmake) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
board: | ||
name: ek_ra4m1 | ||
full_name: RA4M1 Evaluation Kit | ||
vendor: renesas | ||
socs: | ||
- name: r7fa4m1ab3cfp |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,164 @@ | ||
.. _ek_ra4m1: | ||
|
||
RA4M1 Evaluation Kit | ||
#################### | ||
|
||
Overview | ||
******** | ||
|
||
The MCU integrates multiple series of software- and pin-compatible Arm®-based 32-bit | ||
cores that share a common set of Renesas peripherals to facilitate design scalability | ||
and efficient platform-based product development. | ||
The MCU provides an optimal combination of low-power, high-performance Arm Cortex®-M4 core | ||
running up to 48 MHz with the following features: | ||
|
||
**Renesas RA4M1 Microcontroller Group** | ||
- R7FA4M1AB3CFP | ||
- 100-pin LQFP package | ||
- 48 MHz Arm® Cortex®-M4 core with Floating Point Unit (FPU) | ||
- 32 KB SRAM | ||
- 256 KB code flash memory | ||
- 8 KB data flash memory | ||
|
||
**Connectivity** | ||
- A Device USB connector for the Main MCU | ||
- SEGGER J-Link® On-Board (OB) interface for debugging and programming of the RA4M1 MCU. A | ||
10pin JTAG/SWD interface is also provided for connecting optional external debuggers and | ||
programmers. | ||
- Two PMOD connectors, allowing use of appropriate PMOD compliant peripheral plug-in modules for | ||
rapid prototyping | ||
- Pin headers for access to power and signals for the Main MCU | ||
|
||
**Multiple clock sources** | ||
- Main MCU oscillator crystals, providing precision 12.000 MHz and 32,768 Hz external reference | ||
clocks | ||
- Additional low-precision clocks are available internal to the Main MCU | ||
|
||
**General purpose I/O ports** | ||
- One jumper to allow measuring of Main MCU current | ||
- Copper jumpers on PCB bottom side for configuration and access to selected MCU signals | ||
|
||
**Operating voltage** | ||
- External 5 V input through the Debug USB connector supplies the on-board power regulator to power | ||
logic and interfaces on the board. External 5 V or 3.3 V may be also supplied through alternate | ||
locations on the board. | ||
|
||
- A two-color board status LED indicating availability of regulated power and connection status of the J-Link | ||
interface. | ||
|
||
- A red User LED, controlled by the Main MCU firmware | ||
- A User Push-Button switch, User Capacitive Touch Button sensor, and an optional User Potentiometer, | ||
all of which are controlled by the Main MCU firmware | ||
- MCU reset push-button switch | ||
- MCU boot configuration jumper | ||
|
||
**Special Feature Access** | ||
|
||
- USB Full Speed Debug and Device (micro-AB connector) | ||
|
||
.. figure:: ek_ra4m1.webp | ||
:align: center | ||
:alt: RA4M1 Evaluation Kit | ||
|
||
EK-RA4M1 Board Functional Area Definitions (Credit: Renesas Electronics Corporation) | ||
|
||
Hardware | ||
******** | ||
Detailed hardware feature for the RA4M1 MCU group can be found at `RA4M1 Group User's Manual Hardware`_ | ||
|
||
.. figure:: ra4m1_block_diagram.webp | ||
:width: 442px | ||
:align: center | ||
:alt: RA4M1 MCU group feature | ||
|
||
RA4M1 Block diagram (Credit: Renesas Electronics Corporation) | ||
|
||
Detailed hardware feature for the EK-RA4M1 MCU can be found at `EK-RA4M1 - User's Manual`_ | ||
|
||
Supported Features | ||
================== | ||
|
||
The below features are currently supported on Zephyr OS for EK-RA4M1 board: | ||
|
||
+-----------+------------+----------------------+ | ||
| Interface | Controller | Driver/Component | | ||
+===========+============+======================+ | ||
| GPIO | on-chip | gpio | | ||
+-----------+------------+----------------------+ | ||
| MPU | on-chip | arch/arm | | ||
+-----------+------------+----------------------+ | ||
| NVIC | on-chip | arch/arm | | ||
+-----------+------------+----------------------+ | ||
| UART | on-chip | serial | | ||
+-----------+------------+----------------------+ | ||
| CLOCK | on-chip | clock control | | ||
+-----------+------------+----------------------+ | ||
| COUNTER | on-chip | counter | | ||
+-----------+------------+----------------------+ | ||
| SPI | on-chip | spi | | ||
+-----------+------------+----------------------+ | ||
|
||
Other hardware features are currently not supported by the port. | ||
|
||
Programming and Debugging | ||
************************* | ||
|
||
Applications for the ``ek_ra4m1`` board target configuration can be | ||
built, flashed, and debugged in the usual way. See | ||
:ref:`build_an_application` and :ref:`application_run` for more details on | ||
building and running. | ||
|
||
Flashing | ||
======== | ||
|
||
Program can be flashed to EK-RA4M1 via the on-board SEGGER J-Link debugger. | ||
SEGGER J-link's drivers are avaialbe at https://www.segger.com/downloads/jlink/ | ||
|
||
To flash the program to board | ||
|
||
1. Connect to J-Link OB via USB port to host PC | ||
|
||
2. Make sure J-Link OB jumper is in default configuration as describe in `EK-RA4M1 - User's Manual`_ | ||
|
||
3. Execute west command | ||
|
||
.. code-block:: console | ||
west flash -r jlink | ||
Debugging | ||
========= | ||
|
||
You can use Segger Ozone (`Segger Ozone Download`_) for a visual debug interface | ||
|
||
Once downloaded and installed, open Segger Ozone and configure the debug project | ||
like so: | ||
|
||
* Target Device: R7FA4M1AB | ||
* Target Interface: SWD | ||
* Target Interface Speed: 4 MHz | ||
* Host Interface: USB | ||
* Program File: <path/to/your/build/zephyr.elf> | ||
|
||
**Note:** It's verified that we can debug OK on Segger Ozone v3.30d so please use this or later | ||
version of Segger Ozone | ||
|
||
References | ||
********** | ||
- `EK-RA4M1 Website`_ | ||
- `RA4M1 MCU group Website`_ | ||
|
||
.. _EK-RA4M1 Website: | ||
https://www.renesas.com/us/en/products/microcontrollers-microprocessors/ra-cortex-m-mcus/ek-ra4m1-evaluation-kit-ra4m1-mcu-group | ||
|
||
.. _RA4M1 MCU group Website: | ||
https://www.renesas.com/us/en/products/microcontrollers-microprocessors/ra-cortex-m-mcus/ra4m1-32-bit-microcontrollers-48mhz-arm-cortex-m4-and-lcd-controller-and-cap-touch-hmi | ||
|
||
.. _EK-RA4M1 - User's Manual: | ||
https://www.renesas.com/us/en/document/mat/ek-ra4m1-v1-users-manual | ||
|
||
.. _RA4M1 Group User's Manual Hardware: | ||
https://www.renesas.com/us/en/document/mah/renesas-ra4m1-group-users-manual-hardware?r=1054146 | ||
|
||
.. _Segger Ozone Download: | ||
https://www.segger.com/downloads/jlink#Ozone |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
/* | ||
* Copyright (c) 2024 Renesas Electronics Corporation | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
&pinctrl { | ||
sci1_default: sci1_default { | ||
group1 { | ||
/* tx rx */ | ||
psels = <RA_PSEL(RA_PSEL_SCI_1, 4, 1)>, | ||
<RA_PSEL(RA_PSEL_SCI_1, 4, 2)>; | ||
}; | ||
}; | ||
|
||
spi1_default: spi1_default { | ||
group1 { | ||
/* MISO MOSI RSPCK SSL */ | ||
psels = <RA_PSEL(RA_PSEL_SPI, 2, 2)>, | ||
<RA_PSEL(RA_PSEL_SPI, 2, 3)>, | ||
<RA_PSEL(RA_PSEL_SPI, 2, 4)>, | ||
<RA_PSEL(RA_PSEL_SPI, 2, 5)>; | ||
}; | ||
}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
/* | ||
* Copyright (c) 2024 Renesas Electronics Corporation | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
/dts-v1/; | ||
|
||
#include <renesas/ra/ra4/r7fa4m1ab3cfp.dtsi> | ||
#include <dt-bindings/gpio/gpio.h> | ||
#include "ek_ra4m1-pinctrl.dtsi" | ||
|
||
/ { | ||
model = "Renesas EK-RA4M1"; | ||
compatible = "renesas,ra4m1", "renesas,ra"; | ||
|
||
chosen { | ||
zephyr,sram = &sram0; | ||
zephyr,flash = &flash0; | ||
zephyr,console = &uart1; | ||
zephyr,shell-uart = &uart1; | ||
}; | ||
|
||
leds { | ||
compatible = "gpio-leds"; | ||
led1: led1 { | ||
gpios = <&ioport1 6 GPIO_ACTIVE_HIGH>; | ||
label = "LED1"; | ||
}; | ||
}; | ||
|
||
aliases { | ||
led0 = &led1; | ||
}; | ||
}; | ||
|
||
&xtal { | ||
clock-frequency = <DT_FREQ_M(12)>; | ||
mosel = <0>; | ||
#clock-cells = <0>; | ||
status = "okay"; | ||
}; | ||
|
||
&subclk { | ||
status = "okay"; | ||
}; | ||
|
||
&pll { | ||
clocks = <&xtal>; | ||
div = <2>; | ||
mul = <8 0>; | ||
status = "okay"; | ||
}; | ||
|
||
&sci1 { | ||
pinctrl-0 = <&sci1_default>; | ||
pinctrl-names = "default"; | ||
status = "okay"; | ||
uart1: uart { | ||
current-speed = <115200>; | ||
status = "okay"; | ||
}; | ||
}; | ||
|
||
&ioport1 { | ||
status = "okay"; | ||
}; | ||
|
||
&ioport2 { | ||
status = "okay"; | ||
}; | ||
|
||
&ioport4 { | ||
status = "okay"; | ||
}; | ||
|
||
&spi1 { | ||
pinctrl-0 = <&spi1_default>; | ||
pinctrl-names = "default"; | ||
status = "okay"; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
identifier: ek_ra4m1 | ||
name: Renesas EK-RA4M1 | ||
type: mcu | ||
arch: arm | ||
ram: 32 | ||
flash: 256 | ||
toolchain: | ||
- zephyr | ||
- gnuarmemb | ||
supported: | ||
- gpio | ||
- uart |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# Copyright (c) 2024 Renesas Electronics Corporation | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC=48000000 | ||
|
||
# Enable GPIO | ||
CONFIG_GPIO=y | ||
|
||
# Enable Console | ||
CONFIG_SERIAL=y | ||
CONFIG_UART_INTERRUPT_DRIVEN=y | ||
CONFIG_UART_CONSOLE=y | ||
CONFIG_CONSOLE=y | ||
|
||
CONFIG_BUILD_OUTPUT_HEX=y | ||
CONFIG_BUILD_NO_GAP_FILL=y | ||
CONFIG_CLOCK_CONTROL=y |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shouldn't this be set by SoC?