Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions boards/renesas/ek_ra4m1/Kconfig.ek_ra4m1
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Copyright (c) 2024 Ian Morris
# SPDX-License-Identifier: Apache-2.0

config BOARD_EK_RA4M1
select SOC_R7FA4M1AB3CFP
6 changes: 6 additions & 0 deletions boards/renesas/ek_ra4m1/board.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Copyright (c) 2024 Ian Morris
# SPDX-License-Identifier: Apache-2.0

board_runner_args(pyocd "--target=r7fa4m1ab")

include(${ZEPHYR_BASE}/boards/common/pyocd.board.cmake)
8 changes: 8 additions & 0 deletions boards/renesas/ek_ra4m1/board.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Copyright (c) 2024 Ian Morris
# SPDX-License-Identifier: Apache-2.0

board:
name: ek_ra4m1
vendor: renesas
socs:
- name: r7fa4m1ab3cfp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
87 changes: 87 additions & 0 deletions boards/renesas/ek_ra4m1/doc/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
.. _renesas_ek_ra4m1:

Renesas EK-RA4M1
################

Overview
********

The Renesas EK-RA4M1 development board contains a Renesas Cortex-M4 based
R7FA4M1AB3CFP Microcontroller operating at up to 48 MHz with 256 KB of Flash
memory and 32 KB of SRAM.

.. figure:: img/renesas_ek_ra4m1.jpg
:align: center
:alt: Renesas EK-RA4M1

EK-RA4M1 (Credit: Courtesy of Renesas Electronics Corporation)

Hardware
********

The EK-RA4M1 board contains two USB connectors, a user LED, a push
button and a reset button. It has J-Link onboard and two PMOD sockets for
interfacing with external electronics. For more information about the
evalutation kit board see the `Renesas EK-RA4M1 website`_.

Supported Features
==================

The Zephyr Renesas EK-RA4M1 configuration supports the following hardware
features:

+-----------+------------+-------------------------------------+
| Interface | Controller | Driver/Component |
+===========+============+=====================================+
| NVIC | on-chip | nested vector interrupt controller |
+-----------+------------+-------------------------------------+
| UART | on-chip | serial port-polling; |
| | | serial port-interrupt |
+-----------+------------+-------------------------------------+
| PINMUX | on-chip | pinmux |
+-----------+------------+-------------------------------------+
| GPIO | on-chip | GPIO output |
| | | GPIO input |
+-----------+------------+-------------------------------------+

Other hardware features have not been enabled yet for this board.

The default configuration can be found in the defconfig file:
:zephyr_file:`boards/renesas/ek_ra4m1/ek_ra4m1_defconfig`.

Programming and debugging
*************************

Building & Flashing
===================

You can build and flash an application in the usual way (See
:ref:`build_an_application` and
:ref:`application_run` for more details).

Here is an example for building and flashing the :zephyr:code-sample:`blinky` application.

.. zephyr-app-commands::
:zephyr-app: samples/basic/blinky
:board: ek_ra4m1
:goals: build flash

Debugging
=========

Debugging also can be done in the usual way.
The following command is debugging the :zephyr:code-sample:`blinky` application.
Also, see the instructions specific to the debug server that you use.

.. zephyr-app-commands::
:zephyr-app: samples/basic/blinky
:board: ek_ra4m1
:maybe-skip-config:
:goals: debug

References
**********

.. target-notes::

.. _Renesas EK-RA4M1 website: https://www.renesas.com/us/en/products/microcontrollers-microprocessors/ra-cortex-m-mcus/ek-ra4m1-evaluation-kit-ra4m1-mcu-group
86 changes: 86 additions & 0 deletions boards/renesas/ek_ra4m1/ek_ra4m1.dts
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
/*
* Copyright (c) 2024 Ian Morris
*
* SPDX-License-Identifier: Apache-2.0
*/

/dts-v1/;
#include <renesas/ra/r7fa4m1ab3cfp.dtsi>
#include <zephyr/dt-bindings/pinctrl/renesas/pinctrl-r7fa4m1xxxxxx.h>
#include <zephyr/dt-bindings/gpio/gpio.h>
#include <zephyr/dt-bindings/input/input-event-codes.h>

