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.
- 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.
-
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
orProgram Files(x86)
directories:C:\Program Files(x86)\Arduino IDE
-
-
MacOS
With Mac OS, users should check the
Applications
andLibrary
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:
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:
$USERNAME
is the login username- After, a restart or logout is required
-
-
-
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 thepackages
folder. - 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 therenesas_portenta
directory with theversion number
bumped up.- For example, if the current version is
1.1.0
, users can name the new directory1.2.0
.
- For example, if the current version is
- 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) - 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:
- 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
- Windows:
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.
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.
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:
- Double-tap the RST button
- The
STAT
LED should be fading in/out very slowly
- The
- 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
- 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
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.
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
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.
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
orRGB_LED
in the Arduino core for GPIOP105
. #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.
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.