Application Note
Renesas RX Family

AWS Cloud Connectivity on CK-RX65N v2 with Wi-Fi
DA16600 – Getting Started Guide
Introduction
This document describes a system that uses the CK-RX65N v2 Cloud Kit plus US159-DA16600EVZ Pmodboard (part number: RTK5CK65N0S08001BE) from Renesas. This system demonstrates AWS Cloudconnectivity using the CK-RX65N v2 board running Amazon FreeRTOS via a Wi-Fi connection using
DA16600 Pmod. It visualizes the HS3001, ZMOD4410, ZMOD4510, OB1203, ICP20100, and ICM42605
sensor information on the dashboard and controls LEDs on the board. In addition, this application note also
describes several feature options for users when using CK-RX65N v2 Cloud Kit with AWS: OTA (Over-TheAir) feature (section 6) and Fleet Provisioning feature (section 7).
The document covers following items:• How to create the 10 USD credit free trial account for AWS• How to operate and install the certification information certification for Cloud• How to see and run the sensor data on the dashboard• How to use OTA feature to update firmware via Cloud• How to use Fleet Provisioning via Cloud

Figure 1. CK-RX65N v2 (with Wi-Fi DA16600 Pmod)

R01QS0070EJ0120 Rev.1.20
Apr.10.24

Page 1 of 116

Renesas RX Family

AWS Cloud Connectivity on CK-RX65N v2 with Wi-Fi DA16600

Contents

1.

Terms ...................................................................................................................................... 5

2.

Overview ................................................................................................................................. 5

2.1

Hardware Configuration .......................................................................................................................... 5

2.2

Software Configuration ............................................................................................................................ 6

2.3

Tera term Setting ..................................................................................................................................... 6

3.

System Diagram ...................................................................................................................... 6

4.

Cloud Connectivity Application Example .................................................................................. 7

4.1

Overview .................................................................................................................................................. 7

4.2

MQTT/TLS Application Software Overview ............................................................................................. 7

5.

Connection to AWS ............................................................................................................... 12

5.1

Hardware Setup and Import the Project ................................................................................................ 12

5.1.1

Hardware Preparation ......................................................................................................................... 12

5.1.2

Connecting the Board to the Serial port Console of the PC ................................................................ 13

5.1.3

Import the Project ................................................................................................................................ 15

5.1.4

Running the Application Project .......................................................................................................... 27

5.2

For Users Using the Provided Dashboard and AWS Account of Kit ..................................................... 29

5.2.1

Getting the UUID Information of the Board ......................................................................................... 29

5.2.2

To Get the Account 10 USD of Trial of AWS ...................................................................................... 29

5.3

Software Preparation-Run Project from IDE ......................................................................................... 32

5.3.1

Storing the Device Certificate, Key, MQTT Broker Endpoint and IoT Thing Name ............................ 32

5.3.2

Storing the SSID Name, Password and Security Option .................................................................... 36

5.3.3

Starting the Application ....................................................................................................................... 38

5.4

For User Who Use Their Own AWS Account ........................................................................................ 39

5.4.1

Get an AWS Account .......................................................................................................................... 39

5.4.2

Log in to the AWS Management Console ........................................................................................... 39

5.4.3

Move to IoT Core Control Panel .......................................................................................................... 40

5.4.4

Create a Security Policy ...................................................................................................................... 41

5.4.5

Register your device (thing) with AWS IoT ......................................................................................... 43

5.4.6

Check AWS IoT Endpoints .................................................................................................................. 47

5.4.7

Running Application ............................................................................................................................ 48

5.5

Verifying the Application Project using AWS Dashboard and Renesas Dashboard ............................. 48

5.5.1

Subscribe to a Topic Messages on the AWS IoT ................................................................................ 48

5.5.2

Publish a Topic Messages on the AWS Dashboard and Renesas Dashboard .................................. 51

5.5.2.1 With AWS Dashboard ....................................................................................................................... 51
5.5.2.2 With Renesas Dashboard ................................................................................................................. 52

6.

OTA over MQTT .................................................................................................................... 53

R01QS0070EJ0120 Rev.1.20
Apr.10.24

Page 2 of 116

Renesas RX Family

AWS Cloud Connectivity on CK-RX65N v2 with Wi-Fi DA16600

6.1

Overview OTA ....................................................................................................................................... 53

6.2

Prerequisites .......................................................................................................................................... 53

6.2.1

Installing Python .................................................................................................................................. 53

6.2.2

Installing OpenSSL .............................................................................................................................. 54

6.2.3

Installing Renesas Image Generator ................................................................................................... 55

6.3

Setting up AWS for OTA ....................................................................................................................... 56

6.3.1

Register your Device in AWS .............................................................................................................. 56

6.3.2

Creating an Amazon S3 bucket........................................................................................................... 56

6.3.3

Allocating OTA execution permission to IAM users ............................................................................ 58

6.4

Setting up the Device ............................................................................................................................ 65

6.4.1

Generating Key Pairs and Certificates ................................................................................................ 65

6.4.2

Setting up the project .......................................................................................................................... 66

6.4.2.1 Creating initial firmware ..................................................................................................................... 66
6.4.2.2 Running OTA project ......................................................................................................................... 73
6.5

Updating the Firmware .......................................................................................................................... 81

6.5.1

Creating the updated firmware ............................................................................................................ 81

6.5.1.1 Changing the firmware version ......................................................................................................... 81
6.5.1.2 Use Renesas Image Generator to Generate the Updated Firmware ............................................... 82
6.5.2

Updating the firmware ......................................................................................................................... 82

6.5.2.1 Creating New Job .............................................................................................................................. 82
6.5.2.2 Creating FreeRTOS OTA Job Update .............................................................................................. 83
6.5.2.3 Entering a Job Name......................................................................................................................... 83
6.5.2.4 Updating Devices .............................................................................................................................. 84
6.5.2.5 Creating New Profile ......................................................................................................................... 84
6.5.2.6 Creating a Profile Naming ................................................................................................................. 85
6.5.2.7 Creating a Profile: Importing Certificate ............................................................................................ 86
6.5.2.8 Creating a Profile: Entering Path ....................................................................................................... 87
6.5.2.9 Confirming Profile Name ................................................................................................................... 87
6.5.2.10 Updating the Firmware ...................................................................................................................... 88
6.5.2.11 Choosing the Role for the Job ........................................................................................................... 88
6.5.2.12 Waiting until Firmware Reception is Complete ................................................................................. 89
6.5.2.13 Confirming that the Firmware Version is a New Version .................................................................. 90

7.

Fleet Provisioning .................................................................................................................. 90

7.1

Overview Fleet Provisioning .................................................................................................................. 90

7.2

Setting up AWS for Fleet Provisioning .................................................................................................. 91

7.2.1

Policy Settings ..................................................................................................................................... 91

7.2.2

Generating a Claim Certificate and Claim Key Pair ............................................................................ 93

7.2.3

Creating a Fleet Provisioning Template .............................................................................................. 95

7.3

Setting up the Project .......................................................................................................................... 101

7.4

Running Fleet Provisioning ................................................................................................................. 101

R01QS0070EJ0120 Rev.1.20
Apr.10.24

Page 3 of 116

Renesas RX Family

AWS Cloud Connectivity on CK-RX65N v2 with Wi-Fi DA16600

8.

Note and Trouble Shooting .................................................................................................. 109

8.1

About Stabilization Time for Sensor .................................................................................................... 109

8.2

When Build Errors Occur ..................................................................................................................... 109

8.3

When Run Errors Occur ...................................................................................................................... 110

8.4

Wi-Fi Access Point .............................................................................................................................. 110

8.5

When the Trial 10 USD is Used Up ..................................................................................................... 110

8.6

When Unable to Log in to the Dashboard (Grafana account) ............................................................. 113

8.7

How to Enable/Disable EC2 Instance ................................................................................................. 113

8.8

An error occurs when connecting to AWS .......................................................................................... 114

8.9

Command to create to create the initial firmware fails (OTA) ............................................................. 114

8.10 Initial firmware cannot be written/ does not start. (OTA) ..................................................................... 114
8.11 Firmware does not start after starting the boot loader (OTA) ............................................................. 114
8.12 Firmware does not start after an OTA update (OTA) .......................................................................... 114

Revision History .......................................................................................................................... 116

R01QS0070EJ0120 Rev.1.20
Apr.10.24

Page 4 of 116

Renesas RX Family

AWS Cloud Connectivity on CK-RX65N v2 with Wi-Fi DA16600

1. Terms
Terms used in this document are explained below.
Table 1.

Terms

Term

Meaning

AWS
Pmod
MQTT
OTA
TLS
UUID

AWS Amazon Web Service
Peripheral Module
Message Queuing Telemetry Transport
Over-The-Air
Transport Layer Security
Unique ID for each kit

2. Overview
This section gives an overview of hardware and software configuration of the demo project and the tera term
settings.

2.1

Hardware Configuration

The hardware configuration of the demo project is listed in the table below.
Table 2. Hardware Configuration
Item
CK-RX65N v2 Cloud Kit

DA16600 Wi-Fi Pmod module

PC

R01QS0070EJ0120 Rev.1.20
Apr.10.24

Content
Target board for CK-RX65N v2
Part number:
RTK5CK65N0S08001BE
Wi-Fi connection

Windows® 10
Google chrome

Description
Please see detail at:https://www.renesas.com/rx/ck-rx65n
This Pmod is used with CK-RX65N v2
for Wi-Fi connection.
DA16600 SDK version: v3.2.7.1 orlater.
Please see detail at:
US159-DA16600EVZ - Ultra-LowPower Wi-Fi + Bluetooth® Low Energy
Combo Pmod™ Board (Renesas
Quick-Connect IoT) | Renesas
Recommended OS
Web browser used.

Page 5 of 116

Renesas RX Family
2.2

AWS Cloud Connectivity on CK-RX65N v2 with Wi-Fi DA16600

Software Configuration

The software configuration of the demo project is listed in the following table.
Table 3. Software Configuration
Item
Integrated development
environment
Complier
Communication Software
Emulator
RTOS
PythonKeygen toolFlash programming tool
Renesas Image Generator

2.3

Content
e2studio

Version2024-01 or later

CC-RX
GCC(Planning)
Tera term
E2 emulator Lite (on-board)
AWS FreeRTOS
Win64 OpenSSL
Renesas Flash Programmer
Supplied with Firmware
Update module Rev.2.01

V3.05
Version 4.99
V202210.01
V3.11.0 or later
V3.0.12
V3.12.00
V3.02

Tera term Setting

Table 4. Tera term Setting
Item
Baud rate

Settings
115200

Data length

8

ParityNone

Stop bits

1

Flow Control

None

3. System Diagram

Figure 2. System Diagram

R01QS0070EJ0120 Rev.1.20
Apr.10.24

Page 6 of 116

Renesas RX Family

AWS Cloud Connectivity on CK-RX65N v2 with Wi-Fi DA16600

4. Cloud Connectivity Application Example
4.1

Overview

This application project demonstrates the use of Driver, Middleware and RTOS components, FIT configurator
on Renesas RX65N MCU to establish AWS Cloud connectivity using Wi-Fi DA16600. It illustrates how thecloud service provider is configured and operated.
This documentation illustrates Subscribe and Publish communications between MQTT Client and MQTT
Broker, on-demand publication of sensor data, and asynchronous publication of a "sensor data" event from
the MCU to the Cloud.

Figure 3. MQTT Publish/Subscribe to/from AWS IoT Core
Application also supports OTA over MQTT feature for updating new firmware (please refer to the section 6.
OTA over MQTT), and Fleet Provisioning (please refer to the section Fleet Provisioning) via AWS.

4.2

MQTT/TLS Application Software Overview

The following files from this application project serve as a reference as shown in Table 5.
Table 5.

Application Project FileNo.
1.

Filename
src/application_code/main.c2.

src/application_code/usr_wifi.c3.

src/application_code/usr_wifi.h4.

src/application_code/CommandLine/common_init.h

R01QS0070EJ0120 Rev.1.20
Apr.10.24

PurposeContains initialization code of the Wi-Fi
connection, provisioning cloud credentials
used in Cloud Connectivity, main function of
application.
Contains Wi-Fi initialization functions and data
structures.
Contains macros, data structures, andfunctions prototypes used to initialize Wi-Fi
across the project.
Contains macros, data structures, andfunctions prototypes used to initialize common
in the project.

Page 7 of 116

Renesas RX Family
No.
5.
6.
7.
8.

AWS Cloud Connectivity on CK-RX65N v2 with Wi-Fi DA16600

Filename
src/application_code/CommandLine/c
onsole.csrc/application_code/CommandLine/c
onsole.hsrc/application_code/CommandLine/m
enu_flash.c
src/application_code/CommandLine/m
enu_flash.h9.

src/application_code/CommandLine/m
enu_kis.c10.

src/application_code/CommandLine/m
enu_kis.h11.

src/application_code/CommandLine/m
enu_main.c
src/application_code/CommandLine/m
enu_main.h
src/application_code/CommandLine/common_utils.h

12.
13.

14.
15.
16.
17.

18.
19.
20.

21.
22.
23.

24.
25.

26.
27.

src/application_code/CommandLine/r_typedefs.h
src/application_code/sensor_thread_entry.csrc/application_code/ICM42605/ICM_
42605.csrc/application_code/ICM42605/ICM_
42605.hsrc/application_code/ICM42605/apex_feature.c
src/application_code/ICM42605/icm_
i2c.c
src/application_code/ICM42605/icm_
i2c.h
src/application_code/ICM42605/moti
on_sensor_icm_42605.c
src/application_code/ICP20100/ICP_
20100.csrc/application_code/ICP20100/ICP_
20100.hsrc/application_code/ICP20100/ICP_
I2C.csrc/application_code/ICP20100/ICP_
I2C.hsrc/application_code/ICP20100/pressure_sensor.c
src/application_code/OB1203/RX_OB1
203.c

R01QS0070EJ0120 Rev.1.20
Apr.10.24

PurposeContains data structures and functions used
to print data on console using UART
Contains the function prototypes used to print
data on console using UART
Contains data structures and functions used
to provide CLI flash memory related menu
Contains the function prototypes and macros
used to provide CLI flash memory related
menu
Contains functions to get the application’s
version, get UUID and help option for main
menu on CLI
Contains the function prototypes and macros
used to get application’s version, get UUID
and help option for main menu on CLI
Contains data structures and functions used
to provide CLI main menu options
Contains the function prototypes and macros
used to provide CLI main menu options
Contains macros, data structures, andfunctions prototypes commonly used acrossthe project.
Contains typedef used in application
Contains the code for sensor thread (HS3001+ ICP20100 + ICM42605)
Contains the code for the 6-Axis MEMS
Motion Tracking™ Sensor
Contains the Data structure function
prototypes for the 6-Axis MEMS Motion
Tracking™ Sensor
Contains the code for apex feature of the 6Axis MEMS Motion Tracking™ Sensor
Contains the I2C code to communicate with 6Axis MEMS Motion Tracking™ Sensor
Contains the I2C function prototypes tocommunicate with 6-Axis MEMS Motion
Tracking™ Sensor
Contains the code for 6-Axis MEMS Motion
Tracking™ Sensor
Contains the code for Barometric Pressure
and Temperature Sensor
Contains the data structure and function
prototypes for Barometric Pressure andTemperature Sensor
Contains the I2C code to communicate with
Barometric Pressure and Temperature Sensor
Contains the I2C data structure and function
prototypes for Barometric Pressure andTemperature Sensor
Contains the code for Barometric Pressure
and Temperature Sensor
Contains data structures and functions used
for the oximeter sensor

Page 8 of 116

Renesas RX Family
No.
28.
29.
30.
31.
32.
33.
34.
35.
36.
37.
38.

39.
40.

41.
42.
43.
44.
45.
46.

47.
48.
49.
50.
51.
52.

AWS Cloud Connectivity on CK-RX65N v2 with Wi-Fi DA16600

Filename
src/application_code/OB1203/ob1203_bio.csrc/application_code/OB1203/ob1203_bio_rx.c
src/application_code/OB1203/ob1203_bio.hsrc/application_code/OB1203/KALMAN/kalman.csrc/application_code/OB1203/KALMAN/kalman.hsrc/application_code/OB1203/SAVGOL/SAVGOL.csrc/application_code/OB1203/SAVGOL/SAVGOL.hsrc/application_code/OB1203/SPO2/S
PO2.c
src/application_code/OB1203/SPO2/S
PO2.c
src/application_code/HS3001/RX_HS3
001.csrc/application_code/HS3001/RX_HS3
001.hsrc/application_code/ZMOD4x10/RX_Z
MOD4XXX_Common.csrc/application_code/ZMOD4x10/RX_Z
MOD4XXX_Common.hsrc/application_code/ZMOD4x10/RX_Z
MOD4XXX_IAQ1stGen.c
src/application_code/ZMOD4x10/RX_Z
MOD4XXX_OAQ1stGen.c
src/application_code/softTimer.c
src/application_code/softTimer.hsrc/application_code/frtos_skeleto
n/ob1203_thread.c
src/application_code/frtos_skeleto
n/sensor_thread.c

src/application_code/frtos_skeleto
n/zmod_thread.c
src/application_code/frtos_skeleton/task_function.h
src/application_code/frtos_startup/freertos_object_init.c
src/application_code/frtos_startup/freertos_start.c
src/application_code/frtos_startup/freertos_start.h
src/application_code/frtos_config/*.hR01QS0070EJ0120 Rev.1.20
Apr.10.24

PurposeContains the Data structure for the oximeter
sensorContains data structures and functions used
for the oximeter sensor
Contains the Data structure and function
prototypes for the oximeter sensor
Contains algorithm for Heart Rate, Blood
Oxygen Concentration, Pulse Oximetry,
Proximity, Light and Color Sensor sample
calculations

Contains the code and function for Renesas
Relative Humidity and Temperature Sensor.
Contains the common data structure’sfunction prototypes for the Renesas Relative
Humidity and Temperature sensors.
Contains the common code for the Renesas
ZMOD sensors
Contains the common data structure’sfunction prototypes for the Renesas ZMOD
sensors
Contains the common code for the Renesas
ZMOD Internal Air Quality sensors
Contains the common code for the Renesas
ZMOD Outer Air Quality sensors
Contains the code for timer
Contains the common data structure’sfunction prototypes for timer
Contains the ob1203 sensor thread (foroximeter sensor)
Contains the sensor’s thread (for Renesas
Relative Humidity and Temperature Sensor,
Barometric Pressure and Temperature Sensor
and the 6-Axis MEMS Motion Tracking™
Sensor)Contains the ZMOD’s thread (for Renesas
ZMOD Internal Air Quality sensors)
Contains the common data structure’sfunction prototypes for thread
Contains the source code for FreeRTOS
threadContains FreeRTOS user-defined functions
FreeRTOS's user-defined functions header
file
Contains FreeRTOS configuration header file.

Page 9 of 116

Renesas RX Family

AWS Cloud Connectivity on CK-RX65N v2 with Wi-Fi DA16600

No.
53.

Filename
src/application_code/sensorsData.h54.

Demos/SimplePubSub/simple_pub_sub_task.cDemos/mqtt_agent/mqtt_agent_task.c
Demos/OtaOverMqtt/OtaOverMqttDemoE
xample.c
Demos/Fleet_Provisioning_With_CSR_
Demo
Demos/cli/serial.c
Demos/cli/serial.h

55.
56.
57.
58.
59.
60.
Note:

PurposeContains the common data structure’sfunction prototypes for sensors
Contains code and functions used in MQTTinterface for Cloud Connectivity.
Contains the code for running the MQTT task
Contains function for running OTA over MQTT

Contains function for running Fleet
Provisioning
Contains function for serial communication.
Contains the common data structure’sfunction prototypes for serial.c
Demos/include/*.hContains the common data structure’sfunction prototypes for demo function.
The above table only lists some important files in the application.

R01QS0070EJ0120 Rev.1.20
Apr.10.24

Page 10 of 116

Renesas RX Family

AWS Cloud Connectivity on CK-RX65N v2 with Wi-Fi DA16600

Figure 4. Application Example Implementation Details
The IoT Device (CK-RX65N v2) will perform step by step from initializations for Flash, CLI, Log Task,… and
Wi-Fi connection to MQTT Init and establishes session. After the establish session step is completed, CKRX65N v2 (MQTT Client) sends a CONNECT message to the MQTT broker, which responds with a
CONNACK message, and the connection is established successfully.
MQTT Client takes both publishers and subscribers, so, continue to send a SUBCRIBE message with list ofdesired topics (for example, LED control) and QoS (quality of service) level 1 to MQTT broker.
Note: QoS refers to the level of guarantee or assurance provided for message delivery between the MQTT
broker and MQTT Clients. There are three QoS levels in MQTT:•

At most once (0)•At least once (1)•Exactly once (2)R01QS0070EJ0120 Rev.1.20
Apr.10.24

Page 11 of 116

Renesas RX Family

AWS Cloud Connectivity on CK-RX65N v2 with Wi-Fi DA16600

The broker responds with a SUBACK message that confirms the subscription and indicates the maximum
QoS level that the broker will deliver. At this time, the application sends PUBLISH messages continuously to
update the value of sensors to cloud with user’s configured time (every 2 seconds in default), which
responds with a PUBACK message for publishing successfully. In addition, the MQTT broker sends
messages to the IoT Device to control the status of LEDs (ON/OFF) in the device. When the network isdown, the application will start re-connecting by resetting DA16600 Pmod and re-connecting to MQTT
broker.

5. Connection to AWS
AWS account is necessary to connect CK-RX65N v2 Cloud Kit to AWS.
Renesas provides the 10 USD of AWS account credit to users who buy the CK-RX65N v2 and this 10 USD
credit cannot be used for an existing account. This document covers both cases of way to connect AWS
account.
••

Case 1: For the users who want to use trial AWS account with 10 USD credits and Renesas Dashboard,please refer to section 5.2 For Users Using the Provided Dashboard and AWS Account of Kit to get
this AWS account.
Case 2: For other users who already have an AWS account and want to use it instead of trial account,please skip section 5.2 For Users Using the Provided Dashboard and AWS Account of Kit and referto section 5.4 For User Who Use Their Own AWS Account to use account with application.

5.1

Hardware Setup and Import the Project

5.1.1
⎯
⎯
⎯
⎯

Hardware Preparation
Connect micro-USB cables to debug port (J14 on the CK-RX65N v2 board)
Connect USB Type-C cables to serial port (J10 on the CK-RX65N v2 board)
Connect the Wi-Fi DA16600 Pmod module to the Pmod 1
Set the Jumper of J16 “Debug”

Figure 5. Connecting the USB and DA16600 Pmod

R01QS0070EJ0120 Rev.1.20
Apr.10.24

Page 12 of 116

Renesas RX Family
5.1.2

AWS Cloud Connectivity on CK-RX65N v2 with Wi-Fi DA16600

Connecting the Board to the Serial port Console of the PC

1. On the host PC, open Windows Device Manager. Expand Ports (COM & LPT), locate USB Serial Port
(COMxx) and note down the COM port number to be used in the next step.
Note: USB Serial Device drivers are required to communicate between the CK-RX65N v2 board and thePC.

Figure 6. USB Serial Device in Windows Device Manager
Open Tera Term select New connection and select Serial and COMxx: USB Serial Device (COMxx)
and click OK.

Figure 7. Selecting the Serial Port on Tera Term

R01QS0070EJ0120 Rev.1.20
Apr.10.24

Page 13 of 116

Renesas RX Family

AWS Cloud Connectivity on CK-RX65N v2 with Wi-Fi DA16600

2. Using the Setup menu, select Setup > Terminal… and select “AUTO” as Receive and, select “CR” as
Transmit, as shown in Figure 8.

Figure 8. Select Receive: “Auto” and Transmit: “CR” on the Terminal Setting
3. Using the Setup menu pull-down, select Serial port… and ensure that the speed is set to 115200, as
shown in Figure 9.

Figure 9. Select 115200 on the Speed Pulldown

R01QS0070EJ0120 Rev.1.20
Apr.10.24

Page 14 of 116

Renesas RX Family
5.1.3

AWS Cloud Connectivity on CK-RX65N v2 with Wi-Fi DA16600

Import the Project

Use the following steps to prepare the software for the demo program:
1. Extract the project files from the archive and copy them to the C drive.
Please unzip the project file to the shortest path of your PC.
If the path is deep, a build error may occur due to the file path length issue.
2. Launch e2 studio and specify a workspace directory and click Launch.

Figure 10. Launch e2 studio
3. Select File > Import…

Figure 11. Select Import
R01QS0070EJ0120 Rev.1.20
Apr.10.24

Page 15 of 116

Renesas RX Family

AWS Cloud Connectivity on CK-RX65N v2 with Wi-Fi DA16600

4. Click General > Existing Projects into Workspace > Next.

Figure 12. Select Existing Projects into Workspace
5. Click Browse…, then specify the root directory as follows.

Figure 13. Find the Project
Please go to the “[Project Root folder]\Projects\aws_da16600_ck_rx65n” folder

R01QS0070EJ0120 Rev.1.20
Apr.10.24

Page 16 of 116

Renesas RX Family
Project Details
Project Name
aws_da16600_ck_rx65n

AWS Cloud Connectivity on CK-RX65N v2 with Wi-Fi DA16600
Compiler
CC-RX

Connectivity
Wi-Fi

Open the “[Project Root folder]\Projects\aws_da16600_ck_rx65n\e2studio_ccrx” folder.

Figure 14. Select the Project Folder
Finally, click Finish.
Note: Make sure “Copy projects into workspace” is unchecked.

Figure 15. Import the ProjectR01QS0070EJ0120 Rev.1.20
Apr.10.24

Page 17 of 116

Renesas RX Family

AWS Cloud Connectivity on CK-RX65N v2 with Wi-Fi DA16600

6. Execute code generation.
This application uses FIT; the user can configure them in the “aws_da16600_ck_rx65n.scfg” file.
If you have changed the Smart Configurator settings, click Generate Code.
Note: If the user’s environment does not have the FIT component’s version match with the application,please download it by choosing aws_da16600_ck_rx65n.scfg > Components > downloadingit

Figure 16. Generate CodeNote: If the user’s environment does not have CK-RX65N v2 board description file (*.bdf), please download
it by choosing aws_da16600_ck_rx65n.scfg > Board > Download more boards… > New Cloud
Kit V2 for RX65N Board Description File > Download

R01QS0070EJ0120 Rev.1.20
Apr.10.24

Page 18 of 116

Renesas RX Family

AWS Cloud Connectivity on CK-RX65N v2 with Wi-Fi DA16600

Figure 17. Download CK-RX65N v2 Board Description File on e2 studio
Table 6 shows the configuration of each component in this Project.
Table 6. Components Configuration
No
1

Component
Startup→Generic→r_bsp

R01QS0070EJ0120 Rev.1.20
Apr.10.24

Configuration
User stack setting: 2 stacks
User stack size:0x2000
Interrupt stack size: 0x400
Heap size: 0x1000
Initializes C input and output library functions: Enable
Enable user stdio charget function: Use BSP charget()function
User stdio charget function name:my_sw_charget_function
Enable user stdio charput function: Use BSP charput()function
User stdio charput function name:my_sw_charput_function
Software Interrupt Unit1 (SWINT1): Unused
Software Interrupt Unit2 (SWINT2): Unused
Serial terminals select: Enable
Channel for serial terminal: Channel 5
Bitrate for serial terminal: 115200
Interrupt priority for serial terminal: Priority level 15(highest)
Page 19 of 116

Renesas RX Family

AWS Cloud Connectivity on CK-RX65N v2 with Wi-Fi DA16600

No
2

Component
Drivers→Interrupt→r_irq_rx

3

Drivers→A/D
Converter→r_s12ad_rx

45

Drivers→I/O Ports→r_gpio_rx
Drivers→Memory→r_flash_rx

6
7

Drivers→Security→r_tsip_rx
Drivers→Communications→r_riic_rx8

Drivers→Communications→r_sci_ii
c_rx

9Drivers→Communications→r_sci_rx

R01QS0070EJ0120 Rev.1.20
Apr.10.24

Configuration
Locking function for IRQ APIs: Enable
Resources → ICU:
IRQ0 Pin: ✓IRQ1 Pin: ✓IRQ2 Pin: ✓IRQ3 Pin:
IRQ4 Pin:
IRQ5 Pin: ✓IRQ6 Pin: ✓IRQ7 Pin: ✓IRQ8 Pin:
IRQ9 Pin:
IRQ10 Pin:
IRQ11 Pin: ✓IRQ12 Pin:
IRQ13 Pin: ✓IRQ14 Pin: ✓IRQ15 Pin: ✓Resources→S12AD→S12AD1: ✓→AN115 Pin: ✓→AN117 Pin: ✓Enable code flash programming: Includes code to program
ROM area
Enable BGO/Non-blocking data flash operations: Enable
BGO (background operations/interrupt) mode
Enable BGO/Non-blocking code flash operations: Enable
BGO (background operations/interrupt) mode
Enable code flash self-programming: Programming code
flash while executing from another segment in ROM
MCU supported channels for CH0: Supported
MCU supported channels for CH1: Supported
CH0 RIIC bps(kbps): 400
CH1 RIIC bps(kbps): 400
Resources→RIIC
RIIC0: ✓• SCL0 Pin: ✓ Used
• SDA0 Pin: ✓ Used
RIIC1: ✓• SCL1 Pin: ✓ Used
• SDA1 Pin: ✓ Used
MCU supported channels for CH12: Supported
Resource→SCISCI12: ✓→SSCL12 Pin: ✓ Used
→SSDA12 Pin: ✓ Used
Include software support for channel 5: Include
Include software support for channel 6: Include
ASYNC mode TX queue buffer size for channel 5: 80
ASYNC mode TX queue buffer size for channel 6: 2180
ASYNC mode RX queue buffer size for channel 5: 80

Page 20 of 116

Renesas RX Family

AWS Cloud Connectivity on CK-RX65N v2 with Wi-Fi DA16600

No

Component

10

Drivers→Timers→Config_CMTW0

1112Drivers→Timers→r_cmt_rx
Middleware→
Communications→r_comms_i2c_rx

R01QS0070EJ0120 Rev.1.20
Apr.10.24

Configuration
ASYNC mode RX queue buffer size for channel 6: 8192
Transmit end interrupt: Enable
GROUPBL0 (ERI, TEI) interrupt priority: 3
Resources→SCI→SCI5: ✓• RXD5/SMISO5/SSCL5 Pin: ✓ Used
• TXD5/SMOSI5/SSDA5 Pin: ✓ Used
→SCI6: ✓• RXD6/SMISO6/SSCL6 Pin: ✓ Used
• TXD6/SMOSI6/SSDA6 Pin: ✓ Used
• CTS6#/RTS6#/SS6# Pin: ✓ Used
Count clock setting: PCLK/8
Timer counter size: 32 bits
Counter clear: CMWCNT is cleared by CMWCOR
Internal value: 1ms
Register value: 7499
Priority: Level 15
CMT interrupts priority level: 5
Number of I2C Share Buses: 3
Number of I2C Communication Devices: 7
I2C Driver Type for I2C Shared Bus0: RIIC
Channel No. for I2C Shared Bus0: 0
I2C Driver Type for I2C Shared Bus1: RIIC
Channel No. for I2C Shared Bus1: 1
I2C Driver Type for I2C Shared Bus2: SCI IIC
Channel No. for I2C Shared Bus2: 12
I2C Shared Bus No. for I2C Communication Device0: I2C
Shared Bus0
Slave address for I2C Communication Device0: 0x44
Callback function for I2C Communication Device0:
rm_hs300x_callback0
I2C Shared Bus No. for I2C Communication Device1: I2C
Shared Bus1
Slave address for I2C Communication Device1: 0x32
Callback function for I2C Communication Device1:
rm_zmod4xxx_callback0
I2C Shared Bus No. for I2C Communication Device2: I2C
Shared Bus1
Slave address for I2C Communication Device2: 0x33
Callback function for I2C Communication Device2:
rm_zmod4xxx_callback1
I2C Shared Bus No. for I2C Communication Device3: I2C
Shared Bus2
Slave address for I2C Communication Device3: 0x53
Callback function for I2C Communication Device3:
rm_ob1203_callback0
I2C Shared Bus No. for I2C Communication Device4: I2C
Shared Bus2
Slave address for I2C Communication Device4: 0x53
Callback function for I2C Communication Device4:
rm_ob1203_callback1

Page 21 of 116

Renesas RX Family

AWS Cloud Connectivity on CK-RX65N v2 with Wi-Fi DA16600

No

Component

13

Middleware→Sensors→r_hs300x_rx

14

Middleware→Sensors→r_zmod4xxx_rx

Configuration
I2C Shared Bus No. for I2C Communication Device5: I2C
Shared Bus0
Slave address for I2C Communication Device5: 0x63
Callback function for I2C Communication Device5:
comms_i2c_callback_icp
I2C Shared Bus No. for I2C Communication Device6: I2C
Shared Bus0
Slave address for I2C Communication Device6: 0x68
Callback function for I2C Communication Device6:
comms_i2c_callback_icm
Number of HS300x Sensors: 1
Data types from HS300x Sensor: Humidity andTemperature
Programming mode for HS300x sensor: ON
I2C Communication device No. for HS300x sensor device0:
I2C Communication Device0
Callback function for HS300x sensor device0:
hs300x_callback
Number of ZMOD4xxx Sensors: 2
Operation mode of ZMOD4XXX Sensor0: IAQ 1st Gen.
(Continuous)
I2C Communication device No. for ZMOD4XXX sensor
devices: I2C Communication Device1
I2C callback function for ZMOD4XXX sensor device0:
zmod4xxx_user_i2c_callback0
IRQ callback function for ZMOD4XXX sensor device0:
zmod4xxx_user_irq_callback0
Enable IRQ from ZMOD4XXX sensor device 0: Enabled
IRQ number for ZMOD4XXX sensor device0: IRQ14
IRQ interrupt priority for ZMOD4XXX sensor device0: 10
Operation mode of ZMOD4XXX Sensor1: OAQ 1st Gen.

15

Middleware→Generic→r_byteq

16

Middleware→Generic→r_fwup

17

MIddleware→Generic→r_ob1203_rx

R01QS0070EJ0120 Rev.1.20
Apr.10.24

I2C Communication device No. for ZMOD4XXX sensor
devices: I2C Communication Device2
I2C callback function for ZMOD4XXX sensor device1:
zmod4xxx_user_i2c_callback1
Enable IRQ from ZMOD4XXX sensor device 1: Enabled
IRQ callback function for ZMOD4XXX sensor device1:
zmod4xxx_user_irq_callback1
IRQ number for ZMOD4XXX sensor device1: IRQ13
IRQ interrupt priority for ZMOD4XXX sensor device0: 5
Memory allocation for queue control blocks: Static memory
allocation
Number of static queue control block: 32
Select the update mode: Dual bank
Select the function mode: user for User program
Main area start address: 0xFFF00000
Buffer area start address: 0xFFE00000
Install area size: 0xF0000
Number of OB1203 Sensors: 2

Page 22 of 116

Renesas RX Family

AWS Cloud Connectivity on CK-RX65N v2 with Wi-Fi DA16600

No

Component

18

Middleware→Generic→r_wifi_da16xxx

19

RTOS→RTOS
Kernel→FreeRTOS_Kernel

R01QS0070EJ0120 Rev.1.20
Apr.10.24

Configuration
Sensor mode of Ob1203 Sensor device0: Proximity sensor
mode
I2C Communication device No. for OB1203 sensor device0:
I2C Communication Device 3
I2C callback function for OB1203 sensor device0:
ob1203_comms_i2c_callback
Enable IRQ from OB1203 sensor device0: Enabled
IRQ callback function for OB1203 sensor device0:
ob1203_irq_callback
IRQ number for OB1203 sensor device0: IRQ15
IRQ trigger for OB1203 sensor device0: Falling
IRQ interrupt priority for OB1203 sensor device0: Priority 14
Sensor mode of Ob1203 Sensor device1: PPG sensor
mode
I2C Communication device No. for OB1203 sensor device1:
I2C Communication Device 4
I2C callback function for OB1203 sensor device1:
ob1203_comms_i2c_callback
Enable IRQ from OB1203 sensor device1: Enabled
IRQ callback function for OB1203 sensor device1:
ob1203_irq_callback
IRQ number for OB1203 sensor device1: IRQ15
IRQ trigger for OB1203 sensor device1: Falling
IRQ interrupt priority for OB1203 sensor device1: Priority 14
Enable DA16600 support: Enable
SCI Channel number for DA16XXX Initial Command Port for
AT command communication: 6
Interrupt Level for WIFI_CFG_SCI_CHANNEL: 4
Communication baud rate for WIFI_CFG_CHANNEL: 115200
UART hardware flow control: RTS(Hardware),
CTS(Software)
CTS port number: PORTJCTS pin number: 3
RTS port number: PORTJ
RTS pin number: 3
RTS pin function set value: 0x0AU
General-purpose port PDR register connected to the EN pin:
PORT 5General-purpose port PODR register connected to the EN
pin: 5Creatable sockets number: 4
Socket Receive buffer size: 8192
Country code: “VN”
Note: Depending on the user’s country
Timezone offet in hours (-12 ~ 12): 7
Note: Depending on the user’s time zone
Use FreeRTOS logging functionality: Disable
RTOS scheduler: Preemptive
Maximum number of priorities to the application task: 7
The frequency of the RTOS tick interrupt: ( TickType_t )1000
The size of the stack used by the idle task: 768

Page 23 of 116

Renesas RX Family

AWS Cloud Connectivity on CK-RX65N v2 with Wi-Fi DA16600

No

Component

20

RTOS→RTOS
Object→FreeRTOS_Object→

Configuration
The configTOTAL_HEAP_SIZE_N: 256
The maximum permissible length of name: 12
Idle should yield: ✓ Used
Mutex functionality: ✓ Used
Counting semaphore functionality: ✓ Enable
Software timer functionality: ✓ Enable
Priority of the software timer task: 6
The length of the software timer command queue: 5
Kernel interrupt priority: 1
Maximum syscall interrupt priority: 4
Tick vector: _CMT0_CMI0
Record stack high address: ✓ Enable
Support dynamic allocation: ✓ Enable
Support static allocation: ✓ Enable
Initialize Task CodePriorityStack
Sizekernelob1203_thread
3
1024
start
kernelzmod_thread
2
1024
start
kernelsensor_thread
2
2048
start

7. Data Publishing Interval Settings (Optional)
Data publish interval can be set by the user. Default publishes interval time 2 sec.
“Demos/SimplePubSub/simple_pub_sub_task.c” file has the macro to change the publish timeinterval.
#define mqttexampleDELAY_BETWEEN_PUBLISH_OPERATIONS_MS (2000U)

Figure 18. Data Publishing Interval Settings (Optional)

R01QS0070EJ0120 Rev.1.20
Apr.10.24

Page 24 of 116

Renesas RX Family

AWS Cloud Connectivity on CK-RX65N v2 with Wi-Fi DA16600

8. Select Project → Build All and confirm that 0 errors are reported.

Figure 19. Build the ProjectR01QS0070EJ0120 Rev.1.20
Apr.10.24

Page 25 of 116

Renesas RX Family

AWS Cloud Connectivity on CK-RX65N v2 with Wi-Fi DA16600

9. Debug configuration and load image to board:
Open Debug configuration: Right click on project > Debug As > Debug Configurations…

Figure 20. Configuration Debugger 1/2
Go to Renesas GDB Hardware Debugging > aws_demos HardwareDebug > Debugger tab thenconfiguration for “Main Clock Source: EXTAL” and “Connection Type: Fine”.

R01QS0070EJ0120 Rev.1.20
Apr.10.24

Page 26 of 116

Renesas RX Family

AWS Cloud Connectivity on CK-RX65N v2 with Wi-Fi DA16600

Figure 21. Configuration Debugger 2/2

5.1.4

Running the Application ProjectTo run the Application project, use the following instructions.
In Serial port console of the PC already setup in section 5.1.2, Tera Term, the console will display as below.

Figure 22. Start the Application
In the first-time users run the application (or users want to change the configuration), please press any key toset some necessary credentials for application.
Note:

After 10s, the application will run automatically with option “6. Run Sensor App with MQTT” inapplication’s menu. User can modify this time’s value by changing the value of WAIT_USER_TIME
macro in file:
Projects\aws_da16600_ck_rx65n\e2studio_ccrx\src\application_code\CommandLine\menu_m
ain.h before building the project:R01QS0070EJ0120 Rev.1.20
Apr.10.24

Page 27 of 116

Renesas RX Family

AWS Cloud Connectivity on CK-RX65N v2 with Wi-Fi DA16600

Figure 23. Modify macro to Wait for User Input!
After pressing any key, the settings are as shown below.

Figure 24. Main Menu
Choose the number to select the commands. For example, when you press ‘1’. The firmware version of theapplication is displayed as shown below. To return to the main menu, press the “space bar” key.

R01QS0070EJ0120 Rev.1.20
Apr.10.24

Page 28 of 116

Renesas RX Family

AWS Cloud Connectivity on CK-RX65N v2 with Wi-Fi DA16600

Figure 25. Get Version Information
The next section provides an introduction to the setup for the AWS account. Please refer to section 5.2 For
Users Using the Provided Dashboard and AWS Account of Kit, refer to section 5.4 For User who use
their own AWS account.

5.2

For Users Using the Provided Dashboard and AWS Account of Kit

This section explains about the registration account and access dashboard. It needs to get the “UUID” of the
kit.

5.2.1

Getting the UUID Information of the Board

Press ‘3’ from the Main Menu to display RX MCU UUID. This command obtains the UUID information of the
kit and displays it on the console like the snapshot shown below. You will need this information to register on
the Cloud Dashboard.

Figure 26. Getting Board UUID Information

5.2.2

To Get the Account 10 USD of Trial of AWS

1. Register/sign up at “https://renesas.cloud-ra-rx.com/” with an email account that was not usedpreviously for signing up to an AWS account.
Note: The provided free credit starts consuming when users register their email and UUID on this system.
Renesas recommended to disable the AWS EC2 service when users don't use this system.

R01QS0070EJ0120 Rev.1.20
Apr.10.24

Page 29 of 116

Renesas RX Family

AWS Cloud Connectivity on CK-RX65N v2 with Wi-Fi DA16600

Please refer to the 8.7.How to Enable/Disable EC2 .

Figure 27. Get the Account 10 USD of Trial of AWS (1/2)

Figure 28. Get the Account 10 USD of Trial of AWS (2/2)
2. Wait for AWS verification email (~10 min). Then put on the email and UUID to register the kit in below
window. You can get the UUID from section 5.2.1 Getting the UUID Information of the Board.
Note: Only 1 device will be assigned to an account.

Figure 29. Register Device

R01QS0070EJ0120 Rev.1.20
Apr.10.24

Page 30 of 116

Renesas RX Family

AWS Cloud Connectivity on CK-RX65N v2 with Wi-Fi DA16600

3. Verify the AWS account in your email that you registered.
4. Wait for the status change on the registration page/ wait for provisioning to complete. Please refresh thepage in case the Registration in progress screen still shows up.

Figure 30. Dashboard Build In Progress
5. Once the account status shows up as active in the registration page, click on device to see device UUID.

Figure 31. Active Device
6. After finishing the progress, you can get the file of certification to connect dashboard from “Download
Certificate” button. It is used for installation on the application demo of kits that you got previous step.

Figure 32. Dashboard Build Complete

R01QS0070EJ0120 Rev.1.20
Apr.10.24

Page 31 of 116

Renesas RX Family

AWS Cloud Connectivity on CK-RX65N v2 with Wi-Fi DA16600

7. Click “go to Dashboard” to access the dashboard. First time users will access the dashboard withcredentials “admin” for both username and password and will be directed to change the password.
Once completed, users can access the dashboard.

Figure 33. Dashboard for this Application

5.3

Software Preparation-Run Project from IDE

5.3.1

Storing the Device Certificate, Key, MQTT Broker Endpoint and IoT Thing Name

Device Certificate, Device Private Key, MQTT Broker Endpoint and IOT Thing name need to be stored in thedata flash for the application to work. These are obtained after registering to the Cloud Dashboard.
1. Press ‘2’ on the Main Menu to display Data Flash related commands as shown in the following
snapshots. This sub menu has commands to store, read and validate the data.

Figure 34. Data Flash Related Menu and Commands
2. Please unzip the cert.zip from dashboard.
3. To store the Device Certificate, press the option ‘b’ and Click the File tab of the Tera Term and Send
File option and choose the downloaded Device certificate file from the dashboard“xxxxxcertificate.pem.crt”. The details of downloading the certificates are explained in the Dashboard
document linked as part of this Application Note.

R01QS0070EJ0120 Rev.1.20
Apr.10.24

Page 32 of 116

Renesas RX Family

AWS Cloud Connectivity on CK-RX65N v2 with Wi-Fi DA16600

Figure 35. Accessing the Device Certificate

Figure 36. Downloading the Device Certificate into the Data FlashR01QS0070EJ0120 Rev.1.20
Apr.10.24

Page 33 of 116

Renesas RX Family

AWS Cloud Connectivity on CK-RX65N v2 with Wi-Fi DA16600

Figure 37. Status of the Downloaded Device Certificate into the Data Flash
4. To store the Device Private Key press the option ‘c’ and click the File tab of the Tera Term and Send
File option. Choose the downloaded Device Private Key “xxxxxxxprivate.pem.key” which is downloaded
from the Dashboard download link.
5. Open the “iot-data.json” file
This file has information about IoT things name and IoT Endpoint.

Figure 38. Getting the IoT Things Name and IoT Endpoint Information
6. To store the MQTT Broker end point, copy the end point string between the quotes xxxxxxxxxx.iot.useast-1.amazonaws.com from the downloaded certificate link, press the option ‘d’ and click the Edit tabof the Tera Term and Paste<CR> and verify and confirm the valid string and press OK.
Note: Please copy the IOTEndpoint without “”.

Figure 39. Copy IoT Endpoint Information
R01QS0070EJ0120 Rev.1.20
Apr.10.24

Page 34 of 116

Renesas RX Family

AWS Cloud Connectivity on CK-RX65N v2 with Wi-Fi DA16600

Figure 40. Storing the MQTT IoT Endpoint into the Data Flash
7. To store the IOT Thing Name, copy the Thing Name string between the quotes xxxxxxxx-xxxx-xxxxxxxxxxxx of IoT thing Name from the downloaded certificate link, press the option ‘e’ and click the Edit tab of
the Tera Term and “Paste<CR>” and verify and confirm the valid string and press OK.
Note: Please copy the IOTThingName without “”.

Figure 41. Copy the IOTThingName

Figure 42. Storing the Thing Name into the Data Flash8. Press option ‘j’ and ‘k’ to read and validate the stored information in the data flash.
Note: Validation of the stored data is very limited and validates minimum set of data points. Users are
required to input the valid data to the flash obtained from the Dashboard for the proper working of the
Application.
Note: Option ‘l) Format Flash data’ will erase all saved value in data flash. Please be careful when using
this option in application.

R01QS0070EJ0120 Rev.1.20
Apr.10.24

Page 35 of 116

Renesas RX Family
5.3.2

AWS Cloud Connectivity on CK-RX65N v2 with Wi-Fi DA16600

Storing the SSID Name, Password and Security Option

SSID Name, Password and Security option need to be stored in the data flash for the Wi-Fi connection of
application.
1. Press ‘4’ on the Main Menu to display Configure Wi-Fi related commands as shown in the following
snapshot. This sub menu has commands to store and read the data.

Figure 43. Configure Wi-Fi related Menu and Commands
2. To store the SSID Name, in the Wi-Fi menu, press the option ‘a’.
Note: Max length of SSID is 32 characters and the min length is 2 characters.
⎯ If users have copied the SSID before, please click the “Edit” tab of the Tera Term and “Paste<CR>”
and verify and confirm the valid string and press OK as shown below.

Figure 44. Storing the SSID Name into the Data Flash 1/3⎯ If the user did not copy the SSID before this step, they can input directly to the Tera Term. And forchecking easily the SSID, click the Setup > Terminal > Local echo of the Tera Term as below.

R01QS0070EJ0120 Rev.1.20
Apr.10.24

Page 36 of 116

Renesas RX Family

AWS Cloud Connectivity on CK-RX65N v2 with Wi-Fi DA16600

Figure 45. Storing the SSID Name into the Data Flash 2/3⎯ Input SSID and press Enter.

Figure 46. Storing the SSID Name into the Data Flash 3/3
3. To store the password, in the Wi-Fi menu, press the option ‘b’, input the password, and confirm thevalid string then press Enter. Max length of password is 32 characters, and the min length is 8
characters.

Figure 47. Storing the Wi-Fi Password into the Data FlashR01QS0070EJ0120 Rev.1.20
Apr.10.24

Page 37 of 116

Renesas RX Family

AWS Cloud Connectivity on CK-RX65N v2 with Wi-Fi DA16600

4. To store the security type, in the Wi-Fi menu, press the option ‘c’, then press the option ‘a’ for OpenWi-Fi, ‘b’ for WPA security, ‘c’ for WPA2 security to choose the correct security for Wi-Fi
configuration.

Figure 48. Storing the Security into the Data Flash5.3.3

Starting the Application

After registering to the Dashboard and configuring the required Cloud credentials through the CLI, theapplication is ready to run. Press the option ‘6’ to start the application. The application prints the Welcome
screen along with the status of validating the Cloud credentials data present in the data flash as shown
below. When the connection is successful, the data is shown.

Figure 49. Welcome Screen on the Console

R01QS0070EJ0120 Rev.1.20
Apr.10.24

Page 38 of 116

Renesas RX Family

AWS Cloud Connectivity on CK-RX65N v2 with Wi-Fi DA16600

Figure 50. Application with MQTT
Note: Sensor data will be able to read correctly after having stabilization time. You can also check thesensor’s operation by choosing option “5. Run Only Sensors App”.
Note: With OB1203 sensor, besides the stabilization time, OB1203 sensor data which is sent to the MQTT
(is showed in the terminal) is affected by the “Data Publishing Interval Settings” (refer to Data
Publishing Interval Settings (Optional) to set this value). So, please keep your finger on the sensor
until the terminal displays the correct data. It can be longer than the stabilization time a little bit.
About the detail of stabilization time, please see Table 9. Sensor Stabilization Time.

5.4

For User Who Use Their Own AWS AccountNote: Complete the steps up to section 5.4.6 Check AWS IoT endpoints.
5.4.1

Get an AWS AccountGet an AWS account > Click the Sign into the Console button.
When considering using AWS, you can use the AWS free tier.
AWS Free Tier

5.4.2

Log in to the AWS Management Console

Amazon Web Services > My Account > AWS Management Console
R01QS0070EJ0120 Rev.1.20
Apr.10.24

Page 39 of 116

Renesas RX Family

AWS Cloud Connectivity on CK-RX65N v2 with Wi-Fi DA16600

Figure 51. Login the AWS

5.4.3

Move to IoT Core Control PanelAWS services > All services > IoT Core

Figure 52. Search the IoT Core (1/2)

Figure 53. Search the IoT Core (2/2)

R01QS0070EJ0120 Rev.1.20
Apr.10.24

Page 40 of 116

Renesas RX Family
5.4.4

AWS Cloud Connectivity on CK-RX65N v2 with Wi-Fi DA16600

Create a Security Policy

Secure > Policies > Create a policy.

Figure 54. Create the Policy (1/3)

Figure 55. Create the Policy (2/3)

R01QS0070EJ0120 Rev.1.20
Apr.10.24

Page 41 of 116

Renesas RX Family

AWS Cloud Connectivity on CK-RX65N v2 with Wi-Fi DA16600

Copy the following code:{“Version”: “2012-10-17”,“Statement”:[{“Effect”: “Allow”,“Action”: “iot:Connect”,“Resource”: “*”},{“Effect”: “Allow”,“Action”: “iot:Publish”,“Resource”: “*”},{“Effect”: “Allow”,“Action”: “iot:Subscribe”,“Resource”: “*”},{“Effect”: “Allow”,“Action”: “iot:Receive”,“Resource”: “*”}]}Paste the copied code into the policy syntax > Create.

Figure 56. Create the Policy (3/3)

R01QS0070EJ0120 Rev.1.20
Apr.10.24

Page 42 of 116

Renesas RX Family
5.4.5•

AWS Cloud Connectivity on CK-RX65N v2 with Wi-Fi DA16600

Register your device (thing) with AWS IoTManage > Things > Create things.

Figure 57. Creating the Things (1/5)
Creating AWS IoT things > Create a single thing.

Figure 58. Creating the Things (2/5)

R01QS0070EJ0120 Rev.1.20
Apr.10.24

Page 43 of 116

Renesas RX Family••

AWS Cloud Connectivity on CK-RX65N v2 with Wi-Fi DA16600

Add your device to the thing name > Next.
Make a note of the name with a text editor (will be used later).

Figure 59. Creating the Things (3/5)
Auto-generate a new certificate.

Figure 60. Creating the Things (4/5)

R01QS0070EJ0120 Rev.1.20
Apr.10.24

Page 44 of 116

Renesas RX Family•

AWS Cloud Connectivity on CK-RX65N v2 with Wi-Fi DA16600

Add a policy for your thing

Figure 61. Creating the Things (5/5)

R01QS0070EJ0120 Rev.1.20
Apr.10.24

Page 45 of 116

Renesas RX Family

AWS Cloud Connectivity on CK-RX65N v2 with Wi-Fi DA16600

Download a Certificate for this Thing/A Public Key/A Private Key

Figure 62. Download A Certificate for this Thing/A Public Key/A Private Key

R01QS0070EJ0120 Rev.1.20
Apr.10.24

Page 46 of 116

Renesas RX Family
5.4.6•

AWS Cloud Connectivity on CK-RX65N v2 with Wi-Fi DA16600

Check AWS IoT Endpoints

Make a note of the Endpoint in a text editor and so forth (will be used later)

Figure 63. Check AWS IoT Endpoints
Reference
Register device to AWS IoT tutorial also available GitHub using https://github.com/renesas/amazonfreertos/wiki/Register-device-to-AWS-IoT
Install for the credential in application as instruction at section 5.3. Software Preparation-Run Project fromIDE.

R01QS0070EJ0120 Rev.1.20
Apr.10.24

Page 47 of 116

Renesas RX Family
5.4.7

AWS Cloud Connectivity on CK-RX65N v2 with Wi-Fi DA16600

Running Application

After collecting Cloud Credentials, it includes:••

Device Certificate, Key, IoT Thing name: after registering device (see section 5.4.5)
MQTT Broker endpoint: (see section 5.4.6)

Please refer to the section 5.3. Software Preparation-Run Project from IDE for storing Cloud credentials
and running application.
Note: Instead of getting cloud credentials from cert.zip file, users collected them directly from AWS
cloud.

5.5

Verifying the Application Project using AWS Dashboard and Renesas
Dashboard

5.5.1

Subscribe to a Topic Messages on the AWS IoTThis section describes the steps on verifying this application example’s functions.
Note: Wait for the board to get the IP address from the service provider upon successful Wi-Fi initialization,and the board to resolve the DNS lookup for the endpoint. After the successful MQTT connection
message on the console “An MQTT connection is established with
<MQTT_BROKER_ENDPOINT>””, the device is ready for Publishing and Subscription of messages.
Note: This application involves AWS MQTT IoT Core, the user has an option to use the AWS IoT
Dashboard for validation purposes, in addition to using the Renesas GUI based Dashboard forcustomized view of all the Sensor Data.
For the verification purposes, the user can use the AWS IoT core Dashboard for configuring and controllingthe subscription and publishing of the topics as described in the following sections.
On the AWS cloud Dashboard side, go to IoT Core and select Test, then choose MQTT test client.
Subscribe to a topic listed below one at a time. A sample snapshot of subscribing to the topics are shown
below.
Note: The messages shown below are case sensitive; users need to take care of this entering the publish
or subscribe messages.
Only enter one message at a time. Copy the message ‘as-is’ between the quotes and do not include
any extra spaces.
“aws/topic/iaq_sensor_data”“aws/topic/oaq_sensor_data”“aws/topic/hs3001_sensor_data”“aws/topic/icm_sensor_data”“aws/topic/icp_sensor_data”“aws/topic/ob1203_sensor_data”
Note: After the subscription to the Topics, the Dashboard is ready to receive the messages being publishedfrom the device.

R01QS0070EJ0120 Rev.1.20
Apr.10.24

Page 48 of 116

Renesas RX Family

AWS Cloud Connectivity on CK-RX65N v2 with Wi-Fi DA16600

Figure 64. Subscribe to a Topic Messages on the AWS IoT Screen

R01QS0070EJ0120 Rev.1.20
Apr.10.24

Page 49 of 116

Renesas RX Family

AWS Cloud Connectivity on CK-RX65N v2 with Wi-Fi DA16600

Figure 65. Subscribed Messages on the AWS IoT Screen

R01QS0070EJ0120 Rev.1.20
Apr.10.24

Page 50 of 116

Renesas RX Family

AWS Cloud Connectivity on CK-RX65N v2 with Wi-Fi DA16600

5.5.2 Publish a Topic Messages on the AWS Dashboard and Renesas Dashboard
5.5.2.1 With AWS Dashboard
The board subscribed to the topic: aws/topic/<topicRx>
If we publish the below data from AWS console
HS3001 temperature alerts:
Based on temperature dashboard will send the alert messages to CK-RX65N v2 kit via below topic
Topic: aws/topic/set_temperature_led_data
Message: {“Temperature_LED”: “HOT”}
Message: {“Temperature_LED”: “WARM”}
Message: {“Temperature_LED”: “COLD”}

Will turn on RED in Tri-Color LED
Will turn on GREEN in Tri-Color LED
Will turn on BLUE in Tri-Color LED

Example:Click Test > MQTT test client

Figure 66. Publish the MQTT Message (1/2)
OB1203 SPO2 alerts:
Based on SPO2 value dashboard will send the alert messages to CK-RX65N v2 kit via below topic
Topic: aws/topic/set_spo2_led_data
Message: {“Spo_LED”: “ON”} Will turn on BLUE LED in CK-RX65N v2
Message: {“Spo_LED”: “OFF”} Will turn off BLUE LED in CK-RX65N v2

R01QS0070EJ0120 Rev.1.20
Apr.10.24

Page 51 of 116

Renesas RX Family

AWS Cloud Connectivity on CK-RX65N v2 with Wi-Fi DA16600

Figure 67. Publish the MQTT Message (2/2)

5.5.2.2 With Renesas Dashboard
Grafana alerts are a way to send notifications when a metric crosses a threshold that has been configured.
By default, the dashboard has thresholds for the following sensors:• OB1203-SPO2: SPO2 above 90, SPO2 below 90• HS3001 – Temperature, F:⎯ Temperature – Cold: below 65⎯ Temperature – Warm: within range from 65 to 85⎯ Temperature – Hot: above 85

Figure 68. Sensor Status Feedback

Sensor status feedback is sent to the device which is indicated by the LEDs.

R01QS0070EJ0120 Rev.1.20
Apr.10.24

Page 52 of 116

Renesas RX Family

AWS Cloud Connectivity on CK-RX65N v2 with Wi-Fi DA16600

6. OTA over MQTT
6.1

Overview OTA

This section describes the steps on using OTA in this application.
OTA (Over-The-Air) updates are crucial in maintaining the functionality, security, and performance of IoT
devices. This feature allows the user to efficiently deploy updates, patches, or new versions of software toconnected IoT devices without requiring physical access to each device.
Please refer to the document about OTA: OTA-using-Amazon-Web-Services-in-RX65N-FreeRTOS-forv202210.01-LTS-rx-1.1.0
Note: This OTA feature in the application is not available for users who use AWS account with free
10$ credit and dashboard that are provided by Renesas, because of some limitation with this account’s
permission.

6.2

Prerequisites

6.2.1

Installing Python

1.

Access the Python download web site: Python downloaded website and Download the Python 3.11.0
installer: Click the Download link for Python 3.11.0

Figure 69. Python Download Website
2. Run the installer and follow the prompts to install Python
On the installation screen, select the Add python.exe to PATH check box.

Figure 70. Python 3.11.0 installer
3. Open a command prompt and confirm that Python 3.11.0 is installed.
Execute the following command and confirm that information appears: $python -V

R01QS0070EJ0120 Rev.1.20
Apr.10.24

Page 53 of 116

Renesas RX Family

AWS Cloud Connectivity on CK-RX65N v2 with Wi-Fi DA16600

Figure 71. Checking version of Python
4. Install the Python encryption library (pycryptodome)
Install the encryption library by executing the following command: $ pip install pycryptodome

Figure 72. Installing Python encryption library

6.2.2

Installing OpenSSL

1. Access the Win32/Win64 download web site for OpenSSL: OpenSSL Download Website and download
the installer for the operating system you are using.

Figure 73. OpenSSL Download Website
2. Run the installer and follow the prompts to install OpenSSL.
3. Open the Win64 OpenSSL Command Prompt and confirm that OpenSSL is installed.
Execute the following command and confirm that information appears: $openssl version

Figure 74. Checking version of OpenSSL

R01QS0070EJ0120 Rev.1.20
Apr.10.24

Page 54 of 116

Renesas RX Family
6.2.3

AWS Cloud Connectivity on CK-RX65N v2 with Wi-Fi DA16600

Installing Renesas Image Generator

Renesas Image Generator is a tool that generates the firmware images used by the firmware update module.
Renesas Image Generator can generate the following images for use by the firmware update module:••

Initial image: An image file containing the bootloader and application program written by flash writerduring initial system configuration (extension: mot)
Update image: An image file containing the updated firmware (extension: rsu)

Renesas Image Generator is provided as part of the Firmware Update FIT module.
Note: Version Rev.2.00 and later of the Firmware Update module only support firmware generation using
Python scripts.

1. Access the link RX Family Firmware Update module Using Firmware Integration Technology Application
Notes Rev.2.01 - Sample Code | Renesas and download the firmware update module.

Figure 75. Renesas Image Generator Downloading (1/2)
2. Extract the downloaded firmware update module.

Figure 76. Renesas Image Generator Downloading (2/2)
3. Extract Renesas Image Generator.
Extract the file RenesasImageGenerator.zip in the firmware update module. The RenesasImageGenerator
folder contains the Renesas Image Generator script file (image-gen.py) and the parameter files for various
devices (*_ImageGenerator_PRM.csv).

R01QS0070EJ0120 Rev.1.20
Apr.10.24

Page 55 of 116

Renesas RX Family

AWS Cloud Connectivity on CK-RX65N v2 with Wi-Fi DA16600

Figure 77. Renesas Image Generator package

6.3

Setting up AWS for OTA

6.3.1

Register your Device in AWS

See chapter 5.4 for details on how to sign up for an AWS account.

6.3.2

Creating an Amazon S3 bucket

Amazon S3 is an online storage web service used to store the firmware with which the device will be
updated.
1. From the Services menu, select Storage and then choose S3.

Figure 78. Create AWS S3 bucket (1/2)

R01QS0070EJ0120 Rev.1.20
Apr.10.24

Page 56 of 116

Renesas RX Family

AWS Cloud Connectivity on CK-RX65N v2 with Wi-Fi DA16600

2. On the Buckets page, click the Create bucket button.

Figure 79. Create AWS S3 bucket (2/2)
3. Enter a bucket name (example: s3test-rx65n)

Figure 80. Naming for bucket
Note: The bucket name must be globally unique. The following error message appears if the bucket name isalready in use. In this case, use another name.
4. Create the bucket.
Enter the settings as follows, and then click the Create bucket button.
••

Block Public Access setting for this bucket: Block all public access.
Bucket Versioning: Enable

R01QS0070EJ0120 Rev.1.20
Apr.10.24

Page 57 of 116

Renesas RX Family

AWS Cloud Connectivity on CK-RX65N v2 with Wi-Fi DA16600

Figure 81. Bucket setting (1/2)

Figure 82. Bucket setting (2/2)

6.3.3

Allocating OTA execution permission to IAM users

Create a role with the appropriate access permissions to create OTA update jobs.
1. Enter “IAM” in the search box at the top of the screen and click IAM in the search results.

Figure 83. IAM search box

R01QS0070EJ0120 Rev.1.20
Apr.10.24

Page 58 of 116

Renesas RX Family

AWS Cloud Connectivity on CK-RX65N v2 with Wi-Fi DA16600

2. In the menu, click Roles and then click the Create role button.

Figure 84. Creating a role
3. Under Select trusted entity, enter the following settings, and then click Next:•••

Under Trusted entity type, select AWS service
Under Use cases for other AWS services, select IoT
Select the IoT option button

Figure 85. Selecting trusted entity

R01QS0070EJ0120 Rev.1.20
Apr.10.24

Page 59 of 116

Renesas RX Family

AWS Cloud Connectivity on CK-RX65N v2 with Wi-Fi DA16600

4. Click Next on the Add permissions page without making any changes.

Figure 86. Add Permissions for Role
5. Enter a role name (example: ota_role_rx65n), and then click the Create role button

Figure 87. Naming for Created Role
6. Click on the role you created.

Figure 88. Created RoleR01QS0070EJ0120 Rev.1.20
Apr.10.24

Page 60 of 116

Renesas RX Family

AWS Cloud Connectivity on CK-RX65N v2 with Wi-Fi DA16600

7. Select Attach policies.

Figure 89. Add permission (1/3)
8. Enter AmazonFreeRTOSOTAUpdate in the Permissions policies search box, and then press the Enter
key.

Figure 90. Add permission (2/3)
9. Select the check box beside the AmazonFreeRTOSOTAUpdate policy, and then click the Add
permissions button.

Figure 91. Add permission (3/3)

R01QS0070EJ0120 Rev.1.20
Apr.10.24

Page 61 of 116

Renesas RX Family

AWS Cloud Connectivity on CK-RX65N v2 with Wi-Fi DA16600

10. From the Add permissions drop-down list, select Create inline policy.

Figure 92. Create inline policy (1/3)
11. Click JSON, paste the following code, and then click Next.
This code grants permission to pass the IAM role to AWS services.
{“Version”: “2012-10-17”,“Statement”: [{“Effect”: “Allow”,“Action”: [“iam:GetRole”,“iam:PassRole”],“Resource”: “*”}]}Figure 93. Create inline policy (2/3)

R01QS0070EJ0120 Rev.1.20
Apr.10.24

Page 62 of 116

Renesas RX Family

AWS Cloud Connectivity on CK-RX65N v2 with Wi-Fi DA16600

12. Enter a policy name (example: rx65n_ota_demo_iam_policy), and then click the Create policy button.

Figure 94. Create inline policy (3/3)
13. Again, from the Add permissions drop-down list, select Create inline policy.

Figure 95. Create inline policy (1/3)
14. Click JSON, paste the following code, and then click Next.
This code allows access to Amazon S3 where the updated firmware is stored.
{“Version”: “2012-10-17”,“Statement”: [{“Effect”: “Allow”,“Action”: [“s3:GetObjectVersion”,“s3:GetObject”,“s3:PutObject”],“Resource”: [
“*”
]
}
]
}
R01QS0070EJ0120 Rev.1.20
Apr.10.24

Page 63 of 116

Renesas RX Family

AWS Cloud Connectivity on CK-RX65N v2 with Wi-Fi DA16600

Figure 96. Create inline policy (2/3)
15. Enter a policy name (example: rx65n_ota_demo_s3_policy), and then click the Create policy button.

Figure 97. Create inline policy (3/3)

R01QS0070EJ0120 Rev.1.20
Apr.10.24

Page 64 of 116

Renesas RX Family

AWS Cloud Connectivity on CK-RX65N v2 with Wi-Fi DA16600

6.4

Setting up the Device

6.4.1

Generating Key Pairs and Certificates

1. Open the Win64 OpenSSL Command Prompt and create a CA private key using ECDSA.
Execute the following command: $openssl ecparam -genkey -name secp256r1 -out ca.key

Figure 98. Creating CA private key
2. Create a CA certificate from the created CA private key.
Execute the following command: $openssl req -x509 -sha256 -new -nodes -key ca.key -days 3650 -out ca.crt

Figure 99. Creating CA certificate
3. Create an ECDSA key pair.
Execute the following command: $openssl ecparam -genkey -name secp256r1 -out secp256r1.keypair

Figure 100. Creating ECDSA key pairs
4. Create a certificate signing request from the created ECDSA key pair.
Execute the following command: $openssl req -new -sha256 -key secp256r1.keypair > secp256r1.csr

Figure 101. Creating certificate signing request

R01QS0070EJ0120 Rev.1.20
Apr.10.24

Page 65 of 116

Renesas RX Family

AWS Cloud Connectivity on CK-RX65N v2 with Wi-Fi DA16600

5. Create a certificate from the certificate signing request, CA certificate, and CA private key.
Execute the following command: $openssl x509 -req -sha256 -days 3650 -in secp256r1.csr -CA ca.crt Cakey ca.key -Cacreateserial -out secp256r1.crt

Figure 102. Creating code signing certificate
6. Extract the private key from the ECDSA key pair.
Execute the following command:$openssl ec -in secp256r1.keypair -outform PEM -out secp256r1.privatekey

Figure 103. Create private key (secp256r1.privatekey)
7. Extract the public key from the ECDSA key pair.
Execute the following command:$openssl ec -in secp256r1.keypair -outform PEM -pubout -out secp256r1.publickey

Figure 104. Create public key (secp256r1.publickey)
8. After creating, please checking the result:

Figure 105. Total created files

6.4.2 Setting up the project
6.4.2.1 Creating initial firmware
The following explains how to create the initial firmware that combines the boot loader(boot_loader_ck_rx65n_v2) and the firmware (aws_da16600_ck_rx65n).
1. Additional import boot_loader_ck_rx65n_v2 project:
Make sure that configuration in boot_loader_ck_rx65n.scfg file of boot_loader_ck_rx65n_v2 project as
below:R01QS0070EJ0120 Rev.1.20
Apr.10.24

Page 66 of 116

Renesas RX Family

AWS Cloud Connectivity on CK-RX65N v2 with Wi-Fi DA16600

Table 7 Components Configuration of boot loader project
No

Component

Configuration

1

Startup→Generic→r_bsp

Enable user stdio charput function: Use user charput()function

2

Drivers→Memory→r_flash_rx

Enable code flash programming: Includes code toprogram ROM area
Enable code flash self-programming: Programming code
flash while executing from another segment in ROM

3

Drivers→Communications→r_sci_rx

Include software support for channel 5: Include

4

Middleware→Generic→r_fwup

Select the function mode: user for Boot Loader
Main area start address: 0xFFF00000
Buffer area start address: 0xFFE00000
Install area size: 0xF0000

Check the boot loader device.
And also in the boot_loader_ck_rx65n.scfg file, click the Board tab. Confirm that R5F565NEHxFB_DUAL
appears in the Board field.

Figure 106. bootloader’s device selection
Assign public key: Copy the contents of the secp256r1.publickey file you created in 6.4, and paste thecontents into CODE_SIGNER_PUBLIC_KEY_PEM defined in the following files:
boot_loader_ck_rx65n_v2\src\key\code_signer_public_key.h

R01QS0070EJ0120 Rev.1.20
Apr.10.24

Page 67 of 116

Renesas RX Family

AWS Cloud Connectivity on CK-RX65N v2 with Wi-Fi DA16600

Figure 107. Add Code Signing Public Key to Boot Loader Project
2. Set ENABLE_OTA_UPDATE_DEMO to 1 (Enable) in
aws_da16600_ck_rx65n\src\frtos_config\demo_config.h. (The default is 0)

Figure 108. Enable OTA Demo
3. Checking the project environment settings:
For both projects, from the Projects menu, select Properties, expand the C/C++ Build menu, and click
Settings. On the Toolchain tab, confirm that the toolchain is Renesas CC-RX

R01QS0070EJ0120 Rev.1.20
Apr.10.24

Page 68 of 116

Renesas RX Family

AWS Cloud Connectivity on CK-RX65N v2 with Wi-Fi DA16600

Figure 109. Project toolchain
4. On the Tool Settings tab, expand the Converter menu and select Output. Confirm that the Motorola S
format file check box is selected.

Figure 110. Project setting

R01QS0070EJ0120 Rev.1.20
Apr.10.24

Page 69 of 116

Renesas RX Family

AWS Cloud Connectivity on CK-RX65N v2 with Wi-Fi DA16600

5. Device selection setting
Open the file aws_da16600_ck_rx65n.scfg and click the Board tab. Click the ellipsis (…) beside theBoard field in the Device selection area.

Figure 111. Device selection (1/3)
Click the ellipsis (...) beside the Target Device field and select R5F565NEHxFB_DUAL. The value in theTarget Board drop-down list changes to Custom.

Figure 112. Device selection (2/3)

R01QS0070EJ0120 Rev.1.20
Apr.10.24

Page 70 of 116

Renesas RX Family

AWS Cloud Connectivity on CK-RX65N v2 with Wi-Fi DA16600

Under Build Settings > HardwareDebug > Toolchain Settings, clear the ROM to RAM mapped section(-rom) and Sections (-start) check boxes and then click Finish.

Figure 113. Device selection (3/3)
6. Change the firmware (aws_da16600_ck_rx65n) vector.
Open the aws_da16600_ck_rx65n project and select Project and then Properties.
Expand the C/C++ Build menu and click Settings. In the menu tree on the Tool Settings tab, expand theLinker menu and click Section, and open the Section Viewer. Allocate EXCEPTVECT to 0xFFFEFF80 and
RESETVECT to 0xFFFEFFFC.

R01QS0070EJ0120 Rev.1.20
Apr.10.24

Page 71 of 116

Renesas RX Family

AWS Cloud Connectivity on CK-RX65N v2 with Wi-Fi DA16600

Figure 114. Vector setting
Build the project as instruction in Topic: 5.1.3.Import the Project
7. Generate the initial firmware.
Place the following files in the Renesas Image Generator folder:•••The results of the building the firmware: aws_da16600_ck_rx65n.mot
The results of building the boot loader: boot_loader_ck_rx65n_v2.mot
The private key created in 6.4.1: secp256r1.privatekey

Open a command prompt, navigate to the Renesas Image Generator folder, and execute the following
command to generate the file userprog.mot.
$ python image-gen.py -iup aws_da16600_ck_rx65n.mot -ip RX65N_DualBank_ImageGenerator_PRM.csv -o
userprog -ibp boot_loader_ck_rx65n_v2.mot -key secp256r1.privatekey -vt ecdsa -ff RTOS

R01QS0070EJ0120 Rev.1.20
Apr.10.24

Page 72 of 116

Renesas RX Family

AWS Cloud Connectivity on CK-RX65N v2 with Wi-Fi DA16600

6.4.2.2 Running OTA project
1. Start Renesas Flash Programmer and create new project:

Figure 115. Create New Flash Project (1/4)
After that:
⎯
⎯
⎯
⎯
⎯
⎯

Choose Microcontroller: RX65x
Input project name.
Browse “Project Folder”
Communication: Tool: E2 emulator Lite
Communication: Interface: FINE
Choose “Connect”

Note: Jumper of J16 is “Debug” mode.

Figure 116. Create New Flash Project (2/4)
R01QS0070EJ0120 Rev.1.20
Apr.10.24

Page 73 of 116

Renesas RX Family

AWS Cloud Connectivity on CK-RX65N v2 with Wi-Fi DA16600

Figure 117. Create New Flash Project (3/4)

Figure 118. Create New Flash Project (4/4)
R01QS0070EJ0120 Rev.1.20
Apr.10.24

Page 74 of 116

Renesas RX Family

AWS Cloud Connectivity on CK-RX65N v2 with Wi-Fi DA16600

2. Choose code flash area in configuration:
Only tick option “Select” for “Code Flash 1”.

Figure 119. Choose Code Flash Area
3. Erase “Code Flash” before loading new image:
Choose “Operation Settings” > “Erase”.

Figure 120. Erase Code Flash (1/2)

R01QS0070EJ0120 Rev.1.20
Apr.10.24

Page 75 of 116

Renesas RX Family

AWS Cloud Connectivity on CK-RX65N v2 with Wi-Fi DA16600

Figure 121. Erase Code Flash (2/2)
4. Write the initial firmware (userprog.mot)
This flash project will use commands: Erase, Program and Verify.

Figure 122. Flash the Firmware (1/3)
Add firmware’s path (users have created in 6.4.2.1) to “Program File” and click “Start”:
R01QS0070EJ0120 Rev.1.20
Apr.10.24

Page 76 of 116

Renesas RX Family

AWS Cloud Connectivity on CK-RX65N v2 with Wi-Fi DA16600

Figure 123. Flash the Firmware (2/3)
If it is successful, it will display “Operation completed”:

Figure 124. Flash the Firmware (3/3)

R01QS0070EJ0120 Rev.1.20
Apr.10.24

Page 77 of 116

Renesas RX Family

AWS Cloud Connectivity on CK-RX65N v2 with Wi-Fi DA16600

5. Running the application:
Set jumper of J16 is “Run” mode. The application will run as below (like application in section 5.3.3
Starting the Application, but have activity’s log of boot loader):Figure 125. Start Application with OTA
Press any key to configure the application. For setting Cloud’s credentials for IoT Device, please refer tothe 5.3.3 Starting the Application.
Besides that, for OTA, please store the code signing certificate (user created “secp256r1.crt” file atstep: Create a certificate from the certificate signing request, CA certificate, and CA private key ).
Press ‘2’ on the Main Menu to display Data Flash.

Figure 126.- Main Menu
Press ‘f’ for storing code signing certificate:

Figure 127. Data Flash Menu

R01QS0070EJ0120 Rev.1.20
Apr.10.24

Page 78 of 116

Renesas RX Family

AWS Cloud Connectivity on CK-RX65N v2 with Wi-Fi DA16600

Figure 128. Store code signing certificate into flash (1/2)
Note: please check the EOL of secp256r1.crt and convert it to LF before saving it into data flash.

Figure 129. Store code signing certificate into flash (2/2)

R01QS0070EJ0120 Rev.1.20
Apr.10.24

Page 79 of 116

Renesas RX Family

AWS Cloud Connectivity on CK-RX65N v2 with Wi-Fi DA16600

After saving all Cloud credentials, Wi-Fi credentials, user starts the application by choosing option ‘6’ onMain Menu:

Figure 130. Application with OTA (1/2)

R01QS0070EJ0120 Rev.1.20
Apr.10.24

Page 80 of 116

Renesas RX Family

AWS Cloud Connectivity on CK-RX65N v2 with Wi-Fi DA16600

While sub/pub message to MQTT (sensor’s data, control LEDs and so forth), application will also check theevent of OTA from Cloud to process with it.

Figure 131. Application with OTA (2/2)

6.5

Updating the Firmware

6.5.1 Creating the updated firmware
6.5.1.1 Changing the firmware version
Change the firmware version to a higher version. (Example: Because previous version is 1.0.2, so the newversion we can choose 1.0.3)
Repeat the build process, this time with 3 specified for the APP_VERSION_BUILD definition in
aws_da16600_ck_rx65n\e2studio_ccrx\src\frtos_config\demo_config.h.

R01QS0070EJ0120 Rev.1.20
Apr.10.24

Page 81 of 116

Renesas RX Family

AWS Cloud Connectivity on CK-RX65N v2 with Wi-Fi DA16600

Figure 132. Setting New Version for Firmware

6.5.1.2 Use Renesas Image Generator to Generate the Updated Firmware
Overwrite the file in the Renesas Image Generator folder with the firmware you rebuilt in 6.5.1.1(aws_da16600_ck_rx65n.mot), and then execute the following command at the command prompt:$ python image-gen.py -iup aws_da16600_ck_rx65n.mot -ip
RX65N_DualBank_ImageGenerator_PRM.csv -o user_103 -key secp256r1.privatekey -vt
ecdsa -ff RTOS
This command generates a file named user_103.rsu.

6.5.2

Updating the firmware

In AWS, create an OTA update job that will update the firmware.

6.5.2.1 Creating New Job
In the IoT Core menu, select Manage > Remote actions > and Jobs, and then click the Create job button.

Figure 133. Create New Job for OTA (1/2)

R01QS0070EJ0120 Rev.1.20
Apr.10.24

Page 82 of 116

Renesas RX Family

AWS Cloud Connectivity on CK-RX65N v2 with Wi-Fi DA16600

6.5.2.2 Creating FreeRTOS OTA Job Update
Select Create FreeRTOS OTA update job and then click Next.

Figure 134. Create New Job for OTA (2/2)

6.5.2.3 Entering a Job NameEnter a job name (example: rx65n_ota_demo_job) and then click Next.

Figure 135. Enter OTA Job NameR01QS0070EJ0120 Rev.1.20
Apr.10.24

Page 83 of 116

Renesas RX Family

AWS Cloud Connectivity on CK-RX65N v2 with Wi-Fi DA16600

6.5.2.4 Updating Devices
Click the Devices to update drop-down list and select the device to update.

Figure 136. Choose Device to Update

6.5.2.5 Creating New Profile
Click Create new profile.

Figure 137. Create New Code Signing Profile

R01QS0070EJ0120 Rev.1.20
Apr.10.24

Page 84 of 116

Renesas RX Family

AWS Cloud Connectivity on CK-RX65N v2 with Wi-Fi DA16600

You can skip steps 6.5.2.5 to 6.5.2.9 if you have already created a profile. Click Choose existing codesigning profile and select the profile you created from the drop-down list.

Figure 138. Choose Existing Code Signing Profile

6.5.2.6 Creating a Profile Naming
Create a profile (1): Profile name and device hardware platform:••

Enter the profile name (example: rx65n_ota_demo_profile)
Select Windows Simulator as the device hardware platform!

Figure 139. Create New Code Signing (1/2)

R01QS0070EJ0120 Rev.1.20
Apr.10.24

Page 85 of 116

Renesas RX Family

AWS Cloud Connectivity on CK-RX65N v2 with Wi-Fi DA16600

6.5.2.7 Creating a Profile: Importing Certificate
Create a profile (2): Import a certificate.
•
•
•
•
•

In the Code signing certificate area, click Import new code signing certificate.
In Certificate body, select the file secp256r1.crt.
In Certificate private key, select the file secp256r1.privatekey
In Certificate chain, select the file ca.crt..
Note: You have created above files in 6.4.
Click ImportFigure 140. Create New Code Signing (2/2)

R01QS0070EJ0120 Rev.1.20
Apr.10.24

Page 86 of 116

Renesas RX Family

AWS Cloud Connectivity on CK-RX65N v2 with Wi-Fi DA16600

6.5.2.8 Creating a Profile: Entering Path
Create a profile (3): Enter the path of the code signing certificate of the device and then click Create.
You can enter any path. (Example: dummy)

Figure 141. Enter the Path of the Code Signing Certificate of the Device

6.5.2.9 Confirming Profile Name
Confirm that the name of the profile you created earlier is selected in the Existing code signing profile dropdown list.

Figure 142. Choose Existing Code Signing Profile

R01QS0070EJ0120 Rev.1.20
Apr.10.24

Page 87 of 116

Renesas RX Family

AWS Cloud Connectivity on CK-RX65N v2 with Wi-Fi DA16600

6.5.2.10 Updating the Firmware••••

Select Upload a new file.
In File to upload, select the file user_103.rsu you created in 6.5.1.2.
Click Browse S3 and select the S3 bucket you created in 6.3.
Enter a path name in Path name of file on device (You can enter any path name. Example:/device/updates).

Figure 143. Choose Firmware to Update

6.5.2.11 Choosing the Role for the Job
In the role drop-down list, select the role you created in 6.3 and then click Next.

Figure 144. Choose Role for Creating Job

R01QS0070EJ0120 Rev.1.20
Apr.10.24

Page 88 of 116

Renesas RX Family

AWS Cloud Connectivity on CK-RX65N v2 with Wi-Fi DA16600

Click Create job.

Figure 145. Create Job

6.5.2.12 Waiting until Firmware Reception is Complete
Wait until firmware reception is complete.
When the job starts, the job receives and writes the firmware.
The Received counter is incremented when reception starts.

Figure 146. OTA Job is Processed
When the update process is complete, the device resets and the initial menu appears.

Figure 147. Device Reset and Update New Firmware

R01QS0070EJ0120 Rev.1.20
Apr.10.24

Page 89 of 116

Renesas RX Family

AWS Cloud Connectivity on CK-RX65N v2 with Wi-Fi DA16600

6.5.2.13 Confirming that the Firmware Version is a New Version
Example: 1.0.3 (updated at 6.5.1.1)

Figure 148. Firmware with New Version is Updated
When OTA updated firmware successfully, status will be “Succeeded” like below:

Figure 149. Job’s Status in AWS Portal

7. Fleet Provisioning
7.1

Overview Fleet Provisioning

This section describes the steps on using Fleet Provisioning in this application.
Fleet provisioning is a procedure in which provisioning takes place when each IoT device is started for the
first time.
Generally speaking, it can be implemented in either of the following two ways.
1. Provisioning by claim (approach using provisioning claim certificates)
2. Provisioning by trusted user (mobile or web app user, etc.)
In addition, either of the following two procedures can be used to obtain the individual certificates and private
keys used for fleet provisioning.
A) Having the AWS certification authority generate a new individual certificate and private key and send it to
the device (CreateKeysAndCertificate).
B) Generating a key pair on the device internally and sending a certificate signature request (CSR) to AWS
to have them generate only an individual certificate and send it to the device (CreateCertificateFromCsr).
This document describes the implementation of a fleet provisioning that combines 1. And B).
Advantages•••

The device’s private key never leaves the device.
There is no need to establish a connection between the manufacturing plant and AWS IoT.
There is no need to put in place a structure for issuing individual certificates or registering devices.

On the other hand, it also has the following disadvantages. It is necessary to be aware of both theadvantages and the disadvantages when using this provisioning method.

R01QS0070EJ0120 Rev.1.20
Apr.10.24

Page 90 of 116

Renesas RX Family

AWS Cloud Connectivity on CK-RX65N v2 with Wi-Fi DA16600

Disadvantages•

It is necessary to take into account the possibility that the provisioning claim certificate could leak to an
unauthorized party.
• It is necessary to implement functionality on the device to issue a provisioning request and receive a
response.
For detail about Fleet Provisioning, please refer to chapter 3, 4 of the AN: RX Family Provisioning Procedure
for IoT Devices Rev.1.00 (renesas.com) (Demo application for Cellular + Ethernet).

7.2

Setting up AWS for Fleet Provisioning

It is necessary to configure AWS settings in order to run the fleet provisioning demo.
1. Policy settings
2. Generating a claim certificate and claim key pair
3. Creating a fleet provisioning template

7.2.1

Policy Settings

Follow the steps below to create AWS IoT Core policies. The first policy you create will be used when fleet
provisioning is run.

Figure 150. Creating an AWS IoT Policy (1/2)
In the Policy name field, enter the policy name of your choice.

R01QS0070EJ0120 Rev.1.20
Apr.10.24

Page 91 of 116

Renesas RX Family

AWS Cloud Connectivity on CK-RX65N v2 with Wi-Fi DA16600

Figure 151 Creating an AWS IoT Policy (2/2)
Click the JSON button to display the policy document input field, then copy and paste the policy document
shown in Table 8.
Policy into the input field. When copying and pasting the policy document in Table
8.
Policy, make the following changes:
・Change “us-east-1” to match the region used.
・Change <account id> to your own account ID (account ID is the 12-digit number after @ that is displayedby clicking on the account name in the upper right corner, excluding the hyphen)
Table 8. Policy Document{“Version”: “2012-10-17”,“Statement”: [{“Effect”: “Allow”,“Action”: “iot:Connect”,“Resource”: “*”},{“Effect”: “Allow”,“Action”: [“iot:Publish”,“iot:Receive”,“iot:RetainPublish”],“Resource”: [“arn:aws:iot:us-east-1:<account id>:topic/$aws/certificates/create-from-csr/*”,“arn:aws:iot:us-east-1:<account id>:*”]},{“Effect”: “Allow”,“Action”: “iot:Subscribe”,

R01QS0070EJ0120 Rev.1.20
Apr.10.24

Page 92 of 116

Renesas RX Family

AWS Cloud Connectivity on CK-RX65N v2 with Wi-Fi DA16600“Resource”: [“arn:aws:iot:us-east-1:<account id>:topicfilter/$aws/certificates/create-from-csr/*”,“arn:aws:iot:us-east-1:<account id>:*”
]
}
]
}

7.2.2

Generating a Claim Certificate and Claim Key Pair

Generate a provisioning claim certificate and provisioning claim key pair for use in fleet provisioning.
Select Security → Certificates and then click Add certificate → Create certificate.

Figure 152. Create a Certificate

Figure 153. Creating a Certificate Automatically

R01QS0070EJ0120 Rev.1.20
Apr.10.24

Page 93 of 116

Renesas RX Family

AWS Cloud Connectivity on CK-RX65N v2 with Wi-Fi DA16600

Download the newly created certificate ① and key pair ②③, then click the Continue button.

Figure 154. Downloading the Certificate and Key Pair
On the AWS console, select Security → Certificates and select the newly generated certificate ID.

Figure 155. Certificate SettingsR01QS0070EJ0120 Rev.1.20
Apr.10.24

Page 94 of 116

Renesas RX Family

AWS Cloud Connectivity on CK-RX65N v2 with Wi-Fi DA16600

Click Actions → Activate to activate the certificate. Also click the Attach policies button.

Figure 156. Certificate Settings: Attach Policies (1/2)
Clicking the Attach policies button opens the dialog box shown in Figure 157.
Select the policy to be used when fleet provisioning is run, created in 7.2.1, Policy Settings, and then click
the Attach policies button to attach it to the certificate. Example, the name of policy, which is created for Fleet
demo, is “Fleet_policy”.
This completes the settings related to generation of the claim certificate and claim key pair.

Figure 157. Certificate Settings: Attach Policies (2/2)

7.2.3

Creating a Fleet Provisioning Template

Select Connect many devices → Connect many devices, then click the Create provisioning template
button.

R01QS0070EJ0120 Rev.1.20
Apr.10.24

Page 95 of 116

Renesas RX Family

AWS Cloud Connectivity on CK-RX65N v2 with Wi-Fi DA16600

Figure 158. Creating a Provisioning Template (1/7)
Select Provisioning devices with claim certificates, then click the Next button.

Figure 159. Creating a Provisioning Template (2/7)
On the template creation screen, specify the provisioning template status, template name, and provisioning
role. For Provisioning template status select Active and enter the name of the provisioning template. Thenclick the Create new role button and enter the role name.

R01QS0070EJ0120 Rev.1.20
Apr.10.24

Page 96 of 116

Renesas RX Family

AWS Cloud Connectivity on CK-RX65N v2 with Wi-Fi DA16600

Figure 160. Creating a Provisioning Template (3/7)
For Claim certificate policy, select the policy to be used when fleet provisioning is run, created in 7.2.1. For
Claim certificate, select the certificate created in 7.2.3, and click the Next button.

R01QS0070EJ0120 Rev.1.20
Apr.10.24

Page 97 of 116

Renesas RX Family

AWS Cloud Connectivity on CK-RX65N v2 with Wi-Fi DA16600

Figure 161. Creating a Provisioning Template (4/7)
For Pre-provisioning actions, select Don’t use a pre-provisioning action. Also, under Automatic thing
creation, turn on Automatically create a thing resource when provisioning a device, and if necessary,
enter a character string of your choice as the thing name prefix. The thing name registered with AWS will be
generated from this character string and the serial number set by the program. After entering the prefix, click
the Next button.
Note: The demo does not use pre-provisioning actions. Refer to the page linked to below for information on
using pre-provisioning actions:
Provisioning devices that don’t have device certificates using fleet provisioning – AWS IoT Core
(amazon.com)

R01QS0070EJ0120 Rev.1.20
Apr.10.24

Page 98 of 116

Renesas RX Family

AWS Cloud Connectivity on CK-RX65N v2 with Wi-Fi DA16600“Using pre-provisioning hooks with the AWS CLI”

Figure 162. Creating a Provisioning Template (5/7)
For Set device permissions, check the box next to the policy attached to newly created things, which was
created in 5.4.4, then click the Next button.
R01QS0070EJ0120 Rev.1.20
Apr.10.24

Page 99 of 116

Renesas RX Family

AWS Cloud Connectivity on CK-RX65N v2 with Wi-Fi DA16600

Figure 163. Creating a Provisioning Template (6/7)
Click the Create template button to complete the process of creating a fleet provisioning template.

Figure 164. Creating a Provisioning Template (7/7)

R01QS0070EJ0120 Rev.1.20
Apr.10.24

Page 100 of 116

Renesas RX Family
7.3

AWS Cloud Connectivity on CK-RX65N v2 with Wi-Fi DA16600

Setting up the Project

Change the value of ENABLE_FLEET_PROVISIONING_DEMO to 1 in/aws_da16600_ck_rx65n/src/frtos_config/demo_config.h:Figure 165. Enable Fleet Provisioning macro
Build and Debug the project as instruction in Topic: 5.1.3.Import the Project (number 8, 9)

7.4

Running Fleet Provisioning

Note: User can run both Fleet Provisioning + OTA (Section 6) in this application. This section only describes
Fleet Provisioning feature.
1. After loading debugging to board, press any key to configure the application. (in case users have notconfig Cloud’s credential for Fleet Provisioning before, or users want to save another value for Cloud’s
credential)

Figure 166. Save credentials for Fleet Provisioning (1/8)

R01QS0070EJ0120 Rev.1.20
Apr.10.24

Page 101 of 116

Renesas RX Family

AWS Cloud Connectivity on CK-RX65N v2 with Wi-Fi DA16600

Figure 167. Save credentials for Fleet Provisioning (2/8)
2. Press ‘2’ to choose “2. Data flash” -> press ‘l’ to choose “l) Format Flash data” to erase all stored
information in flash (if application was run previously) (optional)

Figure 168. Save credentials for Fleet Provisioning (3/8)
Different from normal provisioning, Fleet Provisioning requires credentials: MQTT broker endpoint, fleet
template name, claim cert ID, claim private key ID.

R01QS0070EJ0120 Rev.1.20
Apr.10.24

Page 102 of 116

Renesas RX Family

AWS Cloud Connectivity on CK-RX65N v2 with Wi-Fi DA16600

3. Get MQTT endpoint and save to flash like topic 5.4.6 and 5.3.1:

Figure 169. Save credentials for Fleet Provisioning (4/8)
4. Next, storing fleet template name that user created at 7.2.3, copy this value, press the option ‘g’ andclick the Edit tab of the Tera Term and “Paste<CR>” and verify and confirm the valid string and press
OK.

Figure 170. Save credentials for Fleet Provisioning (5/8)
5. Next, storing fleet claim cert ID, claim private key ID that users created at 0, users downloaded (Figure
154Figure 154. Downloading the Certificate and Key Pair):

R01QS0070EJ0120 Rev.1.20
Apr.10.24

Page 103 of 116

Renesas RX Family

AWS Cloud Connectivity on CK-RX65N v2 with Wi-Fi DA16600

Figure 171. Save credentials for Fleet Provisioning (6/8)
From “2. DATA FLASH” menu, press ‘h’ to save Claim cert ID. Then click the File tab of the Tera Termand Send File option and choose the downloaded Device certificate file “xxxxxcertificate.pem.crt”.

Figure 172. Save Credentials for Fleet Provisioning (7/8)

R01QS0070EJ0120 Rev.1.20
Apr.10.24

Page 104 of 116

Renesas RX Family

AWS Cloud Connectivity on CK-RX65N v2 with Wi-Fi DA16600

Figure 173. Save Credentials for Fleet Provisioning (8/8)
To store the Claim private key ID, press the option ‘i’ and click the File tab of the Tera Term and Send Fileoption, choose “xxxxxprivate.pem.key”.
6. Store Wi-Fi’s credentials to Flash (refer to topic 5.3.2)
7. Start application with Fleet Provisioning:
Back to the Application Menu and press ‘6’ to run application:

Figure 174. Running Application with Fleet (1/8)
Application will check stored data flash. When it has necessary credentials enough, application will start.
Otherwise, the application will send a notice to the user and the user has to save the lacking credentials forrunning application.

R01QS0070EJ0120 Rev.1.20
Apr.10.24

Page 105 of 116

Renesas RX Family

AWS Cloud Connectivity on CK-RX65N v2 with Wi-Fi DA16600

Figure 175. Running Application with Fleet (2/8)
If the text string “Demo completed successfully.” Appears at the end of the log, the fleet provisioning
demo completed successfully. Successful completion of the demo means that a new thing has beenregistered on AWS IoT Core and an individual device certificate assigned to it.

Figure 176. Running Application with Fleet (3/8)
After running the fleet provisioning demo, users can use the individual device certificate and private key
obtained from AWS to run the MQTT with sensors demo:

R01QS0070EJ0120 Rev.1.20
Apr.10.24

Page 106 of 116

Renesas RX Family

AWS Cloud Connectivity on CK-RX65N v2 with Wi-Fi DA16600

Figure 177. Running Application with Fleet (4/8)
Users can check on the thing registered by the fleet provisioning demo from AWS IoT console. Whenrunning fleet provisioning successfully, please check the log in Tera Term with line: “Received AWS IoTThing name: test_fleetFPDemoID_xxxxxxxxxxx”

Figure 178. Running Application with Fleet (5/8)
Note: Prefix test_fleet is the name which is set by user when creating Fleet template.
Under All devices, select Things. The registered thing is below (it likes thing’s name above):R01QS0070EJ0120 Rev.1.20
Apr.10.24

Page 107 of 116

Renesas RX Family

AWS Cloud Connectivity on CK-RX65N v2 with Wi-Fi DA16600

Figure 179. Running Application with Fleet (6/8)
By checking the registered things, user can confirm that the individual device certificate generated andassigned by fleet provisioning has been attached and activated:

Figure 180. Running Application with Fleet (7/8)
This Certificate ID will be shown in Tera Term with line “Received certificate with Id: xxxxxxxxxxxxxxxxxx”.

Figure 181. Running Application with Fleet (8/8)

R01QS0070EJ0120 Rev.1.20
Apr.10.24

Page 108 of 116

Renesas RX Family

AWS Cloud Connectivity on CK-RX65N v2 with Wi-Fi DA16600

8. Note and Trouble Shooting
8.1

About Stabilization Time for Sensor

There is stabilization time for each sensor. It cannot read correct values during the time.
The following table gives details of stabilization time for each sensor.
Table 9. Sensor Stabilization Time
Sensor NameZMOD4410 IAQ

When Powered up the First Time
Up to 1 min

After Soft or Hard Reset
Up to 1 Min

ZMOD4510 OAQ

Up to 1.5 hours

Up to 1 hours

OB1203Up to 20 min

Up to 20 seconds(After putting finger on sensor, it may
take up to 60 seconds to sense data)(After putting finger on sensor, it may
take up to 60 seconds to sense data)

HS3001Up to 30 seconds

Up to 10 seconds

ICP

Up to 30 seconds

Up to 10 seconds

ICM

Up to 30 seconds

Up to 10 seconds

8.2

When Build Errors Occur

1. If a ‘No such file or directory’ error occurs, the project path may be too long. When the path is longer
than 256 characters, e² studio outputs errors at build time.
When this error occurs, move the project to a shorter path location (for example, under C:\).
2. If a ‘Cannot find “PFRAM2’ specified in option “rom”’ error occurs as below:

Figure 182. Issue with Option Dual Bank in BSP (1/2)
This issue happens after re-generating the Smart Configuration (file “aws_da16600_ck_rx65n.scfg”) as
shown in Figure 16. Generate Code. Please modify the value of macro
BSP_CFG_CODE_FLASH_BANK_MODE to 0 (in file src/smc_gen/r_config/r_bsp_config.h) to
run with dual mode of dual-bank function with the code flash memory and re-build again.

R01QS0070EJ0120 Rev.1.20
Apr.10.24

Page 109 of 116

Renesas RX Family

AWS Cloud Connectivity on CK-RX65N v2 with Wi-Fi DA16600

Figure 183. Issue with Option Dual Bank in BSP (2/2)

8.3

When Run Errors Occur

In case of error, relate to wifi_init(): “[ERR] In Function: wifi_init(), ** Wi-Fi Init
Failure **”, SDK version in DA16600 Pmod is old. It is required to use DA16600 SDK v3.2.7.1 or later
for the application to work correctly. To confirm DA16600 SDK version and update for it if required, see theguideline in DA16200/DA16600 SDK Update Guide.

8.4

Wi-Fi Access Point

Depending on the configuration of the Wi-Fi router/modem, the application may not work correctly. Please
retry with another access point (for example, by using the hotspot on mobile phone).

8.5

When the Trial 10 USD is Used Up

When the trial 10 USD is used up, status will change to “Quarantined”. At this time, the user cannot
download certificate and go to Dashboard.

Figure 184. Account Used Up Trial 10 USD
Note: Please add payment options before the account is quarantined and enable the option on thedashboard. If the account is quarantined, please contact Renesas Customer Support.
To enable option on the dashboard, go to the user profile.

R01QS0070EJ0120 Rev.1.20
Apr.10.24

Page 110 of 116

Renesas RX Family

AWS Cloud Connectivity on CK-RX65N v2 with Wi-Fi DA16600

Figure 185. Choose Profile!
Choose “Yes” for the Payment Preference Update Confirmation

Figure 186. Payment Confirmation
To add a credit card to continue using this account or using another AWS account, go to https://cloud-rarx.awsapps.com/start#/, sign up with AWS account.

Figure 187. Sign up to AWS Account
Go to Manage Console > Account > AWS Billing > Payment preferences > Add payment method

R01QS0070EJ0120 Rev.1.20
Apr.10.24

Page 111 of 116

Renesas RX Family

AWS Cloud Connectivity on CK-RX65N v2 with Wi-Fi DA16600

Figure 188. Add Credit Card for Trial Account (1/4)

Figure 189. Add Credit Card for Trial Account (2/4)

Figure 190. Add Credit Card for Trial Account (3/4)

R01QS0070EJ0120 Rev.1.20
Apr.10.24

Page 112 of 116

Renesas RX Family

AWS Cloud Connectivity on CK-RX65N v2 with Wi-Fi DA16600

Figure 191. Add Credit Card for Trial Account (4/4)
Note: Please add payment options before the account is quarantined and enable the option on thedashboard. If the account is quarantined, please contact Renesas Customer Support.

8.6

When Unable to Log in to the Dashboard (Grafana account)

If you cannot log in to the Dashboard with the password you changed in step 6 of section 5.2.2, To Get the
Account 10 USD of Trial of AWS, try the following.
•

Set “admin” in the Email or username field and set the changed password in the password field.

When changing the password for the initial session, the username is not changed from admin. Therefore,
admin must be entered in the username field. To enable users to log in with your own username and email
address, please change the user information in the Server Admin menu after logging in.

8.7

How to Enable/Disable EC2 InstanceAWS trial accounts start billing immediately after device registration. The following steps will disable the EC2
instance, saving user’s credits.
Access AWS account from https://cloud-ra-rx.awsapps.com/start#/ using the dashboard credentials. (Referto the Figure 187. Sign up to AWS Account to login)
Note: If users wish to use the dashboard again, please enable the EC2 instance before using it.
1. From the Services menu, select Compute and then choose EC2.

R01QS0070EJ0120 Rev.1.20
Apr.10.24

Page 113 of 116

Renesas RX Family

AWS Cloud Connectivity on CK-RX65N v2 with Wi-Fi DA16600

Figure 192. EC2 AWS Service
2. Choose the instance then change the Instance State to Stop state.

Figure 193. Disable Instance

8.8

An error occurs when connecting to AWS

The AWS IoT information is not set yet or is set incorrectly. Please check and set AWS IoT information
again. (5.3.1)

8.9

Command to create to create the initial firmware fails (OTA)

The cause of this issue is the Python installation folder is not set correctly in the Path variable or theencryption library is not installed.
Users have to re-install Python. Also, make sure that the Add python.exe to PATH check box is selected
when you perform the step in 6.2.1 and install the encryption library.

8.10 Initial firmware cannot be written/ does not start. (OTA)
Make sure that the jumper on J16 of CK-RX65N board is on pins 1-2 (debug mode) when writing initial
firmware and on pin 2-3 (run mode) when starting the initial firmware.

8.11 Firmware does not start after starting the boot loader (OTA)
Please review the public key setting in the bootloader because it is not correctly set in the boot loader.

8.12 Firmware does not start after an OTA update (OTA)
Users can review the public key setting in the firmware because the public key is not set correctly in thefirmware. If not, please review the device setting in the firmware and the boot loader.

R01QS0070EJ0120 Rev.1.20
Apr.10.24

Page 114 of 116

Renesas RX Family

AWS Cloud Connectivity on CK-RX65N v2 with Wi-Fi DA16600

Website and Support
Visit the following vanity URLs to learn about key elements of the RX family, download components andrelated documentation, and get support.
CK-RX65N v2 Kit Information
RX&RA Cloud Solutions
RX Cloud solution web
RX Product Information
RX Product Support ForumRX Driver Package
Renesas Support

R01QS0070EJ0120 Rev.1.20
Apr.10.24

renesas.com/rx/ck-rx65n
renesas.com/cloudsolutions
renesas.com/rx-cloudrenesas.com/rx
renesas.com/rx/forum
renesas.com/RDP
renesas.com/support

Page 115 of 116

Renesas RX Family

AWS Cloud Connectivity on CK-RX65N v2 with Wi-Fi DA16600

Revision History
Rev.
1.00
1.10

Date
Oct.20.23
Dec.10.23

1.20

Apr.10.24

R01QS0070EJ0120 Rev.1.20
Apr.10.24

Description
Page
Summary—
Initial release—
Updated e2 studio version (2023-10) and FreeRTOS version(V202210.01)
5–8
Table 5: Updated file structures following LTS#2
26, 275.1.4: Updated starting application flow
52, 53Updated note and trouble shooting in building, running andusing up 10 USD
56, 57
Added note “6.7 How to enable/disable EC2 instance”—
Added OTA feature (section 6), Fleet Provisioning feature(section 7)

Page 116 of 116

General Precautions in the Handling of Microprocessing Unit and Microcontroller
Unit Products
The following usage notes are applicable to all Microprocessing unit and Microcontroller unit products from Renesas. For detailed usage notes on the
products covered by this document, refer to the relevant sections of the document as well as any technical updates that have been issued for the products.
1.

Precaution against Electrostatic Discharge (ESD)
A strong electrical field, when exposed to a CMOS device, can cause destruction of the gate oxide and ultimately degrade the device operation. Steps
must be taken to stop the generation of static electricity as much as possible, and quickly dissipate it when it occurs. Environmental control must be
adequate. When it is dry, a humidifier should be used. This is recommended to avoid using insulators that can easily build up static electricity.
Semiconductor devices must be stored and transported in an anti-static container, static shielding bag or conductive material. All test andmeasurement tools including work benches and floors must be grounded. The operator must also be grounded using a wrist strap. Semiconductor2.

devices must not be touched with bare hands. Similar precautions must be taken for printed circuit boards with mounted semiconductor devices.
Processing at power-on
The state of the product is undefined at the time when power is supplied. The states of internal circuits in the LSI are indeterminate and the states ofregister settings and pins are undefined at the time when power is supplied. In a finished product where the reset signal is applied to the external
reset pin, the states of pins are not guaranteed from the time when power is supplied until the reset process is completed. In a similar way, the statesof pins in a product that is reset by an on-chip power-on reset function are not guaranteed from the time when power is supplied until the power3.

reaches the level at which resetting is specified.
Input of signal during power-off state
Do not input signals or an I/O pull-up power supply while the device is powered off. The current injection that results from input of such a signal or I/O
pull-up power supply may cause malfunction and the abnormal current that passes in the device at this time may cause degradation of internal

4.

elements. Follow the guideline for input signal during power-off state as described in your product documentation.
Handling of unused pins
Handle unused pins in accordance with the directions given under handling of unused pins in the manual. The input pins of CMOS products are
generally in the high-impedance state. In operation with an unused pin in the open-circuit state, extra electromagnetic noise is induced in the vicinityof the LSI, an associated shoot-through current flows internally, and malfunctions occur due to the false recognition of the pin state as an input signal

5.

become possible.
Clock signals
After applying a reset, only release the reset line after the operating clock signal becomes stable. When switching the clock signal during program
execution, wait until the target clock signal is stabilized. When the clock signal is generated with an external resonator or from an external oscillator
during a reset, ensure that the reset line is only released after full stabilization of the clock signal. Additionally, when switching to a clock signal

6.

produced with an external resonator or by an external oscillator while program execution is in progress, wait until the target clock signal is stable.
Voltage application waveform at input pin
Waveform distortion due to input noise or a reflected wave may cause malfunction. If the input of the CMOS device stays in the area between VIL(Max.) and VIH (Min.) due to noise, for example, the device may malfunction. Take care to prevent chattering noise from entering the device when the7.

input level is fixed, and also in the transition period when the input level passes through the area between VIL (Max.) and VIH (Min.).
Prohibition of access to reserved addresses
Access to reserved addresses is prohibited. The reserved addresses are provided for possible future expansion of functions. Do not access these8.

addresses as the correct operation of the LSI is not guaranteed.
Differences between products
Before changing from one product to another, for example to a product with a different part number, confirm that the change will not lead to problems.
The characteristics of a microprocessing unit or microcontroller unit products in the same group but having a different part number might differ interms of internal memory capacity, layout pattern, and other factors, which can affect the ranges of electrical characteristics, such as characteristic
values, operating margins, immunity to noise, and amount of radiated noise. When changing to a product with a different part number, implement asystem-evaluation test for the given product.

Notice1.

Descriptions of circuits, software and other related information in this document are provided only to illustrate the operation of semiconductor products
and application examples. You are fully responsible for the incorporation or any other use of the circuits, software, and information in the design of yourproduct or system. Renesas Electronics disclaims any and all liability for any losses and damages incurred by you or third parties arising from the useof these circuits, software, or information.
2. Renesas Electronics hereby expressly disclaims any warranties against and liability for infringement or any other claims involving patents, copyrights,
or other intellectual property rights of third parties, by or arising from the use of Renesas Electronics products or technical information described in thisdocument, including but not limited to, the product data, drawings, charts, programs, algorithms, and application examples.
3. No license, express, implied or otherwise, is granted hereby under any patents, copyrights or other intellectual property rights of Renesas Electronics
or others.
4. You shall be responsible for determining what licenses are required from any third parties, and obtaining such licenses for the lawful import, export,
manufacture, sales, utilization, distribution or other disposal of any products incorporating Renesas Electronics products, if required.
5. You shall not alter, modify, copy, or reverse engineer any Renesas Electronics product, whether in whole or in part. Renesas Electronics disclaims any
and all liability for any losses or damages incurred by you or third parties arising from such alteration, modification, copying or reverse engineering.
6. Renesas Electronics products are classified according to the following two quality grades: “Standard” and “High Quality”. The intended applications foreach Renesas Electronics product depends on the product’s quality grade, as indicated below.
"Standard": Computers; office equipment; communications equipment; test and measurement equipment; audio and visual equipment; homeelectronic appliances; machine tools; personal electronic equipment; industrial robots; etc.
"High Quality": Transportation equipment (automobiles, trains, ships, etc.); traffic control (traffic lights); large-scale communication equipment; key
financial terminal systems; safety control equipment; etc.
Unless expressly designated as a high reliability product or a product for harsh environments in a Renesas Electronics data sheet or other Renesas
Electronics document, Renesas Electronics products are not intended or authorized for use in products or systems that may pose a direct threat tohuman life or bodily injury (artificial life support devices or systems; surgical implantations; etc.), or may cause serious property damage (spacesystem; undersea repeaters; nuclear power control systems; aircraft control systems; key plant systems; military equipment; etc.). Renesas Electronics
disclaims any and all liability for any damages or losses incurred by you or any third parties arising from the use of any Renesas Electronics productthat is inconsistent with any Renesas Electronics data sheet, user’s manual or other Renesas Electronics document.
7. No semiconductor product is absolutely secure. Notwithstanding any security measures or features that may be implemented in Renesas Electronics
hardware or software products, Renesas Electronics shall have absolutely no liability arising out of any vulnerability or security breach, including but
not limited to any unauthorized access to or use of a Renesas Electronics product or a system that uses a Renesas Electronics product. RENESASELECTRONICS DOES NOT WARRANT OR GUARANTEE THAT RENESAS ELECTRONICS PRODUCTS, OR ANY SYSTEMS CREATED USINGRENESAS ELECTRONICS PRODUCTS WILL BE INVULNERABLE OR FREE FROM CORRUPTION, ATTACK, VIRUSES, INTERFERENCE,
HACKING, DATA LOSS OR THEFT, OR OTHER SECURITY INTRUSION (“Vulnerability Issues”). RENESAS ELECTRONICS DISCLAIMS ANY AND
ALL RESPONSIBILITY OR LIABILITY ARISING FROM OR RELATED TO ANY VULNERABILITY ISSUES. FURTHERMORE, TO THE EXTENTPERMITTED BY APPLICABLE LAW, RENESAS ELECTRONICS DISCLAIMS ANY AND ALL WARRANTIES, EXPRESS OR IMPLIED, WITHRESPECT TO THIS DOCUMENT AND ANY RELATED OR ACCOMPANYING SOFTWARE OR HARDWARE, INCLUDING BUT NOT LIMITED TO
THE IMPLIED WARRANTIES OF MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE.
8. When using Renesas Electronics products, refer to the latest product information (data sheets, user’s manuals, application notes, “General Notes for
Handling and Using Semiconductor Devices” in the reliability handbook, etc.), and ensure that usage conditions are within the ranges specified byRenesas Electronics with respect to maximum ratings, operating power supply voltage range, heat dissipation characteristics, installation, etc. Renesas
Electronics disclaims any and all liability for any malfunctions, failure or accident arising out of the use of Renesas Electronics products outside of suchspecified ranges.
9. Although Renesas Electronics endeavors to improve the quality and reliability of Renesas Electronics products, semiconductor products have specificcharacteristics, such as the occurrence of failure at a certain rate and malfunctions under certain use conditions. Unless designated as a high reliability
product or a product for harsh environments in a Renesas Electronics data sheet or other Renesas Electronics document, Renesas Electronics
products are not subject to radiation resistance design. You are responsible for implementing safety measures to guard against the possibility of bodily
injury, injury or damage caused by fire, and/or danger to the public in the event of a failure or malfunction of Renesas Electronics products, such as
safety design for hardware and software, including but not limited to redundancy, fire control and malfunction prevention, appropriate treatment foraging degradation or any other appropriate measures. Because the evaluation of microcomputer software alone is very difficult and impractical, you areresponsible for evaluating the safety of the final products or systems manufactured by you.
10. Please contact a Renesas Electronics sales office for details as to environmental matters such as the environmental compatibility of each Renesas
Electronics product. You are responsible for carefully and sufficiently investigating applicable laws and regulations that regulate the inclusion or use ofcontrolled substances, including without limitation, the EU RoHS Directive, and using Renesas Electronics products in compliance with all theseapplicable laws and regulations. Renesas Electronics disclaims any and all liability for damages or losses occurring as a result of your noncompliancewith applicable laws and regulations.
11. Renesas Electronics products and technologies shall not be used for or incorporated into any products or systems whose manufacture, use, or sale isprohibited under any applicable domestic or foreign laws or regulations. You shall comply with any applicable export control laws and regulations
promulgated and administered by the governments of any countries asserting jurisdiction over the parties or transactions.
12. It is the responsibility of the buyer or distributor of Renesas Electronics products, or any other party who distributes, disposes of, or otherwise sells ortransfers the product to a third party, to notify such third party in advance of the contents and conditions set forth in this document.
13. This document shall not be reprinted, reproduced or duplicated in any form, in whole or in part, without prior written consent of Renesas Electronics.
14. Please contact a Renesas Electronics sales office if you have any questions regarding the information contained in this document or Renesas
Electronics products.
(Note1)(Note2)“Renesas Electronics” as used in this document means Renesas Electronics Corporation and also includes its directly or indirectly controlledsubsidiaries.
“Renesas Electronics product(s)” means any product developed or manufactured by or for Renesas Electronics.
(Rev.5.0-1 October 2020)

Corporate Headquarters

Contact information

TOYOSU FORESIA, 3-2-24 Toyosu,
Koto-ku, Tokyo 135-0061, JapanFor further information on a product, technology, the most up-to-dateversion of a document, or your nearest sales office, please visit:www.renesas.com/contact/.

www.renesas.com

Trademarks
Renesas and the Renesas logo are trademarks of Renesas Electronics
Corporation. All trademarks and registered trademarks are the propertyof their respective owners.

© 2024 Renesas Electronics Corporation. All rights reserved.