Skip to content

Move firmware management configuration to platform-specific OSAL types #51

@mzella-ll

Description

@mzella-ll

The firmware management configuration is currently defined in the generic osal/osal.h header, even though some of the values are platform-specific.

In particular, the firmware slot image size depends on the selected platform:

  • EFR32 Wi-SUN uses a larger slot image size.
  • Linux and FreeRTOS currently use a smaller slot image size.

This introduces platform-specific configuration logic into the generic OSAL header.

Current behavior

osal/osal.h defines firmware management configuration values globally:

#define CSMP_FWMGMT_ACTIVE_SLOTS      3
#if defined(OSAL_EFR32_WISUN)
#define CSMP_FWMGMT_SLOTIMG_SIZE      (512*1024)
#else
#define CSMP_FWMGMT_SLOTIMG_SIZE      (30*1024)
#endif
#define CSMP_FWMGMT_BLKMAP_CNT        (32)

As a result, the generic OSAL header contains platform-dependent conditional logic.

Proposed change

Move the firmware management configuration values from osal/osal.h to the platform-specific osal_platform_types.h headers.

The configuration should be defined separately for each supported OSAL backend:

  • osal/efr32_wisun/osal_platform_types.h
  • osal/freertos/osal_platform_types.h
  • osal/linux/osal_platform_types.h

This keeps platform-dependent firmware management parameters close to the corresponding platform abstraction.

Motivation

Firmware management slot configuration is platform-dependent and should therefore be defined in the platform-specific OSAL type headers instead of the generic OSAL interface.

This makes the generic osal.h cleaner and avoids platform-specific #if defined(...) logic in the common OSAL header.

Expected impact

The effective configuration values remain unchanged:

  • EFR32 Wi-SUN keeps CSMP_FWMGMT_SLOTIMG_SIZE at 512 * 1024.
  • Linux and FreeRTOS keep CSMP_FWMGMT_SLOTIMG_SIZE at 30 * 1024.
  • CSMP_FWMGMT_ACTIVE_SLOTS and CSMP_FWMGMT_BLKMAP_CNT remain unchanged.

This is a structural cleanup and should not change runtime behavior.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions