boards: mikroe: add initial support for Mikroe RA4M1 Clicker

The RA4M1 Clicker is a basic development board for the Renesas RA4M1
Microcontroller. The board contains J-Link on board, two LEDs and push
buttons and several headers for interfacing with external devices.

Signed-off-by: Ian Morris <ian.d.morris@outlook.com>
This commit is contained in:
Ian Morris 2023-11-12 16:25:42 -08:00 committed by Maureen Helm
commit 04e60be9bf
8 changed files with 237 additions and 0 deletions

View file

@ -0,0 +1,5 @@
# Copyright (c) 2024 Ian Morris
# SPDX-License-Identifier: Apache-2.0
config BOARD_MIKROE_CLICKER_RA4M1
select SOC_R7FA4M1AB3CFM

View file

@ -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)

View file

@ -0,0 +1,8 @@
# Copyright (c) 2024 Ian Morris
# SPDX-License-Identifier: Apache-2.0
board:
name: mikroe_clicker_ra4m1
vendor: mikroe
socs:
- name: r7fa4m1ab3cfm

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

View file

@ -0,0 +1,87 @@
.. _mikroe_clicker_ra4m1:
Mikroe Clicker RA4M1
####################
Overview
********
The Mikroe Clicker RA4M1 development board contains a Renesas Cortex-M4 based
R7FA4M1AB3CFM Microcontroller operating at up to 48 MHz with 256 KB of Flash
memory and 32 KB of SRAM.
.. figure:: img/mikroe_clicker_ra4m1.jpg
:align: center
:alt: Clicker RA4M1
Clicker RA4M1 (Credit: MikroElektronika d.o.o.)
Hardware
********
The Clicker RA4M1 board contains a USB Type-C connector, two LEDs, two push
buttons, and a reset button. It has J-Link onboard and mikroBUS socket for
interfacing with external electronics. For more information about the
development board see the `Clicker RA4M1 website`_.
Supported Features
==================
The Zephyr Mikroe Clicker RA4M1 configuration supports the following hardware
features:
+-----------+------------+-------------------------------------+
| Interface | Controller | Driver/Component |
+===========+============+=====================================+
| NVIC | on-chip | nested vector interrupt controller |
+-----------+------------+-------------------------------------+
| UART | on-chip | serial port-polling |
+-----------+------------+-------------------------------------+
| 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/mikroe/clicker_ra4m1/mikroe_clicker_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: mikroe_clicker_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: mikroe_clicker_ra4m1
:maybe-skip-config:
:goals: debug
References
**********
.. target-notes::
.. _Clicker RA4M1 website:
https://www.mikroe.com/ra4m1-clicker

View file

@ -0,0 +1,95 @@
/*
* Copyright (c) 2024 Ian Morris
*
* SPDX-License-Identifier: Apache-2.0
*/
/dts-v1/;
#include <renesas/ra/r7fa4m1ab3cfm.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 = "Mikroe Clicker RA4M1";
compatible = "renesas,r7fa4m1ab3cfm";
chosen {
zephyr,console = &uart0;
zephyr,shell-uart = &uart0;
zephyr,sram = &sram0;
zephyr,flash = &flash0;
};
leds {
compatible = "gpio-leds";
ld1: led_1 {
gpios = <&ioport4 9 GPIO_ACTIVE_HIGH>;
label = "User LED 1";
};
ld2: led_2 {
gpios = <&ioport4 8 GPIO_ACTIVE_HIGH>;
label = "User LED 2";
};
};
buttons {
compatible = "gpio-keys";
btn1: button_1 {
gpios = <&ioport3 4 GPIO_ACTIVE_LOW>;
label = "User Button 1";
zephyr,code = <INPUT_KEY_0>;
};
};
aliases {
led0 = &ld1;
led1 = &ld2;
sw0 = &btn1;
};
};
&pinctrl {
sci0_default: sci0_default {
group1 {
pinmux = <P410_RXD0>, <P411_TXD0>;
};
};
};
&sci0 {
status = "okay";
pinctrl-0 = <&sci0_default>;
pinctrl-names = "default";
uart0: uart {
current-speed = <115200>;
status = "okay";
};
};
&ioport3 {
status = "okay";
};
&ioport4 {
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>;
};

View file

@ -0,0 +1,14 @@
identifier: mikroe_clicker_ra4m1
name: Mikroe Clicker RA4M1
vendor: mikroe
type: mcu
arch: arm
toolchain:
- zephyr
- gnuarmemb
- xtools
ram: 32
flash: 256
supported:
- gpio
- uart

View file

@ -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