diff --git a/boards/mikroe/clicker_ra4m1/Kconfig.mikroe_clicker_ra4m1 b/boards/mikroe/clicker_ra4m1/Kconfig.mikroe_clicker_ra4m1 new file mode 100644 index 00000000000..1fe44feec08 --- /dev/null +++ b/boards/mikroe/clicker_ra4m1/Kconfig.mikroe_clicker_ra4m1 @@ -0,0 +1,5 @@ +# Copyright (c) 2024 Ian Morris +# SPDX-License-Identifier: Apache-2.0 + +config BOARD_MIKROE_CLICKER_RA4M1 + select SOC_R7FA4M1AB3CFM diff --git a/boards/mikroe/clicker_ra4m1/board.cmake b/boards/mikroe/clicker_ra4m1/board.cmake new file mode 100644 index 00000000000..3f00aea418d --- /dev/null +++ b/boards/mikroe/clicker_ra4m1/board.cmake @@ -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) diff --git a/boards/mikroe/clicker_ra4m1/board.yml b/boards/mikroe/clicker_ra4m1/board.yml new file mode 100644 index 00000000000..1635cd26a5d --- /dev/null +++ b/boards/mikroe/clicker_ra4m1/board.yml @@ -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 diff --git a/boards/mikroe/clicker_ra4m1/doc/img/mikroe_clicker_ra4m1.jpg b/boards/mikroe/clicker_ra4m1/doc/img/mikroe_clicker_ra4m1.jpg new file mode 100644 index 00000000000..0d9acc54989 Binary files /dev/null and b/boards/mikroe/clicker_ra4m1/doc/img/mikroe_clicker_ra4m1.jpg differ diff --git a/boards/mikroe/clicker_ra4m1/doc/index.rst b/boards/mikroe/clicker_ra4m1/doc/index.rst new file mode 100644 index 00000000000..5af9aa1125a --- /dev/null +++ b/boards/mikroe/clicker_ra4m1/doc/index.rst @@ -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 diff --git a/boards/mikroe/clicker_ra4m1/mikroe_clicker_ra4m1.dts b/boards/mikroe/clicker_ra4m1/mikroe_clicker_ra4m1.dts new file mode 100644 index 00000000000..b15242c5fea --- /dev/null +++ b/boards/mikroe/clicker_ra4m1/mikroe_clicker_ra4m1.dts @@ -0,0 +1,95 @@ +/* + * Copyright (c) 2024 Ian Morris + * + * SPDX-License-Identifier: Apache-2.0 + */ + +/dts-v1/; +#include +#include +#include +#include + +/ { + 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 = ; + }; + }; + + aliases { + led0 = &ld1; + led1 = &ld2; + sw0 = &btn1; + }; +}; + +&pinctrl { + sci0_default: sci0_default { + group1 { + pinmux = , ; + }; + }; +}; + +&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>; +}; diff --git a/boards/mikroe/clicker_ra4m1/mikroe_clicker_ra4m1.yaml b/boards/mikroe/clicker_ra4m1/mikroe_clicker_ra4m1.yaml new file mode 100644 index 00000000000..9cc16dc9c8d --- /dev/null +++ b/boards/mikroe/clicker_ra4m1/mikroe_clicker_ra4m1.yaml @@ -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 diff --git a/boards/mikroe/clicker_ra4m1/mikroe_clicker_ra4m1_defconfig b/boards/mikroe/clicker_ra4m1/mikroe_clicker_ra4m1_defconfig new file mode 100644 index 00000000000..3d89bdc283d --- /dev/null +++ b/boards/mikroe/clicker_ra4m1/mikroe_clicker_ra4m1_defconfig @@ -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