SYSTEM - System Utils#


System API.

Example#

{
  // Get chip revision information
  sl_hal_system_chip_revision_t rev;
  sl_hal_system_get_chip_revision(&rev);

  // Print chip revision info
  printf("Chip revision: %d.%d, Part number: 0x%04X, Family: 0x%04X\n",
         rev.major, rev.minor, rev.part_number, rev.family);

  // Get unique device identifier
  uint64_t unique_id = sl_hal_system_get_unique();

  // Get production revision
  uint8_t prod_rev = sl_hal_system_get_prod_rev();

  // Get memory sizes
  uint16_t flash_size_kb = sl_hal_system_get_flash_size();
  uint16_t sram_size_kb = sl_hal_system_get_sram_size();
  uint32_t sram_base = sl_hal_system_get_sram_base_address();

  // Get security capability
  sl_hal_system_security_capability_t sec_cap = sl_hal_system_get_security_capability();

  // The system must be initialized at the beginning of main()
  sl_hal_system_init();
}

This module contains functions to read information such as RAM and Flash size, device unique ID, chip revision, family, and part number from DEVINFO and SCB blocks. Functions to configure and read status from FPU are available for compatible devices.

Modules#

sl_hal_system_chip_revision_t

sl_hal_system_devinfo_adc_cal_data_t

sl_hal_system_devinfo_adc_offset_t

sl_hal_system_devinfo_adc_t

sl_hal_system_devinfo_temperature_t

sl_hal_system_features_t

Enumerations#

enum
SL_SYSTEM_SECURITY_CAPABILITY_UNKNOWN
SL_SYSTEM_SECURITY_CAPABILITY_NA
SL_SYSTEM_SECURITY_CAPABILITY_BASIC
SL_SYSTEM_SECURITY_CAPABILITY_ROT
SL_SYSTEM_SECURITY_CAPABILITY_SE
SL_SYSTEM_SECURITY_CAPABILITY_VAULT
}

Family security capability.

enum
SL_SYSTEM_FPU_ACCESS_DENIED = (0x0 << 20)
SL_SYSTEM_FPU_ACCESS_PRIVILEGED_ONLY = (0x5 << 20)
SL_SYSTEM_FPU_ACCESS_RESERVED = (0xA << 20)
SL_SYSTEM_FPU_ACCESS_FULL = (0xF << 20)
}

Floating point co-processor access modes.

enum
SL_HAL_SYSTEM_HFRCODPLL_FREQ_1M0Hz = 1000000U
SL_HAL_SYSTEM_HFRCODPLL_FREQ_2M0Hz = 2000000U
SL_HAL_SYSTEM_HFRCODPLL_FREQ_4M0Hz = 4000000U
SL_HAL_SYSTEM_HFRCODPLL_FREQ_7M0Hz = 7000000U
SL_HAL_SYSTEM_HFRCODPLL_FREQ_13M0Hz = 13000000U
SL_HAL_SYSTEM_HFRCODPLL_FREQ_16M0Hz = 16000000U
SL_HAL_SYSTEM_HFRCODPLL_FREQ_19M0Hz = 19000000U
SL_HAL_SYSTEM_HFRCODPLL_FREQ_26M0Hz = 26000000U
SL_HAL_SYSTEM_HFRCODPLL_FREQ_32M0Hz = 32000000U
SL_HAL_SYSTEM_HFRCODPLL_FREQ_38M0Hz = 38000000U
SL_HAL_SYSTEM_HFRCODPLL_FREQ_48M0Hz = 48000000U
SL_HAL_SYSTEM_HFRCODPLL_FREQ_56M0Hz = 56000000U
SL_HAL_SYSTEM_HFRCODPLL_FREQ_64M0Hz = 64000000U
SL_HAL_SYSTEM_HFRCODPLL_FREQ_80M0Hz = 80000000U
SL_HAL_SYSTEM_HFRCODPLL_FREQ_USER_DEFINED = 0
}

HFRCODPLL frequency bands.

enum
SL_HAL_SYSTEM_HFRCOEM23_FREQ_1M0Hz = 1000000U
SL_HAL_SYSTEM_HFRCOEM23_FREQ_2M0Hz = 2000000U
SL_HAL_SYSTEM_HFRCOEM23_FREQ_4M0Hz = 4000000U
SL_HAL_SYSTEM_HFRCOEM23_FREQ_7M0Hz = 7000000U
SL_HAL_SYSTEM_HFRCOEM23_FREQ_13M0Hz = 13000000U
SL_HAL_SYSTEM_HFRCOEM23_FREQ_16M0Hz = 16000000U
SL_HAL_SYSTEM_HFRCOEM23_FREQ_19M0Hz = 19000000U
SL_HAL_SYSTEM_HFRCOEM23_FREQ_26M0Hz = 26000000U
SL_HAL_SYSTEM_HFRCOEM23_FREQ_32M0Hz = 32000000U
SL_HAL_SYSTEM_HFRCOEM23_FREQ_40M0Hz = 40000000U
SL_HAL_SYSTEM_HFRCOEM23_FREQ_USER_DEFINED = 0
}

HFRCOEM23 frequency bands.

enum
SL_HAL_SYSTEM_PART_FAMILY_MIGHTY_26 = DEVINFO_PART_FAMILY_MG | (26 << _DEVINFO_PART_FAMILYNUM_SHIFT)
SL_HAL_SYSTEM_PART_FAMILY_BLUE_26 = DEVINFO_PART_FAMILY_BG | (26 << _DEVINFO_PART_FAMILYNUM_SHIFT)
SL_HAL_SYSTEM_PART_FAMILY_EFM32_PEARL_26 = DEVINFO_PART_FAMILY_PG | (26 << _DEVINFO_PART_FAMILYNUM_SHIFT)
SL_HAL_SYSTEM_PART_FAMILY_UNKNOWN = 0xFF
}

Family identifiers.

Functions#

void

Chip initialization routine for revision errata workarounds.

void
sl_hal_system_get_chip_revision(sl_hal_system_chip_revision_t *rev)
uint8_t

Get DEVINFO revision.

uint32_t

Get the default factory calibration value for HFRCO oscillator.

uint32_t

Get the speed factory calibration value for HFRCO oscillator.

uint32_t

Get the HFRCO calibration based on the frequency band.

uint32_t

Get a factory calibration value for HFRCOEM23 oscillator.

uint32_t

Get a factory calibration value for HFXOCAL.

uint64_t

Get the unique number for this device.

uint8_t

Get the production revision for this part.

uint32_t

Get the SRAM Base Address.

uint16_t

Get the SRAM size (in KB).

uint16_t

Get the flash size (in KB).

uint32_t

Get the flash page size in bytes.

uint16_t

Get the MCU part number.

void
sl_hal_system_get_temperature_info(sl_hal_system_devinfo_temperature_t *info)

Get the temperature information.

void
sl_hal_system_fpu_set_access_mode(sl_hal_system_fpu_access_t access_mode)

Set floating point co-processor (FPU) access mode.

void
sl_hal_system_get_adc_calibration_info(sl_hal_system_devinfo_adc_t *info)

Get the ADC calibration info.

bool

Check if a debugger is connected (and debug session activated).

Get the MCU family identifier.

Macros#

#define
SL_HAL_SYSTEM_HFRCODPLL_MIN SL_HAL_SYSTEM_HFRCODPLL_FREQ_1M0Hz

HFRCODPLL minimum frequency.

#define
SL_HAL_SYSTEM_HFRCODPLL_MAX SL_HAL_SYSTEM_HFRCODPLL_FREQ_80M0Hz

HFRCODPLL maximum frequency.

#define
SL_HAL_SYSTEM_HFRCOEM23_MIN SL_HAL_SYSTEM_HFRCOEM23_FREQ_1M0Hz

HFRCOEM23 minimum frequency.

#define
SL_HAL_SYSTEM_HFRCOEM23_MAX SL_HAL_SYSTEM_HFRCOEM23_FREQ_40M0Hz

HFRCOEM23 maximum frequency.

Enumeration Documentation#

sl_hal_system_security_capability_t#

sl_hal_system_security_capability_t

Family security capability.

Enumerator
SL_SYSTEM_SECURITY_CAPABILITY_UNKNOWN

Unknown security capability.

SL_SYSTEM_SECURITY_CAPABILITY_NA

Security capability not applicable.

SL_SYSTEM_SECURITY_CAPABILITY_BASIC

Basic security capability.

SL_SYSTEM_SECURITY_CAPABILITY_ROT

Root of Trust security capability.

SL_SYSTEM_SECURITY_CAPABILITY_SE

Secure Element security capability.

SL_SYSTEM_SECURITY_CAPABILITY_VAULT

Secure Vault security capability.


sl_hal_system_fpu_access_t#

sl_hal_system_fpu_access_t

Floating point co-processor access modes.

Enumerator
SL_SYSTEM_FPU_ACCESS_DENIED

Access denied, any attempted access generates a NOCP UsageFault.

SL_SYSTEM_FPU_ACCESS_PRIVILEGED_ONLY

Privileged access only, an unprivileged access generates a NOCP UsageFault.

SL_SYSTEM_FPU_ACCESS_RESERVED

Reserved.

SL_SYSTEM_FPU_ACCESS_FULL

Full access.


sl_hal_system_hfrcodpll_freq_t#

sl_hal_system_hfrcodpll_freq_t

HFRCODPLL frequency bands.

Enumerator
SL_HAL_SYSTEM_HFRCODPLL_FREQ_1M0Hz

1MHz RC band.

SL_HAL_SYSTEM_HFRCODPLL_FREQ_2M0Hz

2MHz RC band.

SL_HAL_SYSTEM_HFRCODPLL_FREQ_4M0Hz

4MHz RC band.

SL_HAL_SYSTEM_HFRCODPLL_FREQ_7M0Hz

7MHz RC band.

SL_HAL_SYSTEM_HFRCODPLL_FREQ_13M0Hz

13MHz RC band.

SL_HAL_SYSTEM_HFRCODPLL_FREQ_16M0Hz

16MHz RC band.

SL_HAL_SYSTEM_HFRCODPLL_FREQ_19M0Hz

19MHz RC band.

SL_HAL_SYSTEM_HFRCODPLL_FREQ_26M0Hz

26MHz RC band.

SL_HAL_SYSTEM_HFRCODPLL_FREQ_32M0Hz

32MHz RC band.

SL_HAL_SYSTEM_HFRCODPLL_FREQ_38M0Hz

38MHz RC band.

SL_HAL_SYSTEM_HFRCODPLL_FREQ_48M0Hz

48MHz RC band.

SL_HAL_SYSTEM_HFRCODPLL_FREQ_56M0Hz

56MHz RC band.

SL_HAL_SYSTEM_HFRCODPLL_FREQ_64M0Hz

64MHz RC band.

SL_HAL_SYSTEM_HFRCODPLL_FREQ_80M0Hz

80MHz RC band.

SL_HAL_SYSTEM_HFRCODPLL_FREQ_USER_DEFINED

sl_hal_system_hfrcoem23_freq_t#

sl_hal_system_hfrcoem23_freq_t

HFRCOEM23 frequency bands.

Enumerator
SL_HAL_SYSTEM_HFRCOEM23_FREQ_1M0Hz

1MHz RC band.

SL_HAL_SYSTEM_HFRCOEM23_FREQ_2M0Hz

2MHz RC band.

SL_HAL_SYSTEM_HFRCOEM23_FREQ_4M0Hz

4MHz RC band.

SL_HAL_SYSTEM_HFRCOEM23_FREQ_7M0Hz

7MHz RC band.

SL_HAL_SYSTEM_HFRCOEM23_FREQ_13M0Hz

13MHz RC band.

SL_HAL_SYSTEM_HFRCOEM23_FREQ_16M0Hz

16MHz RC band.

SL_HAL_SYSTEM_HFRCOEM23_FREQ_19M0Hz

19MHz RC band.

SL_HAL_SYSTEM_HFRCOEM23_FREQ_26M0Hz

26MHz RC band.

SL_HAL_SYSTEM_HFRCOEM23_FREQ_32M0Hz

32MHz RC band.

SL_HAL_SYSTEM_HFRCOEM23_FREQ_40M0Hz

40MHz RC band.

SL_HAL_SYSTEM_HFRCOEM23_FREQ_USER_DEFINED

sl_hal_system_part_family_t#

sl_hal_system_part_family_t

Family identifiers.

Enumerator
SL_HAL_SYSTEM_PART_FAMILY_MIGHTY_26

EFR32 Mighty Gecko Series 2 Config 6 Value Device Family.

SL_HAL_SYSTEM_PART_FAMILY_BLUE_26

EFR32 Blue Gecko Series 2 Config 6 Value Device Family.

SL_HAL_SYSTEM_PART_FAMILY_EFM32_PEARL_26

EFM32 Pearl Gecko Series 2 Config 6 Value Device Family.

SL_HAL_SYSTEM_PART_FAMILY_UNKNOWN

Unknown Device Family. Family ID is missing on unprogrammed parts.


Variable Documentation#

SL_HAL_SYSTEM_DEVINFO_ADC_RESET_VALUES#

const sl_hal_system_devinfo_adc_t SL_HAL_SYSTEM_DEVINFO_ADC_RESET_VALUES

DEVINFO ADC reset values.


SL_HAL_SYSTEM_DEVINFO_TEMPERATURE_RESET_VALUES#

const sl_hal_system_devinfo_temperature_t SL_HAL_SYSTEM_DEVINFO_TEMPERATURE_RESET_VALUES

DEVINFO temperature reset values.


Function Documentation#

sl_hal_system_init#

void sl_hal_system_init (void )

Chip initialization routine for revision errata workarounds.

Parameters
TypeDirectionArgument NameDescription
voidN/A

Note

  • This function must be called immediately in main().

This initialization function configures the device to a state as similar to later revisions as possible to improve software compatibility with newer parts. See the device-specific errata for details.


sl_hal_system_get_chip_revision#

void sl_hal_system_get_chip_revision (sl_hal_system_chip_revision_t * rev)
Parameters
TypeDirectionArgument NameDescription
sl_hal_system_chip_revision_t *N/Arev

sl_hal_system_get_devinfo_rev#

uint8_t sl_hal_system_get_devinfo_rev (void )

Get DEVINFO revision.

Parameters
TypeDirectionArgument NameDescription
voidN/A

Returns

  • Revision of the DEVINFO contents.


sl_hal_system_get_hfrco_default_calibration#

uint32_t sl_hal_system_get_hfrco_default_calibration (void )

Get the default factory calibration value for HFRCO oscillator.

Parameters
TypeDirectionArgument NameDescription
voidN/A

Returns

  • HFRCOCAL default value.


sl_hal_system_get_hfrco_speed_calibration#

uint32_t sl_hal_system_get_hfrco_speed_calibration (void )

Get the speed factory calibration value for HFRCO oscillator.

Parameters
TypeDirectionArgument NameDescription
voidN/A

Returns

  • HFRCOCAL speed value.


sl_hal_system_get_hfrcodpll_band_calibration#

uint32_t sl_hal_system_get_hfrcodpll_band_calibration (uint32_t frequency)

Get the HFRCO calibration based on the frequency band.

Parameters
TypeDirectionArgument NameDescription
uint32_t[in]frequency

Frequency for which to retrieve calibration.

Returns

  • HFRCOCAL value for the given band.

Note

  • Those calibrations are only valid for the HFRCO oscillator when used with the DPLL module.


sl_hal_system_get_hfrcoem23_calibration#

uint32_t sl_hal_system_get_hfrcoem23_calibration (uint32_t frequency)

Get a factory calibration value for HFRCOEM23 oscillator.

Parameters
TypeDirectionArgument NameDescription
uint32_t[in]frequency

HFRCOEM23 frequency for which to retrieve calibration.

Returns

  • HFRCOEM23 calibration value.


sl_hal_system_get_hfxocal#

uint32_t sl_hal_system_get_hfxocal (void )

Get a factory calibration value for HFXOCAL.

Parameters
TypeDirectionArgument NameDescription
voidN/A

Returns

  • HFXOCAL value.


sl_hal_system_get_security_capability#

sl_hal_system_security_capability_t sl_hal_system_get_security_capability (void )

Get family security capability.

Parameters
TypeDirectionArgument NameDescription
voidN/A

Note

  • This function retrieves the family security capability based on the device number.

Returns

  • Security capability of MCU.


sl_hal_system_get_unique#

uint64_t sl_hal_system_get_unique (void )

Get the unique number for this device.

Parameters
TypeDirectionArgument NameDescription
voidN/A

Returns

  • Unique number for this device.


sl_hal_system_get_prod_rev#

uint8_t sl_hal_system_get_prod_rev (void )

Get the production revision for this part.

Parameters
TypeDirectionArgument NameDescription
voidN/A

Returns

  • Production revision for this part.


sl_hal_system_get_sram_base_address#

uint32_t sl_hal_system_get_sram_base_address (void )

Get the SRAM Base Address.

Parameters
TypeDirectionArgument NameDescription
voidN/A

Returns

  • Base address SRAM (32-bit unsigned integer).


sl_hal_system_get_sram_size#

uint16_t sl_hal_system_get_sram_size (void )

Get the SRAM size (in KB).

Parameters
TypeDirectionArgument NameDescription
voidN/A

Note

  • This function retrieves SRAM size by reading the chip device info structure. If your binary is made for one specific device only, use SRAM_SIZE instead.

Returns

  • Size of internal SRAM (in KB).


sl_hal_system_get_flash_size#

uint16_t sl_hal_system_get_flash_size (void )

Get the flash size (in KB).

Parameters
TypeDirectionArgument NameDescription
voidN/A

Note

  • This function retrieves flash size by reading the chip device info structure or DEVINFO->EMBMSIZE (embedded flash. not the case for S3 for now) or user config (external flash).

Returns

  • Size of flash (in KB).


sl_hal_system_get_flash_page_size#

uint32_t sl_hal_system_get_flash_page_size (void )

Get the flash page size in bytes.

Parameters
TypeDirectionArgument NameDescription
voidN/A

Note

  • This function retrieves flash page size by reading the SE or user config (external flash)

Returns

  • Page size of flash in bytes.


sl_hal_system_get_part_number#

uint16_t sl_hal_system_get_part_number (void )

Get the MCU part number.

Parameters
TypeDirectionArgument NameDescription
voidN/A

Returns

  • The part number of MCU.


sl_hal_system_get_part_features#

sl_hal_system_features_t sl_hal_system_get_part_features (void )

Get the SoC or MCU features.

Parameters
TypeDirectionArgument NameDescription
voidN/A

Returns

  • The features of the current SoC or MCU.

Note

  • The features can be decoded by referring to the SoC or MCU datasheet.


sl_hal_system_get_temperature_info#

void sl_hal_system_get_temperature_info (sl_hal_system_devinfo_temperature_t * info)

Get the temperature information.

Parameters
TypeDirectionArgument NameDescription
sl_hal_system_devinfo_temperature_t *[out]info

Pointer to variable where to store the temperature info.


sl_hal_system_fpu_set_access_mode#

void sl_hal_system_fpu_set_access_mode (sl_hal_system_fpu_access_t access_mode)

Set floating point co-processor (FPU) access mode.

Parameters
TypeDirectionArgument NameDescription
sl_hal_system_fpu_access_t[in]access_mode

Floating point co-processor access mode.


sl_hal_system_get_adc_calibration_info#

void sl_hal_system_get_adc_calibration_info (sl_hal_system_devinfo_adc_t * info)

Get the ADC calibration info.

Parameters
TypeDirectionArgument NameDescription
sl_hal_system_devinfo_adc_t *[out]info

Pointer to variable where to store the adc calibration info.


sl_hal_system_is_debugger_connected#

bool sl_hal_system_is_debugger_connected (void )

Check if a debugger is connected (and debug session activated).

Parameters
TypeDirectionArgument NameDescription
voidN/A

Used to make run-time decisions depending on whether or not a debug session has been active since last reset, i.e., using a debug probe or similar. In some cases, special handling is required in that scenario.

Returns

  • True if a debug session is active since last reset, otherwise false.


sl_hal_system_get_family#

sl_hal_system_part_family_t sl_hal_system_get_family (void )

Get the MCU family identifier.

Parameters
TypeDirectionArgument NameDescription
voidN/A

Returns

  • Family identifier of MCU.

Note

  • This function retrieves family ID by reading the chip's device info structure in flash memory. Users can retrieve family ID directly by reading DEVINFO->PART item and decode with mask and shift #defines defined in <part_family>_devinfo.h (refer to code below for details).