Skip to content

Add Renesas platform integration#59

Open
mzella-ll wants to merge 1 commit into
CiscoDevNet:mainfrom
mzella-ll:feature/add-renesas-platform
Open

Add Renesas platform integration#59
mzella-ll wants to merge 1 commit into
CiscoDevNet:mainfrom
mzella-ll:feature/add-renesas-platform

Conversation

@mzella-ll

Copy link
Copy Markdown
Collaborator

Summary

This PR adds the Renesas Wi-SUN platform integration for OpenCSMP.

It introduces the Renesas-specific OSAL implementation, platform configuration headers, wrapper interface, vendor documentation/resources, and sample Renesas TLVs.

This branch includes the following related changes:

  • Fix Renesas CC-RX compiler warnings
  • Add Renesas IANA Private Enterprise Number
  • Move firmware management configuration to platform-specific OSAL types

Changes

Renesas platform integration

  • Add Renesas vendor documentation:
    • Vendors/Renesas/Readme.md
  • Add Renesas vendor resource:
    • Vendors/Renesas/resources/renesas-logo.jpg
  • Add Renesas Wi-SUN OSAL platform files:
    • osal/renesas_wisun/osal_platform_types.h
    • osal/renesas_wisun/osal_renesas_config.h
    • osal/renesas_wisun/osal_renesas_wisun.c
    • osal/renesas_wisun/osal_renesas_wrapper.h
  • Add Renesas-specific TLV sample:
    • sample/tlvs/renesas_tlvs.c

Included prerequisite changes

  • Add the Renesas IANA Private Enterprise Number:
    • RENESAS = 63257
  • Move firmware management configuration from the generic osal/osal.h header to platform-specific osal_platform_types.h headers
  • Fix compiler warnings reported by the Renesas CC-RX compiler:
    • enum/integer type mixing
    • signedness-changing integer conversions
    • missing default handling in a switch statement

Motivation

The Renesas Wi-SUN platform requires a dedicated OSAL integration layer and platform-specific configuration to use OpenCSMP in a Renesas-based environment.

This PR adds the required platform abstraction files and keeps Renesas-specific configuration and wrapper code separated from the generic OSAL interface.

The included prerequisite changes are needed to make the codebase suitable for the Renesas toolchain and platform structure.

Related issues

Fixes #44
Fixes #51

- Add the Renesas-specific OSAL platform implementation,
  configuration headers and sample TLVs
- Move firmware management config to platform types
- Add Renesas IANA Private Enterprise Number
- Fix Renesas CC-RX compiler warnings
@mzella-ll mzella-ll force-pushed the feature/add-renesas-platform branch from 2923af7 to 752ba23 Compare July 6, 2026 02:39
@manojnacsl manojnacsl requested a review from woobagooba July 10, 2026 07:35
#define GECKO_BTL_UPLOAD_SLOT_ID 0
#define GECKO_BTL_BACKUP_SLOT_ID 1

// Firmware Management Configuration

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#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)

osal_platform_types.h was originally added to hold only platform specific data types.
Generic MACROS and other declarations will be in osal.h - unless there is a need for moving these here?

Is the intent here to use different slot numbers, slot size and blk count? We need to consider the CSMP/TLV and FND expectations/dependencies on active slots and blk count. Slot size could be different across platforms though which could be sourced from platform config.

return OSAL_SUCCESS;
}

osal_basetype_t osal_read_groups(uint32_t *groups, uint8_t num_groups)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

osal_read_groups and osal_write_groups APIs are still dummy funcs returning SUCCESS always.

Isn't there going to be a platform specific implementation which is the intent of this change for these APIs as discussed in previous review discussion?


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

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Refer previous comments on this change.
Slot size could be different across platforms but the slot count and block count has dependency on CSMP/TLV and FND.


/*
* The following functions are not used in any CSMP platform independent code.
* For the Renesas platform, the functionalities are already provided by the dedicated

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please capture the Fw upgrade APIs that are directly called for Renesas in the comment.

return OSAL_SUCCESS;
}

int R_CSMP_Start(const r_ipv6addr_t* serverAddr, const uint8_t* localEui64, uint32_t regImin, uint32_t regImax)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we rename "R_CSMP" to anything more readable? Applies to all other such instances...

Comment thread osal/osal.h
#define HWID_SIZE 32
#define BLOCK_SIZE 1024

// IMAGE SLOT INFO

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The removal of these Fw upgrade slots to be reviewed considering the previous comments on this change, we'll discuss this in review discussion.

if(xfer_req) {
// Firmware status check
if (!xfer_req->has_status || xfer_req->status != FWHDR_STATUS_DOWNLOAD) {
if (!xfer_req->has_status || xfer_req->status != (uint32_t) FWHDR_STATUS_DOWNLOAD) {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you notice any specific issue without this explicit typecast ?

static uint32_t m_GroupIds[CSMP_GROUP_NUM_TYPES] = {0};
static bool m_bLastMatchValid;

int initGroups()

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As suggested previously, good to group all init functions in one initialization API/func in the sample app.

Comment thread src/csmpagent/csmpagent.h
*
* @return int 0 is success
*/
int initGroups();

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As suggested previously, good to group all init functions in one initialization API/func in the sample app.

(message->n_unknown_fields++);
ufield->tag = scanned_member->tag;
ufield->wire_type = scanned_member->wire_type;
ufield->wire_type = (ProtobufCWireType) scanned_member->wire_type;

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please elaborate on this change and the issue noted due to this.

@manojnacsl

Copy link
Copy Markdown
Collaborator

We'll discuss and resolve the review comments in the scheduled review discussion. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

renesas Renesas Electronics Corporation | renesas.com

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Move firmware management configuration to platform-specific OSAL types Fix Renesas CC-RX compiler warnings

2 participants