Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 43 additions & 0 deletions Vendors/Renesas/Readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# Renesas Wi-SUN FAN CSMP Agent Integration

<p align="left">
<img src="resources/renesas-logo.jpg" alt="Renesas logo" width="220">
</p>

## Summary

The integration targets Renesas Wi-SUN FAN products based on the Renesas RX MCU family.
Renesas provides Wi-SUN FAN-compliant Sub-GHz solutions for Wi-SUN FAN applications.
For the list of officially supported devices, stack versions, configuration options, and available features, please refer to the Renesas Wi-SUN FAN product and software documentation.

The purpose of this integration is to enable a Renesas Wi-SUN FAN node to communicate with Cisco Field Network Director (FND) using CSMP.
It provides platform-specific functionality required by the CSMP Agent Library, including:

- UDP/IPv6 communication over the Renesas Wi-SUN FAN protocol stack,
- access to platform, stack, and firmware information,
- mapping of Wi-SUN FAN network and firmware information to CSMP TLV objects,
- firmware update integration.

## Requirements

The following components are required to build and run the Renesas Wi-SUN FAN CSMP Agent integration:

- A running instance of Cisco Field Network Director (FND). For a development setup, please refer to the [CSMP Developer Tutorial](../../docs/CSMP%20Developer%20Tutorial%20-%200v11.pdf).

