Skip to content

Please add official support for Arduino Nano R4 in the Arduino_CAN library #479

@ohoriyoshi

Description

@ohoriyoshi

I’m currently working with the Arduino Nano R4 (MCU: Renesas R7FA4M1) and trying to use its built-in CAN interface.

However, the current Arduino_CAN library included in ArduinoCore-renesas v1.5.0 does not appear to support the Nano R4 board. The CAN object and related types like CanMsg are not defined when compiling for arduino:renesas_uno:nanor4, which leads to compilation errors.

The following preprocessor conditionals are present in the Arduino_CAN library code:

#if defined(ARDUINO_MINIMA) || defined(ARDUINO_UNOWIFIR4)

#if defined(ARDUINO_MINIMA) || defined(ARDUINO_UNOWIFIR4)

As you can see, the ARDUINO_NANO_R4 macro is not included, so the CAN object is not available for Nano R4 despite it using the exact same RA4M1 MCU as the UNO R4 Minima/WiFi.

By locally modifying the condition as follows, I was able to compile and run CAN sketches successfully on the Nano R4:

#if defined(ARDUINO_UNOR4_MINIMA) || defined(ARDUINO_UNOR4_WIFI) || defined(ARDUINO_NANO_R4)

Since the hardware (pin mapping, CAN peripheral, etc.) is virtually identical, it would be highly beneficial to officially support the Nano R4 in the Arduino_CAN library. This would allow developers to take full advantage of CAN communication on a smaller form factor board.

I kindly request that you consider officially enabling support for Arduino Nano R4 in this library.

Thank you very much for your consideration.

Environment details (optional)
Board: Arduino Nano R4

FQBN: arduino:renesas_uno:nanor4

Arduino IDE: 2.3.6

Core Version: arduino/renesas_uno@1.5.0

Arduino_CAN Library Version: 1.0

CAN operation tested successfully using loopback mode

Metadata

Metadata

Assignees

No one assigned

    Labels

    topic: codeRelated to content of the project itselftype: imperfectionPerceived defect in any part of project

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions