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.
The firmware management configuration is currently defined in the generic
osal/osal.hheader, even though some of the values are platform-specific.In particular, the firmware slot image size depends on the selected platform:
This introduces platform-specific configuration logic into the generic OSAL header.
Current behavior
osal/osal.hdefines firmware management configuration values globally:As a result, the generic OSAL header contains platform-dependent conditional logic.
Proposed change
Move the firmware management configuration values from
osal/osal.hto the platform-specificosal_platform_types.hheaders.The configuration should be defined separately for each supported OSAL backend:
osal/efr32_wisun/osal_platform_types.hosal/freertos/osal_platform_types.hosal/linux/osal_platform_types.hThis 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.hcleaner and avoids platform-specific#if defined(...)logic in the common OSAL header.Expected impact
The effective configuration values remain unchanged:
CSMP_FWMGMT_SLOTIMG_SIZEat512 * 1024.CSMP_FWMGMT_SLOTIMG_SIZEat30 * 1024.CSMP_FWMGMT_ACTIVE_SLOTSandCSMP_FWMGMT_BLKMAP_CNTremain unchanged.This is a structural cleanup and should not change runtime behavior.