Documentation

Mistake on this page? Email us
Macros
pal_configuration.h File Reference

PAL Configuration. This file contains PAL configuration information. More...

#include "limits.h"
#include "sotp_fs.h"

Go to the source code of this file.

Macros

#define PAL_NET_TCP_AND_TLS_SUPPORT   true
 Add PAL support for TCP. More...
 
#define PAL_NET_DNS_SUPPORT   true
 Add PAL support for DNS lookup. More...
 
#define PAL_DNS_API_VERSION   0
 syncronous DNS API More...
 
#define PAL_NET_SERVER_SOCKET_API   true
 Add PAL support for server socket. More...
 
#define PAL_SUPPORT_IP_V4   true
 support IPV4 as default More...
 
#define PAL_SUPPORT_IP_V6   true
 support IPV6 as default More...
 
#define PAL_NET_DNS_ANY   0
 if PAL_NET_DNS_IP_SUPPORT is set to PAL_NET_DNS_ANY pal_getAddressInfo will return the first available IPV4 or IPV6 address More...
 
#define PAL_NET_DNS_IPV4_ONLY   2
 if PAL_NET_DNS_IP_SUPPORT is set to PAL_NET_DNS_IPV4_ONLY pal_getAddressInfo will return the first available IPV4 address More...
 
#define PAL_NET_DNS_IPV6_ONLY   4
 if PAL_NET_DNS_IP_SUPPORT is set to PAL_NET_DNS_IPV6_ONLY pal_getAddressInfo will return the first available IPV6 address More...
 
#define PAL_NET_DNS_IP_SUPPORT   0
 sets the type of IP addresses returned by pal_getAddressInfo More...
 
#define PAL_MAX_SUPORTED_NET_INTERFACES   1
 The maximum number of interfaces that can be supported at a time. More...
 
#define PAL_NET_ASYNC_DNS_THREAD_STACK_SIZE   (1024 * 2)
 Stack size for thread created when calling pal_getAddressInfoAsync. More...
 
#define PAL_CLEANUP_ON_INIT_FAILURE   true
 If you want PAL to not perform a rollback/cleanup when main PAL init fails, please set this flag to false More...
 
#define PAL_THREAD_SAFETY   1
 Determines if PAL modules are thread safe. More...
 
#define PAL_RTOS_THREAD_CLEANUP_TIMER_MILISEC   200
 
#define PAL_INITIAL_RANDOM_SIZE   48
 Determines the size of the initial random buffer (in bytes) held by PAL for random the algorithm. More...
 
#define PAL_RTOS_WAIT_FOREVER   UINT_MAX
 
#define PAL_MAX_ALLOWED_CIPHER_SUITES   1
 The maximum number of supported cipher suites. More...
 
#define PAL_DTLS_PEER_MIN_TIMEOUT   1000
 This value is in milliseconds. 1000 = 1 second. More...
 
#define PAL_TLS_DEBUG_THRESHOLD   5
 The debug threshold for TLS API. More...
 
#define PAL_CERT_ID_SIZE   33
 32 or 48 (depends on the curve) bytes for the X,Y coordinates and 1 for the normalized/non-normalized More...
 
#define PAL_ENABLE_PSK   0
 
#define PAL_ENABLE_X509   1
 
#define PAL_TLS_PSK_WITH_AES_128_CCM_8_SUITE   0x01
 
#define PAL_TLS_PSK_WITH_AES_256_CCM_8_SUITE   0x02
 
#define PAL_TLS_ECDHE_ECDSA_WITH_AES_128_CCM_8_SUITE   0x04
 
#define PAL_TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256_SUITE   0x08
 
#define PAL_TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384_SUITE   0x10
 
#define PAL_TLS_ECDHE_ECDSA_WITH_ARIA_128_GCM_SHA256_SUITE   0x20
 
#define PAL_TLS_CIPHER_SUITE   PAL_TLS_ECDHE_ECDSA_WITH_AES_128_CCM_8_SUITE
 Use the default cipher suite for TLS/DTLS operations. More...
 
#define PAL_CMAC_SUPPORT   true
 
#define PAL_UPDATE_USE_FLASH   1
 Enable the CMAC functionality. More...
 
#define PAL_UPDATE_USE_FS   2
 
#define PAL_UPDATE_IMAGE_LOCATION   PAL_UPDATE_USE_FS
 Determines the storage option to use, file System or flash. More...
 
#define PAL_CRYPTO_CERT_DATE_LENGTH   sizeof(uint64_t)
 Certificate date validation in Unix time format. More...
 
#define PAL_NUMBER_OF_PARTITIONS   1
 The number of file system partitions. More...
 
#define PAL_PRIMARY_PARTITION_PRIVATE   0
 Determines whether the primary partition is used only for the ARM client application. More...
 
#define PAL_SECONDARY_PARTITION_PRIVATE   0
 Determines whether the secondary partition is used only for the ARM client application. More...
 
#define PAL_FS_MOUNT_POINT_PRIMARY   ""
 The location of the primary mount point for the file system. More...
 
#define PAL_FS_MOUNT_POINT_SECONDARY   ""
 The location of the secondary mount point for the file system. More...
 
#define PAL_UPDATE_FIRMWARE_MOUNT_POINT   PAL_FS_MOUNT_POINT_PRIMARY
 
#define PAL_UPDATE_FIRMWARE_DIR   PAL_UPDATE_FIRMWARE_MOUNT_POINT "/firmware"
 The location of the firmware update folder. More...
 
#define PAL_USE_INTERNAL_FLASH   0
 If flash existed set to 1 else 0, the flash is used for non-volatile backup. More...
 
#define PAL_INT_FLASH_NUM_SECTIONS   0
 
#define PAL_USE_HW_ROT   1
 
#define PAL_USE_HW_RTC   1
 
#define PAL_USE_HW_TRNG   1
 
#define PAL_MAX_NUMBER_OF_THREADS   9
 The number of valid priorities limits the maximum number of concurrent running threads. More...
 
#define PAL_NOISE_TRNG_THREAD_DELAY_MILLI_SEC   (1000 * 60)
 Delay (in milliseconds) for TRNG noise collecting thread used between calls to TRNG. More...
 
#define PAL_NOISE_TRNG_THREAD_STACK_SIZE   1536
 Stack size for TRNG noise collecting thread. More...
 
#define PAL_USE_SECURE_TIME   1
 
#define PAL_DEVICE_KEY_DERIVATION_BACKWARD_COMPATIBILITY_CALC   0
 
#define PAL_INTERNAL_FLASH_SECTION_1_ADDRESS   0
 Starting Address for section 1. More...
 
#define PAL_INTERNAL_FLASH_SECTION_2_ADDRESS   0
 Starting Address for section 2. More...
 
#define PAL_INTERNAL_FLASH_SECTION_1_SIZE   0
 Size for section 1. More...
 
#define PAL_INTERNAL_FLASH_SECTION_2_SIZE   0
 Size for section 2. More...
 
#define PAL_SIMULATOR_TEST_ENABLE   0
 
#define PAL_SIMULATOR_FLASH_OVER_FILE_SYSTEM   0
 
#define VALUE_TO_STRING(x)   #x
 
#define VALUE(x)   VALUE_TO_STRING(x)
 
#define VAR_NAME_VALUE(var)   #var " = " VALUE(var)
 
#define PAL_TRNG_COLLECT_DELAY_MILLI_SEC   1000
 Delay (in milliseconds) between calls to TRNG random buffer in case only partial data (PAL_ERR_RTOS_TRNG_PARTIAL_DATA) was generated for the function call. More...
 
#define IMAGE_COUNT_MAX   1
 define the maximum number of images More...
 
#define PAL_NOISE_SIZE_BYTES   48
 Maximum number of bytes for noise. More...
 
#define PAL_NOISE_SIZE_BITS   (PAL_NOISE_SIZE_BYTES * CHAR_BIT)
 Maximum number of bits for noise. More...
 
#define PAL_NOISE_BUFFER_LEN   (PAL_NOISE_SIZE_BYTES / sizeof(int32_t))
 Length of the noise buffer. More...
 
#define PAL_USE_SSL_SESSION_RESUME   1
 

Detailed Description

PAL Configuration. This file contains PAL configuration information.

Following are examples of configuration included:

  1. The flags to enable or disable features.
  2. The configuration of the number of objects provided by PAL (such as the number of threads supported) or their sizes.
  3. The configuration of supported cipher suites.
  4. The configuration for flash memory usage.
  5. The configuration for the root of trust.

Macro Definition Documentation

#define IMAGE_COUNT_MAX   1

define the maximum number of images

#define PAL_CERT_ID_SIZE   33

32 or 48 (depends on the curve) bytes for the X,Y coordinates and 1 for the normalized/non-normalized

#define PAL_CLEANUP_ON_INIT_FAILURE   true

If you want PAL to not perform a rollback/cleanup when main PAL init fails, please set this flag to false

#define PAL_CMAC_SUPPORT   true
#define PAL_CRYPTO_CERT_DATE_LENGTH   sizeof(uint64_t)

Certificate date validation in Unix time format.

#define PAL_DEVICE_KEY_DERIVATION_BACKWARD_COMPATIBILITY_CALC   0
#define PAL_DNS_API_VERSION   0

syncronous DNS API

#define PAL_DTLS_PEER_MIN_TIMEOUT   1000

This value is in milliseconds. 1000 = 1 second.

#define PAL_ENABLE_PSK   0
#define PAL_ENABLE_X509   1
#define PAL_FS_MOUNT_POINT_PRIMARY   ""

The location of the primary mount point for the file system.

#define PAL_FS_MOUNT_POINT_SECONDARY   ""

The location of the secondary mount point for the file system.

#define PAL_INITIAL_RANDOM_SIZE   48

Determines the size of the initial random buffer (in bytes) held by PAL for random the algorithm.

#define PAL_INT_FLASH_NUM_SECTIONS   0
#define PAL_INTERNAL_FLASH_SECTION_1_ADDRESS   0

Starting Address for section 1.

Minimum required size is 1KB and section must be consecutive sectors

#define PAL_INTERNAL_FLASH_SECTION_1_SIZE   0

Size for section 1.

#define PAL_INTERNAL_FLASH_SECTION_2_ADDRESS   0

Starting Address for section 2.

Minimum required size is 1KB and section must be consecutive sectors

#define PAL_INTERNAL_FLASH_SECTION_2_SIZE   0

Size for section 2.

#define PAL_MAX_ALLOWED_CIPHER_SUITES   1

The maximum number of supported cipher suites.

#define PAL_MAX_NUMBER_OF_THREADS   9

The number of valid priorities limits the maximum number of concurrent running threads.

#define PAL_MAX_SUPORTED_NET_INTERFACES   1

The maximum number of interfaces that can be supported at a time.

#define PAL_NET_ASYNC_DNS_THREAD_STACK_SIZE   (1024 * 2)

Stack size for thread created when calling pal_getAddressInfoAsync.

#define PAL_NET_DNS_ANY   0

if PAL_NET_DNS_IP_SUPPORT is set to PAL_NET_DNS_ANY pal_getAddressInfo will return the first available IPV4 or IPV6 address

#define PAL_NET_DNS_IP_SUPPORT   0

sets the type of IP addresses returned by pal_getAddressInfo

#define PAL_NET_DNS_IPV4_ONLY   2

if PAL_NET_DNS_IP_SUPPORT is set to PAL_NET_DNS_IPV4_ONLY pal_getAddressInfo will return the first available IPV4 address

#define PAL_NET_DNS_IPV6_ONLY   4

if PAL_NET_DNS_IP_SUPPORT is set to PAL_NET_DNS_IPV6_ONLY pal_getAddressInfo will return the first available IPV6 address

#define PAL_NET_DNS_SUPPORT   true

Add PAL support for DNS lookup.

#define PAL_NET_SERVER_SOCKET_API   true

Add PAL support for server socket.

#define PAL_NET_TCP_AND_TLS_SUPPORT   true

Add PAL support for TCP.

#define PAL_NOISE_BUFFER_LEN   (PAL_NOISE_SIZE_BYTES / sizeof(int32_t))

Length of the noise buffer.

#define PAL_NOISE_SIZE_BITS   (PAL_NOISE_SIZE_BYTES * CHAR_BIT)

Maximum number of bits for noise.

#define PAL_NOISE_SIZE_BYTES   48

Maximum number of bytes for noise.

#define PAL_NOISE_TRNG_THREAD_DELAY_MILLI_SEC   (1000 * 60)

