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_devinfo_adc_cal_data_t
sl_hal_system_devinfo_adc_offset_t
sl_hal_system_devinfo_temperature_t
Enumerations#
Family security capability.
Floating point co-processor access modes.
HFRCODPLL frequency bands.
HFRCOEM23 frequency bands.
Family identifiers.
Functions#
Chip initialization routine for revision errata workarounds.
Get DEVINFO revision.
Get the default factory calibration value for HFRCO oscillator.
Get the speed factory calibration value for HFRCO oscillator.
Get the HFRCO calibration based on the frequency band.
Get a factory calibration value for HFRCOEM23 oscillator.
Get a factory calibration value for HFXOCAL.
Get family security capability.
Get the unique number for this device.
Get the production revision for this part.
Get the SRAM Base Address.
Get the SRAM size (in KB).
Get the flash size (in KB).
Get the flash page size in bytes.
Get the MCU part number.
Get the SoC or MCU features.
Get the temperature information.
Set floating point co-processor (FPU) access mode.
Get the ADC calibration info.
Check if a debugger is connected (and debug session activated).
Get the MCU family identifier.
Macros#
HFRCODPLL minimum frequency.
HFRCODPLL maximum frequency.
HFRCOEM23 minimum frequency.
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_21 | EFR32 Mighty Gecko Series 2 Config 1 Value Device Family. |
SL_HAL_SYSTEM_PART_FAMILY_FLEX_21 | EFR32 Flex Gecko Series 2 Config 1 Value Device Family. |
SL_HAL_SYSTEM_PART_FAMILY_BLUE_21 | EFR32 Blue Gecko Series 2 Config 1 Value Device Family. |
SL_HAL_SYSTEM_PART_FAMILY_MIGHTY_RCP_21 | EFR32 Mighty RCP Series 2 Config 1 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.
Type | Direction | Argument Name | Description |
---|---|---|---|
void | N/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)
Type | Direction | Argument Name | Description |
---|---|---|---|
sl_hal_system_chip_revision_t * | N/A | rev |
sl_hal_system_get_devinfo_rev#
uint8_t sl_hal_system_get_devinfo_rev (void )
Get DEVINFO revision.
Type | Direction | Argument Name | Description |
---|---|---|---|
void | N/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.
Type | Direction | Argument Name | Description |
---|---|---|---|
void | N/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.
Type | Direction | Argument Name | Description |
---|---|---|---|
void | N/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.
Type | Direction | Argument Name | Description |
---|---|---|---|
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.
Type | Direction | Argument Name | Description |
---|---|---|---|
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.
Type | Direction | Argument Name | Description |
---|---|---|---|
void | N/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.
Type | Direction | Argument Name | Description |
---|---|---|---|
void | N/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.
Type | Direction | Argument Name | Description |
---|---|---|---|
void | N/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.
Type | Direction | Argument Name | Description |
---|---|---|---|
void | N/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.
Type | Direction | Argument Name | Description |
---|---|---|---|
void | N/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).
Type | Direction | Argument Name | Description |
---|---|---|---|
void | N/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).
Type | Direction | Argument Name | Description |
---|---|---|---|
void | N/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.
Type | Direction | Argument Name | Description |
---|---|---|---|
void | N/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.
Type | Direction | Argument Name | Description |
---|---|---|---|
void | N/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.
Type | Direction | Argument Name | Description |
---|---|---|---|
void | N/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.
Type | Direction | Argument Name | Description |
---|---|---|---|
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.
Type | Direction | Argument Name | Description |
---|---|---|---|
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.
Type | Direction | Argument Name | Description |
---|---|---|---|
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).
Type | Direction | Argument Name | Description |
---|---|---|---|
void | N/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.
Type | Direction | Argument Name | Description |
---|---|---|---|
void | N/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).