circuitpython/ports/renesas-ra
Damien George abb13b1e1e extmod/lwip-include: Factor common lwIP config into lwipopts_common.h.
This lwIP configuration file has options that are common to all ports, and
the ports are updated to use this file.  This change is a no-op, the lwIP
configuration remains the same for the four ports using this common file.

This reduces code duplication, keeps the ports in sync, and makes it easier
to update the configuration for all ports at once.

Signed-off-by: Damien George <damien@micropython.org>
2025-01-29 12:36:27 +11:00
..
boards renesas-ra/boards: Add configuration.xml for auto-generated files. 2024-09-26 17:36:34 +10:00
fsp_cfg renesas-ra: Fix spelling mistakes found by codespell. 2024-03-07 14:15:49 +11:00
lwip_inc extmod/lwip-include: Factor common lwIP config into lwipopts_common.h. 2025-01-29 12:36:27 +11:00
mbedtls all: Update bindings, ports and tests for mbedtls v3.5.1. 2024-01-30 11:08:46 +11:00
ra renesas-ra: Fix spelling mistakes found by codespell. 2024-03-07 14:15:49 +11:00
boardctrl.c all: Remove the "STATIC" macro and just use "static" instead. 2024-03-07 14:20:42 +11:00
boardctrl.h renesas-ra/modmachine: Allow boards to provide custom bootloader code. 2022-06-17 13:38:55 +10:00
build_all_boards.sh renesas-ra: Change MICROPY_HW_BOARD_NAME definition to product name. 2023-04-27 14:12:53 +10:00
extint.c renesas-ra/extint: Fix issue with Pin.irq not triggering. 2024-09-26 17:40:30 +10:00
extint.h renesas-ra: Add new port to Renesas RA. 2022-04-29 12:29:06 +09:00
factoryreset.c renesas-ra: Add new port to Renesas RA. 2022-04-29 12:29:06 +09:00
factoryreset.h renesas-ra: Add new port to Renesas RA. 2022-04-29 12:29:06 +09:00
fatfs_port.c renesas-ra: Add new port to Renesas RA. 2022-04-29 12:29:06 +09:00
flash.c renesas-ra: Add new port to Renesas RA. 2022-04-29 12:29:06 +09:00
flash.h renesas-ra: Add new port to Renesas RA. 2022-04-29 12:29:06 +09:00
flashbdev.c all: Remove the "STATIC" macro and just use "static" instead. 2024-03-07 14:20:42 +11:00
gccollect.c renesas-ra/softtimer: Switch to use softtimer code from shared/runtime. 2022-07-19 13:46:28 +10:00
gccollect.h renesas-ra: Add new port to Renesas RA. 2022-04-29 12:29:06 +09:00
help.c ports: Standardise docs link in help text. 2023-06-02 11:48:46 +10:00
irq.c all: Remove the "STATIC" macro and just use "static" instead. 2024-03-07 14:20:42 +11:00
irq.h ports: Move definitions of ATOMIC_SECTION macros to mphalport.h. 2023-12-01 14:37:48 +11:00
led.c all: Remove the "STATIC" macro and just use "static" instead. 2024-03-07 14:20:42 +11:00
led.h renesas-ra: Add new port to Renesas RA. 2022-04-29 12:29:06 +09:00
machine_adc.c all: Remove the "STATIC" macro and just use "static" instead. 2024-03-07 14:20:42 +11:00
machine_dac.c all: Remove the "STATIC" macro and just use "static" instead. 2024-03-07 14:20:42 +11:00
machine_i2c.c all: Remove the "STATIC" macro and just use "static" instead. 2024-03-07 14:20:42 +11:00
machine_pin.c all: Remove the "STATIC" macro and just use "static" instead. 2024-03-07 14:20:42 +11:00
machine_pwm.c all: Remove the "STATIC" macro and just use "static" instead. 2024-03-07 14:20:42 +11:00
machine_rtc.c all: Remove the "STATIC" macro and just use "static" instead. 2024-03-07 14:20:42 +11:00
machine_sdcard.c all: Remove the "STATIC" macro and just use "static" instead. 2024-03-07 14:20:42 +11:00
machine_spi.c all: Remove the "STATIC" macro and just use "static" instead. 2024-03-07 14:20:42 +11:00
machine_uart.c renesas-ra/machine_uart: Implement UART.IRQ_RXIDLE based on softtimer. 2024-08-29 16:27:43 +10:00
main.c all: Remove the "STATIC" macro and just use "static" instead. 2024-03-07 14:20:42 +11:00
Makefile renesas-ra/usb: Use interrupt rather than polling for USB task. 2024-09-26 17:45:16 +10:00
modmachine.c all: Remove the "STATIC" macro and just use "static" instead. 2024-03-07 14:20:42 +11:00
modmachine.h extmod/modmachine: Provide common bindings for 6 bare-metal functions. 2023-11-30 16:11:11 +11:00
modos.c all: Remove the "STATIC" macro and just use "static" instead. 2024-03-07 14:20:42 +11:00
modtime.c all: Remove the "STATIC" macro and just use "static" instead. 2024-03-07 14:20:42 +11:00
mpbthciport.c all: Remove the "STATIC" macro and just use "static" instead. 2024-03-07 14:20:42 +11:00
mpbthciport.h renesas-ra: Add Bluetooth support using NimBLE. 2023-09-14 23:50:47 +10:00
mpconfigboard_common.h renesas-ra: Consolidate MICROPY_PY_MACHINE_I2C option. 2023-11-30 16:11:11 +11:00
mpconfigport.h renesas-ra/mpconfigport: Switch FATFS LFN to type 2. 2024-12-10 11:04:59 +11:00
mpconfigport.mk renesas-ra: Add new port to Renesas RA. 2022-04-29 12:29:06 +09:00
mphalport.c renesas-ra/mphalport: Refactor to use shared TinyUSB CDC functions. 2024-05-31 19:47:37 +10:00
mphalport.h shared/tinyusb: Wake main task if needed at end of USB ISR. 2024-10-07 11:06:57 +11:00
mpnetworkport.c renesas-ra: Tune lwip buffers and timing to improve network performance. 2023-10-03 10:17:51 +11:00
mpnimbleport.c renesas-ra: Add Bluetooth support using NimBLE. 2023-09-14 23:50:47 +10:00
mpnimbleport.h renesas-ra: Add Bluetooth support using NimBLE. 2023-09-14 23:50:47 +10:00
mpthreadport.c all: Remove the "STATIC" macro and just use "static" instead. 2024-03-07 14:20:42 +11:00
mpthreadport.h ports: Don't include mpthread.h in mpthreadport.h. 2024-02-29 13:35:36 +11:00
pendsv.c renesas-ra/pendsv: Remove preemptive keyboard interrupt via PendSV. 2024-10-15 10:32:24 +11:00
pendsv.h renesas-ra/pendsv: Remove preemptive keyboard interrupt via PendSV. 2024-10-15 10:32:24 +11:00
pin.h renesas-ra/boards/make-pins.py: Update to use tools/boardgen.py. 2023-11-03 14:18:54 +11:00
powerctrl.c extmod/modmachine: Provide common bindings for 6 bare-metal functions. 2023-11-30 16:11:11 +11:00
powerctrl.h extmod/modmachine: Provide common bindings for 6 bare-metal functions. 2023-11-30 16:11:11 +11:00
powerctrlboot.c renesas-ra: Add new port to Renesas RA. 2022-04-29 12:29:06 +09:00
pybthread.c all: Remove the "STATIC" macro and just use "static" instead. 2024-03-07 14:20:42 +11:00
pybthread.h renesas-ra: Add new port to Renesas RA. 2022-04-29 12:29:06 +09:00
qstrdefsport.h all: Rename mod_umodule*, ^umodule* to remove the "u" prefix. 2023-06-08 17:54:07 +10:00
RA4M1_hal.h renesas-ra: Add support for RA6M5, and add machine PWM, DAC, SDCard. 2023-06-27 12:30:25 +10:00
RA4W1_hal.h renesas-ra: Add support for RA6M5, and add machine PWM, DAC, SDCard. 2023-06-27 12:30:25 +10:00
RA6M1_hal.h renesas-ra: Add support for RA6M5, and add machine PWM, DAC, SDCard. 2023-06-27 12:30:25 +10:00
RA6M2_hal.h renesas-ra: Add support for RA6M5, and add machine PWM, DAC, SDCard. 2023-06-27 12:30:25 +10:00
RA6M5_hal.h renesas-ra: Add support for RA6M5, and add machine PWM, DAC, SDCard. 2023-06-27 12:30:25 +10:00
ra_hal.c renesas-ra: Consolidate hal_entry.c code and remove hal_entry() func. 2023-05-24 11:44:17 +10:00
ra_it.c all: Remove the "STATIC" macro and just use "static" instead. 2024-03-07 14:20:42 +11:00
ra_it.h renesas-ra: Add new port to Renesas RA. 2022-04-29 12:29:06 +09:00
README.md renesas-ra/README: Add basic details about board autogen files. 2024-09-26 17:27:42 +10:00
rng.c renesas-ra: Add RNG driver. 2023-09-14 23:50:47 +10:00
rng.h renesas-ra: Add RNG driver. 2023-09-14 23:50:47 +10:00
rtc.h extmod/modmachine: Clean up decls of machine types to use common ones. 2023-10-26 16:20:53 +11:00
spi.h renesas-ra: Add support for RA6M5, and add machine PWM, DAC, SDCard. 2023-06-27 12:30:25 +10:00
storage.c all: Remove the "STATIC" macro and just use "static" instead. 2024-03-07 14:20:42 +11:00
storage.h renesas-ra: Add new port to Renesas RA. 2022-04-29 12:29:06 +09:00
systick.c renesas-ra: Fix spelling mistakes found by codespell. 2024-03-07 14:15:49 +11:00
systick.h renesas-ra: Add new port to Renesas RA. 2022-04-29 12:29:06 +09:00
timer.c all: Remove the "STATIC" macro and just use "static" instead. 2024-03-07 14:20:42 +11:00
timer.h renesas-ra: Add new port to Renesas RA. 2022-04-29 12:29:06 +09:00
uart.c renesas-ra/pendsv: Remove preemptive keyboard interrupt via PendSV. 2024-10-15 10:32:24 +11:00
uart.h renesas-ra/machine_uart: Implement UART.IRQ_RXIDLE based on softtimer. 2024-08-29 16:27:43 +10:00
usbd.c shared/tinyusb: Add a helper for hex string conversion. 2023-11-16 14:59:48 +11:00
usrsw.c all: Remove the "STATIC" macro and just use "static" instead. 2024-03-07 14:20:42 +11:00
usrsw.h renesas-ra: Add new port to Renesas RA. 2022-04-29 12:29:06 +09:00