Delay (in milliseconds) for TRNG noise collecting thread used between calls to TRNG.

#define PAL_NOISE_TRNG_THREAD_STACK_SIZE   1536

Stack size for TRNG noise collecting thread.

#define PAL_NUMBER_OF_PARTITIONS   1

The number of file system partitions.

1 - There is a single partition in which the ARM client applications create and remove files (but not format it). This is the default.
2 - There are two partitions in which ARM client applications may format or create and remove files, depending on PAL_PRIMARY_PARTITION_PRIVATE and PAL_SECONDARY_PARTITION_PRIVATE

#define PAL_PRIMARY_PARTITION_PRIVATE   0

Determines whether the primary partition is used only for the ARM client application.

1 - The primary partition is exclusively dedicated to the ARM client applications. \ 0 - The primary partition is used for storing other files as well.

#define PAL_RTOS_THREAD_CLEANUP_TIMER_MILISEC   200

Initial time (in milliseconds) until thread stack cleanup (mbedOS only).

This is the amount of time to wait before checking that a thread has completed in order to free its stack.

#define PAL_RTOS_WAIT_FOREVER   UINT_MAX
#define PAL_SECONDARY_PARTITION_PRIVATE   0

Determines whether the secondary partition is used only for the ARM client application.

1 - The secondary partition is exclusively dedicated to the ARM client applications. 0 - The secondary partition is used for storing other files as well.

#define PAL_SIMULATOR_FLASH_OVER_FILE_SYSTEM   0
#define PAL_SIMULATOR_TEST_ENABLE   0
#define PAL_SUPPORT_IP_V4   true

support IPV4 as default

#define PAL_SUPPORT_IP_V6   true

support IPV6 as default

#define PAL_THREAD_SAFETY   1

Determines if PAL modules are thread safe.

1 - thread safety is enabled,
0 - thread safety is disabled

#define PAL_TLS_CIPHER_SUITE   PAL_TLS_ECDHE_ECDSA_WITH_AES_128_CCM_8_SUITE

Use the default cipher suite for TLS/DTLS operations.

#define PAL_TLS_DEBUG_THRESHOLD   5

The debug threshold for TLS API.

#define PAL_TLS_ECDHE_ECDSA_WITH_AES_128_CCM_8_SUITE   0x04
#define PAL_TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256_SUITE   0x08
#define PAL_TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384_SUITE   0x10
#define PAL_TLS_ECDHE_ECDSA_WITH_ARIA_128_GCM_SHA256_SUITE   0x20
#define PAL_TLS_PSK_WITH_AES_128_CCM_8_SUITE   0x01
#define PAL_TLS_PSK_WITH_AES_256_CCM_8_SUITE   0x02
#define PAL_TRNG_COLLECT_DELAY_MILLI_SEC   1000

Delay (in milliseconds) between calls to TRNG random buffer in case only partial data (PAL_ERR_RTOS_TRNG_PARTIAL_DATA) was generated for the function call.

#define PAL_UPDATE_FIRMWARE_DIR   PAL_UPDATE_FIRMWARE_MOUNT_POINT "/firmware"

The location of the firmware update folder.

#define PAL_UPDATE_FIRMWARE_MOUNT_POINT   PAL_FS_MOUNT_POINT_PRIMARY
#define PAL_UPDATE_IMAGE_LOCATION   PAL_UPDATE_USE_FS

Determines the storage option to use, file System or flash.

#define PAL_UPDATE_USE_FLASH   1

Enable the CMAC functionality.

Note
This flag lets the bootloader be compiled without CMAC.
#define PAL_UPDATE_USE_FS   2
#define PAL_USE_HW_ROT   1
#define PAL_USE_HW_RTC   1
#define PAL_USE_HW_TRNG   1
#define PAL_USE_INTERNAL_FLASH   0

If flash existed set to 1 else 0, the flash is used for non-volatile backup.

#define PAL_USE_SECURE_TIME   1
#define PAL_USE_SSL_SESSION_RESUME   1
#define VALUE (   x)    VALUE_TO_STRING(x)
#define VALUE_TO_STRING (   x)    #x
#define VAR_NAME_VALUE (   var)    #var " = " VALUE(var)