/ {
model = "Renesas EK-RA4M1";
compatible = "renesas,r7fa4m1ab3cfp";

chosen {
zephyr,console = &uart1;
zephyr,shell-uart = &uart1;
zephyr,sram = &sram0;
zephyr,flash = &flash0;
};

leds {
compatible = "gpio-leds";
ld1: led_1 {
gpios = <&ioport1 6 GPIO_ACTIVE_HIGH>;
label = "User LED";
};
};

buttons {
compatible = "gpio-keys";
button1: button_1 {
gpios = <&ioport1 5 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>;
label = "User Push Button";
zephyr,code = <INPUT_KEY_0>;
};
};

aliases {
led0 = &ld1;
sw0 = &button1;
};
};

&pinctrl {
sci1_default: sci1_default {
group1 {
pinmux = <P401_TXD1>, <P402_RXD1>;
};
};
};

&sci1 {
status = "okay";
pinctrl-0 = <&sci1_default>;
pinctrl-names = "default";
uart1: uart {
current-speed = <115200>;
status = "okay";
};
};

&ioport1 {
status = "okay";
};

&fcu {
status = "okay";
};

&mosc {
status = "okay";
clock-frequency = <12000000>;
};

&cgc {
clock-source = <&mosc>;
iclk-div = <1>;
pclka-div = <1>;
pclkb-div = <2>;
pclkc-div = <1>;
pclkd-div = <1>;
fclk-div = <2>;
};
14 changes: 14 additions & 0 deletions boards/renesas/ek_ra4m1/ek_ra4m1.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
identifier: ek_ra4m1
name: Renesas EK-RA4M1
vendor: renesas
type: mcu
arch: arm
toolchain:
- zephyr
- gnuarmemb
- xtools
ram: 32
flash: 256
supported:
- gpio
- uart
22 changes: 22 additions & 0 deletions boards/renesas/ek_ra4m1/ek_ra4m1_defconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Copyright (c) 2024 Ian Morris
# SPDX-License-Identifier: Apache-2.0

CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC=12000000

CONFIG_BUILD_OUTPUT_HEX=y

# enable uart driver
CONFIG_SERIAL=y

# enable console
CONFIG_CONSOLE=y
CONFIG_UART_CONSOLE=y

# enable GPIO
CONFIG_GPIO=y

# enable pin controller
CONFIG_PINCTRL=y

# enable Clocks
CONFIG_CLOCK_CONTROL=y
12 changes: 12 additions & 0 deletions dts/arm/renesas/ra/r7fa4m1ab3cfp.dtsi
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/*
* Copyright (c) 2024 Ian Morris
*
* SPDX-License-Identifier: Apache-2.0
*/

#define RA_SOC_PINS 100
#define RA_SOC_HAS_MSTPCRE 1
#define RA_SOC_MSTPD5_CHANNELS 1

#include <zephyr/dt-bindings/clock/r7fa4m1xxxxxx-clock.h>
#include <renesas/ra/ra4-cm4-common.dtsi>
7 changes: 7 additions & 0 deletions soc/renesas/ra/ra4m1/Kconfig.soc
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,15 @@ config SOC_R7FA4M1AB3CFM
help
R7FA4M1AB3CFM

config SOC_R7FA4M1AB3CFP
bool
select SOC_SERIES_RA4M1
help
R7FA4M1AB3CFP

config SOC_SERIES
default "ra4m1" if SOC_SERIES_RA4M1

config SOC
default "r7fa4m1ab3cfm" if SOC_R7FA4M1AB3CFM
default "r7fa4m1ab3cfp" if SOC_R7FA4M1AB3CFP
1 change: 1 addition & 0 deletions soc/renesas/ra/soc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ family:
- name: ra4m1
socs:
- name: r7fa4m1ab3cfm
- name: r7fa4m1ab3cfp
- name: ra8m1
socs:
- name: r7fa8m1ahecbd