Skip to content

Commit

Permalink
Documentation/ra4m1: Add documentation for Renesas RA4M1 MCU and ardu…
Browse files Browse the repository at this point in the history
…ino-r4-minima

Signed-off-by: leocafonso <[email protected]>
  • Loading branch information
leocafonso committed Feb 25, 2025
1 parent a0d142c commit d37162f
Show file tree
Hide file tree
Showing 3 changed files with 191 additions and 0 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
106 changes: 106 additions & 0 deletions Documentation/platforms/arm/ra4m1/boards/arduino-r4-minima/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
=================
Arduino R4 Minima
=================

This board features the R7FA4M1ABxCFM MCU with 256 KiB of FLASH
and 32 KiB of SRAM running at 64 MHz (internal clock - HOCO).

.. figure:: arduino-r4-minima.png
:align: center

See the `Arduino website <https://docs.arduino.cc/hardware/uno-r4-minima/>`_ for
information about Arduino R4 Minima.

Buttons and LEDs
================

Buttons
-------

There are no buttons on the Arduino R4 Minima board.

LEDs
----

There are three user-controllable LEDs on board the Arduino R4 Minima:

============== =====
LED GPIO
============== =====
L Amber LED P111
TX Yellow LED P012
RX Yellow LED P013
============== =====

LED L is connected to ground and can be illuminated by driving the P111
output high. The TX and RX LEDs are pulled high and can be illuminated by
driving the corresponding GPIO output low.

These LEDs are not used by the board port unless ``CONFIG_ARCH_LEDS`` is
defined. In that case, the usage by the board port is defined in
``include/board.h`` and ``src/ra_autoleds.c``. The LEDs are used to encode OS-related
events as follows:

================== ========================= ====== ===== =====
SYMBOL MEANING L TX RX
================== ========================= ====== ===== =====
LED_STARTED NuttX has been started OFF OFF OFF
LED_HEAPALLOCATE Heap has been allocated OFF OFF OFF
LED_IRQSENABLED Interrupts enabled OFF OFF OFF
LED_STACKCREATED Idle stack created ON OFF OFF
LED_INIRQ In an interrupt N/C GLOW OFF
LED_SIGNAL In a signal handler N/C GLOW OFF
LED_ASSERTION An assertion failed N/C GLOW OFF
LED_PANIC The system has crashed N/C N/C Blinking
LED_IDLE MCU is in sleep mode NA NA NA
================== ========================= ====== ===== =====


Thus, if LED L is statically on, NuttX has successfully booted and is
apparently running normally. If LED RX is glowing, then NuttX is
handling interrupts (and also signals and assertions). If TX is flashing
at approximately 2 Hz, then a fatal error has been detected, and the system
has halted.

Serial Consoles
===============

The R7FA4M1ABxCFM has a UART and 4 SCI (UARTs).

Any of the SCI interfaces may be used as a serial console. By default,
SCI2 is used as the serial console in all configurations. This can be
easily changed by modifying the configuration.

================== ============
Arduino R4 Minima R7FA4M1ABxCFM
Pin (Label) SCI Mapping
================== ============
0 (RX0<-0) RXD2
1 (TX0->1) TXD2
13 (12) RXD9
14 (~11) TXD9
SWD-7 RXD1
SWD-8 TXD1
================== ============

Loading Code
============

It is possible to use J-Link on the SWD connector or use USB Boot
available through the USB-C connector.

RA USB Boot:
------------

Reboot the board with BOOT shorted to GND and press the reset button twice (double click). The board will enumerate as "Renesas RA USB Boot."

Then, flash the ``nuttx.hex`` file using ``rfp-cli``:
(https://www.renesas.com/en/software-tool/renesas-flash-programmer-programming-gui)

Example command:

.. code-block:: bash
rfp-cli -device ra -port /dev/ttyACM0 -p ./build/nuttx.hex
*Note:* Programming using the binary format will fail because, by default, the RA4M1 NuttX port writes to the ``.idcode`` section, which is located beyond the end of the flash area. This causes the RFP to attempt writing to protected regions, leading to failures.
85 changes: 85 additions & 0 deletions Documentation/platforms/arm/ra4m1/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
=============
Renesas RA4M1
=============

Supported MCUs
==============

The following list includes MCUs from RA4M1 series and indicates whether
they are supported in NuttX

============= ======= ================
MCU Support Note
============= ======= ================
R7FA4M1ABxCFP Yes
R7FA4M1ABxCLJ No
R7FA4M1ABxCFM Yes
R7FA4M1ABxCNB No
R7FA4M1ABxCFL Yes
R7FA4M1ABxCNE No
R7FA4M1ABxCNF No
============= ======= ================

Peripheral Support
==================

The following list indicates peripherals supported in NuttX:

========== ======= =====================================
Peripheral Support Notes
========== ======= =====================================
FLASH No
CLOCK Yes Partially, just internal clock (HOCO)
ICU Yes
KINT No
ELC No
DTC No
DMAC No
GPT No
AGT No
RTC No
WDT No
IWDT No
SCI Yes Just UART
IIC No
SPI No
SSIE No
QSPI No
SDHI No
CAN No
USBFS No
ADC14 No
DAC12 No
DAC8 No
ACMPLP No
OPAMP No
TSN No
SLCDC No
CTSU No
CRC No
DOC No
GPIO Yes
========== ======= =====================================

SCI
----

The Serial Communications Interface (SCI) is configurable to support several serial communication modes: Asynchronous (UART), Clock synchronous, Simple SPI
Smart card interface, Simple IIC (master-only).
Nuttx driver support UART mode (No-FIFO).

GPIO
-----



Pins can be configured/operated using ``ra_gpio_*`` functions.

Supported Boards
================

.. toctree::
:glob:
:maxdepth: 1

boards/*/*

0 comments on commit d37162f

Please sign in to comment.