Skip to content

Arduino IDE

Tip

For first-time users, who have never programmed before and are looking to use the Arduino IDE, we recommend beginning with the SparkFun Inventor's Kit (SIK), which is designed to help users get started programming with the Arduino IDE.

Most users should already be familiar with the Arduino IDE and its use. However, for those of you who have never heard the name Arduino before, feel free to check out the Arduino website. To get started with using the Arduino IDE, check out our tutorials below:

Arduino Core

Installation

Installing the Ported Renesas-Arduino Core

In order to program the RA6M5 Thing Plus in the Arduino IDE, users will need to install the Arduino Renesas Portenta board definitions from the Renesas-Arduino core. However, until the RA6M5 Thing Plus is officially adopted into the Renesas-Arduino core, users need to utilize our port of the Renesas-Arduino core.

  1. Before users can install our ported version of the Renesas-Arduino core, they should first install the Arduino Renesas Portenta board definitions of the official Renesas-Arduino core in the Arduino IDE.
    • This will ensure that any required compilation and upload tools are installed for the Arduino core.
    • In the Board Manager of the Arduino IDE, select and install the Arduino Renesas Portenta board definitions from the Renesas-Arduino core.
      Install the Renesas-Arduino Core
      Installing the Renesas-Arduino core in the Arduino IDE.
  2. Once installed, users will need to locate the packages directory for the Arduino cores in the Arduino IDE:

    • Windows


      On Windows, the directory location may vary based on whether the Arduino IDE was installed for an individual user or all users:

      • The user's AppData directory (hidden folder - primary):

        C:\Users\<insert username>\AppData\Local\Arduino15\packages
        
      • The user's ArduinoData directory (local):

        C:\Users\<insert username>\Documents\Arduino\hardware
        
      • The Program Files or Program Files(x86) directories:

        C:\Program Files(x86)\Arduino IDE
        
    • MacOS


      With Mac OS, users should check the Applications and Library directories:

      • Library directory (primary):

        ~/Library/Arduino15/packages/
        
      • Applications directory (local):

        /Applications/Arduino.app/hardware
        
    • Linux


      For Linux, this may be located in the following directories:

      • Primary:

        /home/$USER/.arduino15/packages
        
      • Local:

        /home/$USER/Arduino/hardware
        
      Tip

      As mentioned in Arduino's guide for installing the Arduino IDE on Linux, users may need to run the following commands in the terminal:

      sudo add-apt-repository universe
      sudo apt install libfuse2
      

      In order to utilize the serial terminal or recognize the board in DFU mode, users may also need to run the following commands in the terminal:

      usermod -a -G dialout $USERNAME
      usermod -a -G plugdev $USERNAME
      
      • $USERNAME is the login username
      • After, a restart or logout is required
  3. After the packages directory has been located, users will need to navigate to the Renesas Arduino core. It is usually located in the ./arduino/hardware/renesas_portenta/<version number>/ directory of the packages folder.

  4. The Arduino core is followed by a directory, named after the Arduino core's release <version number>. From there, users will need to create a new directory/folder in the renesas_portenta directory with the version number bumped up.
    • For example, if the current version is 1.1.0, users can name the new directory 1.2.0.
  5. Next, users will need to download and extract the files from our ported version of the Renesas-Arduino core:
      Download our Renesas-Arduino Core (Ported)
  6. Once extracted, users will need to copy over the files from our ported version of the Renesas-Arduino coreinto the new directory that was created earlier:
    Extracted files
    The files extracted from our ported version of the Renesas-Arduino core.
  7. Once the extracted files have been copied into the new directory, users will need to install the USB drivers for the board by executing the post-install.* script:
    • Windows: post-install.bat
    • Mac/Linux: post-install.sh

Info

This information is accurate as of April 2024; however, it may become irrelevant in the future (once the RA6M5 Thing Plus is included in the Renesas-Arduino core). At which point, users may disregard this note and/or request for this information to be updated by filing an issue.

Do Not Use - Hardware Not Officially Supported (yet)

Warning

The instructions below are invalid; theRA6M5 Thing Plus has not been officially added into the Renesas-Arduino core. In the meantime, users will need to utilize our port of the Renesas-Arduino core (see instructions above).

In order to program the RA6M5 Thing Plus in the Arduino IDE, users will need to install the Renesas-Arduino core. The Arduino core can be found by searching for Arduino Renesas Portenta Boards in the Board Manager of the Arduino IDE. Once installed, the RA6M5 Thing Plus will become available in the Board Manager.

Arduino Renesas Portenta Boards

For users who are unfamiliar with this process, please check out our tutorial on installing an Arduino core.

Install the Renesas-Arduino Core
Installing the Renesas-Arduino core in the Arduino IDE.