The Renesas RA port

This is a port of MicroPython to the Renesas RA family of microcontrollers. Currently supported features are:

  • Filesystem on the internal flash using FatFs.
  • time module with sleep, time, and ticks functions.
  • os module with VFS support.
  • machine module with the following classes: Pin, ADC, PWM, DAC, I2C, SPI, SoftI2C, SoftSPI, UART, RTC, SDCard.
  • sdcard module for MCUs without native machine.SDCard support.

Currently supported board product names are:

  • EK-RA6M2
  • RA4M1 CLICKER
  • EK-RA6M1
  • EK-RA4M1
  • EK-RA4W1

Please refer to the quick reference of renesas-ra port for more information about the boards.

Build instructions

  • MicroPython cross-compier The MicroPython cross-compiler must be built first, which will be used to pre-compile (freeze) built-in Python code. THis cross-compiler is built and run on the host machine, using:

    $ make -C mpy-cross
    

    This command should be executed from the root directory of this repository. All other commands below should be executed from the ports/renesas-ra/ directory.

  • Arm compiler An Arm compiler is required for the build, along with the associated binary utilities. The default compiler is arm-none-eabi-gcc, which is available for Linux, Mac and Windows hosts via https://developer.arm.com/downloads/-/arm-gnu-toolchain-downloads. The compiler can be changed using the CROSS_COMPILE variable when invoking make.

  • Protocol buffer compiler Building for the ARDUINO_PORTENTA_C33 board will build the esp_hosted driver, that depends on the Protocol Buffer Compiler being installed. On Debian/Ubuntu, this can be installed with sudo apt-get install protobuf-compiler.

  • Obtain submodules First the submodules must be obtained using:

    $ make submodules
    
  • Build binary image .hex Then to build for a given board subdirectory name, run:

    $ make BOARD=EK_RA6M2 clean
    $ make BOARD=EK_RA6M2
    

    The default board subdirectory name is EK_RA6M2 (which is for EK-RA6M2 board) but any of the names of the subdirectories in the boards/ directory can be passed as the argument to BOARD=; for example RA4M1_CLICKER, EK_RA4M1, EK_RA4W1 and EK_RA6M1. The above command should produce binary images firmware.hex in the build-EK_RA6M2/` subdirectory (or the equivalent directory for the board specified).

Board definition auto-generated code

The supported board definitions contain auto-generated configuration files in the boards/<BOARD_NAME>/ra_cfg and boards/<BOARD_NAME>/ra_gen folders.

These are generated with the RA Smart Configurator tool which is used to define peripheral configuration, pinouts, interrupts etc. for each board.

This tool can be installed either as part of the "Renesas e² studio", or separately with the fsp driver package from https://github.com/renesas/fsp/releases eg.

This tool can be used to create new board definitions or modify existing ones by opening one of the configuration.xml files in the board folders.

Once the configuration.xml file is opened in RA Smart Configurator and modified as needed, the "Generate Project Content" button can be pressed to export new copies of the ra_cfg and ra_gen folders.

Supported/Unsupported functions

Please refer to the renesas-ra quick reference.

Known issues

all boards

  • machine.lightsleep(time_ms) and machine.deepsleep(time_ms) raise uncaught exceptions.

    machine.deepsleep(1000) Uncaught exception in ExtInt interrupt handler line 16 TypeError:

RA4M1-CLICKER

  • mpremote: mount command is not available due to limited memory resources.

EK-RA4M1

  • mpremote: mount command is not available due to limited memory resources.

EK-RA4W1

  • mpremote: "Execution: timeout waiting for remote" error happens when importing a file on /remote.