- At least two [Renesas Wi-SUN FAN Development Kits](https://www.renesas.com/en/design-resources/boards-kits/rtk0ee0013d10002bj).

- The latest Renesas [Wi-SUN FAN Protocol Stack](https://www.renesas.com/en/software-tool/sub-ghzwi-sun-protocol-stack).

## Renesas Wi-SUN FAN Stack

This Renesas CSMP integration layer is designed to be used in conjunction with the latest version of the [Renesas Wi-SUN FAN Protocol Stack](https://www.renesas.com/en/software-tool/sub-ghzwi-sun-protocol-stack).
Different versions may not work, so please make sure that this CSMP integration layer is used with the correct version of the Renesas Wi-SUN FAN Protocol Stack!

Further information about the CSMP usage with the Renesas Wi-SUN FAN protocol stack, APIs, configuration, sample applications, and supported platforms is provided in the user manual of the Renesas Wi-SUN FAN Protocol Stack and accompanying documentation, which are located in the release package of the Renesas Wi-SUN FAN Protocol Stack.
It also includes instructions for configuring and running a sample setup for CSMP with Renesas Wi-SUN FAN nodes.

Relevant Renesas resources:

- [Renesas Sub-GHz/Wi-SUN FAN Transceivers](https://www.renesas.com/en/products/wireless-connectivity/sub-ghz-Wi-SUN-transceivers)

- [Renesas Sub-GHz/Wi-SUN FAN Protocol Stack](https://www.renesas.com/en/software-tool/sub-ghzWi-SUN-protocol-stack)
Binary file added Vendors/Renesas/resources/renesas-logo.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions include/iana_pen.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ enum {
BC_HYDRO = 39480,
LANDIS_GYR = 42830,
TELLABS = 1397,
EXEGIN = 39682
//RENESAS
EXEGIN = 39682,
RENESAS = 63257
//ROHM
};

Expand Down
5 changes: 5 additions & 0 deletions osal/efr32_wisun/osal_platform_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,4 +56,9 @@ typedef int osal_sd_set_t;
#define GECKO_BTL_UPLOAD_SLOT_ID 0
#define GECKO_BTL_BACKUP_SLOT_ID 1

// Firmware Management Configuration
#define CSMP_FWMGMT_ACTIVE_SLOTS 3 // 0-RUN, 1-UPLOAD, 2-BACKUP
#define CSMP_FWMGMT_SLOTIMG_SIZE (512*1024) // 512 Kb
#define CSMP_FWMGMT_BLKMAP_CNT (32)

#endif
5 changes: 5 additions & 0 deletions osal/freertos/osal_platform_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,4 +54,9 @@ typedef fd_set osal_sd_set_t;
#define OSAL_AF_INET6 AF_INET6
#define OSAL_SOCK_DGRAM SOCK_DGRAM

// Firmware Management Configuration
#define CSMP_FWMGMT_ACTIVE_SLOTS 3 // 0-RUN, 1-UPLOAD, 2-BACKUP
#define CSMP_FWMGMT_SLOTIMG_SIZE (30*1024) // 30 Kb
#define CSMP_FWMGMT_BLKMAP_CNT (32)

#endif
5 changes: 4 additions & 1 deletion osal/linux/osal_platform_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,9 @@ typedef fd_set osal_sd_set_t;
#define OSAL_AF_INET6 AF_INET6
#define OSAL_SOCK_DGRAM SOCK_DGRAM


// Firmware Management Configuration
#define CSMP_FWMGMT_ACTIVE_SLOTS 3 // 0-RUN, 1-UPLOAD, 2-BACKUP
#define CSMP_FWMGMT_SLOTIMG_SIZE (30*1024) // 30 Kb
#define CSMP_FWMGMT_BLKMAP_CNT (32)

#endif
9 changes: 0 additions & 9 deletions osal/osal.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,6 @@
#define HWID_SIZE 32
#define BLOCK_SIZE 1024

// IMAGE SLOT INFO
#define CSMP_FWMGMT_ACTIVE_SLOTS 3 // 0-RUN, 1-UPLOAD, 2-BACKUP
#if defined(OSAL_EFR32_WISUN)
#define CSMP_FWMGMT_SLOTIMG_SIZE (512*1024) // 512 Kb
#else
#define CSMP_FWMGMT_SLOTIMG_SIZE (30*1024) // 30 Kb
#endif
#define CSMP_FWMGMT_BLKMAP_CNT (32)

#define CSMP_IMAGE_HDR_SIZE 256

#define REBOOT_DELAY 5
Expand Down
128 changes: 128 additions & 0 deletions osal/renesas_wisun/osal_platform_types.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
/*
* Copyright 2024 Cisco Systems, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

#ifndef __OSAL_PLATFORM_TYPES_H
#define __OSAL_PLATFORM_TYPES_H

#include <assert.h>
#include <stdlib.h>
#include "FreeRTOS.h"
#include "task.h"
#include "semphr.h"
#include "r_byte_swap.h"
#include "r_header_utils.h"
#if defined(__i386) || defined(__x86_64)

/* The Wi-SUN FAN simulator requires Unix sockets for basic functionality -> avoid redefinition */
#include <sys/socket.h>
#include <arpa/inet.h>
#include <netinet/in.h>
#else

/* Supported address families. */
#define AF_INET6 10 /* IP version 6 */

/* Type to represent a port. */
typedef uint16_t in_port_t;

typedef uint16_t sa_family_t;

typedef uint32_t socklen_t;

struct in6_addr
{
unsigned char s6_addr[16]; /* IPv6 address */
};

/* Structure describing a generic socket address. */
struct sockaddr
{
sa_family_t sa_family; /* Common data: address family and length. */
char sa_data[14]; /* Address data. */
};

struct sockaddr_in6
{
sa_family_t sin6_family; /* AF_INET6 */
in_port_t sin6_port; /* port number */
uint32_t sin6_flowinfo; /* IPv6 flow information */
struct in6_addr sin6_addr; /* IPv6 address */
uint32_t sin6_scope_id; /* Scope ID (new in 2.4) */
};

/* Structure for scatter/gather I/O. */
struct iovec
{
void* iov_base; /* Pointer to data. */
size_t iov_len; /* Length of data. */
};

/* Structure describing messages sent by
`sendmsg' and received by `recvmsg'. */
struct msghdr
{
void* msg_name; /* Address to send to/receive from. */
socklen_t msg_namelen; /* Length of address data. */

struct iovec* msg_iov; /* Vector of data to send/receive into. */
size_t msg_iovlen; /* Number of elements in the vector. */

void* msg_control; /* Ancillary data (eg BSD filedesc passing). */
size_t msg_controllen; /* Ancillary data buffer length.
!! The type should be socklen_t but the
definition of the kernel is incompatible
with this. */

int msg_flags; /* Flags on received message. */
};

#endif

typedef void (*osal_sighandler_t)(int);

typedef struct sockaddr_in6 osal_sockaddr_t;
typedef SemaphoreHandle_t osal_sem_t;
typedef int osal_sigset_t;
typedef socklen_t osal_socklen_t;
typedef TaskHandle_t osal_task_t;
typedef TaskFunction_t osal_task_fnc_t;
typedef int32_t osal_ssize_t;
typedef uint64_t osal_time_t;
typedef BaseType_t osal_basetype_t;
typedef int osal_socket_handle_t;
typedef int osal_sd_set_t;

#define OSAL_AF_INET6 AF_INET6
#define OSAL_SOCK_DGRAM 0

#define OSAL_ATTR_PACKED R_HEADER_UTILS_ATTR_PACKED

#define CSMP_MAX_SOCKETS 2

#if !defined(__i386) && !defined(__x86_64)
struct timeval
{
uint32_t tv_sec; /* Seconds. */
uint32_t tv_usec; /* Microseconds. */
};
#endif

struct timezone {
int tz_minuteswest; /* minutes west of Greenwich */
int tz_dsttime; /* type of DST correction */
};

#endif
57 changes: 57 additions & 0 deletions osal/renesas_wisun/osal_renesas_config.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
/******************************************************************************
* DISCLAIMER
* This software is supplied by Renesas Electronics Corporation and is only
* intended for use with Renesas products. No other uses are authorized. This
* software is owned by Renesas Electronics Corporation and is protected under
* all applicable laws, including copyright laws.
* THIS SOFTWARE IS PROVIDED "AS IS" AND RENESAS MAKES NO WARRANTIES REGARDING
* THIS SOFTWARE, WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING BUT NOT
* LIMITED TO WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE
* AND NON-INFRINGEMENT. ALL SUCH WARRANTIES ARE EXPRESSLY DISCLAIMED.
* TO THE MAXIMUM EXTENT PERMITTED NOT PROHIBITED BY LAW, NEITHER RENESAS
* ELECTRONICS CORPORATION NOR ANY OF ITS AFFILIATED COMPANIES SHALL BE LIABLE
* FOR ANY DIRECT, INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES FOR
* ANY REASON RELATED TO THIS SOFTWARE, EVEN IF RENESAS OR ITS AFFILIATES HAVE
* BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
* Renesas reserves the right, without notice, to make changes to this
* software and to discontinue the availability of this software. By using this
* software, you agree to the additional terms and conditions found by
* accessing the following link:
* http://www.renesas.com/disclaimer
*
* Copyright (C) 2025 Renesas Electronics Corporation. All rights reserved.
*****************************************************************************/

/**
* @file osal_renesas_config.h
* @brief Configuration of the CSMP module running within the Renesas Wi-SUN FAN sample application.
*/

#ifndef OSAL_RENESAS_CONFIG_H
#define OSAL_RENESAS_CONFIG_H

/** the major version of the CSMP module */
#define R_CSMP_MAJOR_VERSION "0"

/** the major version of the CSMP module */
#define R_CSMP_MINOR_VERSION "1"

/** the build version of the CSMP module */
#define R_CSMP_BUILD_VERSION "0"

/** string to identify this version of the CSMP module (in format "major.minor.build") */
#define R_CSMP_VERSION_STRING R_CSMP_MAJOR_VERSION "." R_CSMP_MINOR_VERSION "." R_CSMP_BUILD_VERSION

/** string to identify the running firmware */
#define R_CSMP_FILE_NAME "Wi-SUN-FAN-SampleApp"

/** string to identify this hardware platform as used by FND */
#define R_CSMP_HARDWARE_ID "renesastest"

/** max number of ip addresses */
#define R_TLV_IPADDRESS_MAX_NUM 3

/** max number of routes */
#define R_TLV_ROUTES_MAX_NUM 2

#endif /* OSAL_RENESAS_CONFIG_H */
Loading