Programming a Board

In order to upload a sketch from the Arduino IDE onto the RA6M5 Thing Plus, users will need to select the SparkFun Thing Plus RA6M5 from the Tools > Board > Arduino Renesas Portenta Boards > SparkFun Thing Plus RA6M5 drop-down menu. Users will also need to select the serial port from the Tools > Port drop-down menu; the port should be automatically labeled, based upon the PID/VID of board in the USB driver.

Select the RA6M5 Thing Plus

Selecting the SparkFun Thing Plus RA6M5 from the Tools drop-down menu in the Arduino IDE.

Select the RA6M5 Thing Plus

Searching for the SparkFun Thing Plus RA6M5 in the Select Other Board and Port menu in the Arduino IDE.

Alternatively, in the Arduino IDE (v2.x.x), users can also search for the board and serial port in the Select Other Board and Port menu. Once the appropriate board and serial port have been selected in the Arduino IDE, users can click the (upload) button to begin the compilation and upload process.

DFU Mode

If users are having issues uploading code to the board, the RA6M5 can be manually forced into DFU mode. This issue, often occurs when the USB connection is busy and a reset can't be triggered on the RA6M5, to initialize the upload process. To force the RA6M5 Thing Plus into DFU mode:

  1. Double-tap the RST button
    • The STAT LED should be fading in/out very slowly
  2. Users should now, be able to upload a new program
    • It shouldn't be necessary to select a COM port in the Arduino IDE; only the board needs to be selected
  3. Once programming is complete, the MCU should reboot on its own. Otherwise:
    • Press the RST button
    • Power cycle the board

Arduino Libraries

In order to utilize some of the peripherals of the RA6M5 Thing Plus with the Arduino IDE, users will need to install Arduino libraries for the peripheral devices/interfaces. For users who are unfamiliar with this process, please check out our tutorial below:

MAX17048 Fuel Gauge

While users are free to choose any Arduino library that provides support for MAX17048 fuel gauge, we recommend the SparkFun MAX1704x Arduino library; as it has been tested and verified to work with the MAX17048 on the RA6M5 Thing Plus. The SparkFun MAX1704x Fuel Gauge Arduino library can be installed from the Library Manager in the Arduino IDE by searching for:

SparkFun MAX1704x Fuel Gauge Arduino Library

Install the SparkFun MAX1704x Arduino library

SparkFun MAX1704x Fuel Gauge Arduino library in the library manager of the Arduino IDE.

Manually Download the Arduino Library

For users who would like to manually download and install the library, the *.zip file can be accessed from the GitHub repository or downloaded by clicking the button below.

Download the Arduino Library

WS2812 RGB LED

While users are free to choose any Arduino library that provides support for WS2812 LEDs, we recommend the FastLED Arduino library. It has been tested and verified to work with the RGB LED on the RA6M5 Thing Plus. The FastLED Arduino library can be installed from the Library Manager in the Arduino IDE by searching for:

FastLED Arduino Library

Install the FastLED Arduino library

FastLED Arduino library in the library manager of the Arduino IDE.

Manually Download the Arduino Library

For users who would like to manually download and install the library, the *.zip file can be accessed from the GitHub repository or downloaded by clicking the button below.

Download the Arduino Library

How to Define Parameters

While using the FastLED Arduino library, users need to define the following parameters to the WS2812 RGB LED included on the board. However, if additional LEDs are connected externally to the board, then the appropriate values should be provided for the Arduino library.

#define NUM_LEDS 1
There is only one WS2812 LED on the board
#define DATA_PIN LED_RGB
Declare which pin is connected to the WS2812 LED. On the RA6M5 Thing Plus, it is defined as D13 or RGB_LED in the Arduino core for GPIO P105.
#define LED_TYPE WS2812
Declare the LED type for the library; the RA6M5 Thing Plus only includes WS2812 RGB LED on the board.

DA14531MOD BLE Module

While an Arduino library isn't necessary to utilize the CodeLess™ AT commands for the DA14531MOD Bluetooth module, we have created an unofficial Arduino library to help users get started. As an official library, users will need to manually download and install the library into the Arduino IDE; it will not be available through the Library Manager.

Manually Download the Arduino Library

To manually download and install the library, the files can be accessed from our GitHub repository or the *.zip can be downloaded by clicking the button below.

Download the Arduino Library

Tip

In this Arduino library, there are several examples for configuring the Bluetooth connectivity of the DA14531MOD.

However, we also include a SerialPassThrough example. Once programmed on the RA6M5 Thing Plus, it allows users to directly interface with the DA14531MOD's UART port through the board's USB connection using a serial terminal. Therefore, enabling users to experiment with the CodeLess AT commands and develop their own BLE connectivity solution.