From 87df8a08f8f43c495e95401f41ffd3ae6d78b759 Mon Sep 17 00:00:00 2001 From: Aniruddha Kanhere <60444055+AniruddhaKanhere@users.noreply.github.com> Date: Tue, 14 Nov 2023 20:24:30 -0800 Subject: [PATCH] Remove test folder and lwip ethernet files --- .../NXP/lwip_ethernet/enet_ethernetif.c | 281 -- .../NXP/lwip_ethernet/enet_ethernetif.h | 125 - .../lwip_ethernet/enet_ethernetif_kinetis.c | 762 ---- .../NXP/lwip_ethernet/enet_ethernetif_priv.h | 80 - examples/evkbmimxrt1060/test/README.md | 107 - examples/evkbmimxrt1060/test/app_main.c | 161 - examples/evkbmimxrt1060/test/board/board.c | 416 --- examples/evkbmimxrt1060/test/board/board.h | 218 -- .../evkbmimxrt1060/test/board/clock_config.c | 525 --- .../evkbmimxrt1060/test/board/clock_config.h | 138 - examples/evkbmimxrt1060/test/board/dcd.c | 316 -- examples/evkbmimxrt1060/test/board/dcd.h | 32 - .../test/board/flash_partitioning.h | 55 - .../test/board/flexspi_nor_flash_ops.c | 669 ---- .../test/board/flexspi_nor_flash_ops.h | 79 - .../evkbmimxrt1060/test/board/mflash_drv.c | 691 ---- .../evkbmimxrt1060/test/board/mflash_drv.h | 41 - examples/evkbmimxrt1060/test/board/pin_mux.c | 360 -- examples/evkbmimxrt1060/test/board/pin_mux.h | 75 - .../test/include/FreeRTOSConfig.h | 221 -- .../test/include/aws_mbedtls_config.h | 3245 ----------------- .../test/include/core_mqtt_agent_config.h | 2 - .../test/include/core_mqtt_config.h | 117 - .../test/include/core_pkcs11_config.h | 150 - .../evkbmimxrt1060/test/include/demo_config.h | 226 -- .../test/include/freertos_tasks_c_additions.h | 126 - .../evkbmimxrt1060/test/include/fsl_sss_ftr.h | 716 ---- .../test/include/kvstore_config.h | 79 - .../evkbmimxrt1060/test/include/lwipopts.h | 339 -- .../evkbmimxrt1060/test/include/ota_config.h | 198 - .../test/include/test_execution_config.h | 74 - .../test/include/test_param_config.h | 182 - .../test/include/unity_config.h | 9 - .../evkbmimxrt1060/test/integration_test.c | 322 -- .../evkbmimxrt1060/test/linkscripts/bss.ldt | 3 - .../evkbmimxrt1060/test/linkscripts/data.ldt | 6 - .../test/linkscripts/main_text.ldt | 1 - examples/evkbmimxrt1060/test/main.c | 474 --- examples/evkbmimxrt1060/test/manifest.yml | 13 - .../evkbmimxrt1060/test/pub_sub_test_task.c | 505 --- .../evkbmimxrt1060/test/semihost_hardfault.c | 98 - examples/evkbmimxrt1060/test/test_logging.c | 87 - examples/evkbmimxrt1060/test/test_logging.h | 14 - examples/evkbmimxrt1060/test/unity_config.h | 17 - projects/evkmimxrt1060/test/.cproject | 339 -- projects/evkmimxrt1060/test/.gitignore | 1 - projects/evkmimxrt1060/test/.project | 1166 ------ .../evkmimxrt1060/test/aws_iot_qual_test.ld | 375 -- 48 files changed, 14236 deletions(-) delete mode 100644 Middleware/NXP/lwip_ethernet/enet_ethernetif.c delete mode 100644 Middleware/NXP/lwip_ethernet/enet_ethernetif.h delete mode 100644 Middleware/NXP/lwip_ethernet/enet_ethernetif_kinetis.c delete mode 100644 Middleware/NXP/lwip_ethernet/enet_ethernetif_priv.h delete mode 100644 examples/evkbmimxrt1060/test/README.md delete mode 100644 examples/evkbmimxrt1060/test/app_main.c delete mode 100644 examples/evkbmimxrt1060/test/board/board.c delete mode 100644 examples/evkbmimxrt1060/test/board/board.h delete mode 100644 examples/evkbmimxrt1060/test/board/clock_config.c delete mode 100644 examples/evkbmimxrt1060/test/board/clock_config.h delete mode 100644 examples/evkbmimxrt1060/test/board/dcd.c delete mode 100644 examples/evkbmimxrt1060/test/board/dcd.h delete mode 100644 examples/evkbmimxrt1060/test/board/flash_partitioning.h delete mode 100644 examples/evkbmimxrt1060/test/board/flexspi_nor_flash_ops.c delete mode 100644 examples/evkbmimxrt1060/test/board/flexspi_nor_flash_ops.h delete mode 100644 examples/evkbmimxrt1060/test/board/mflash_drv.c delete mode 100644 examples/evkbmimxrt1060/test/board/mflash_drv.h delete mode 100644 examples/evkbmimxrt1060/test/board/pin_mux.c delete mode 100644 examples/evkbmimxrt1060/test/board/pin_mux.h delete mode 100644 examples/evkbmimxrt1060/test/include/FreeRTOSConfig.h delete mode 100644 examples/evkbmimxrt1060/test/include/aws_mbedtls_config.h delete mode 100644 examples/evkbmimxrt1060/test/include/core_mqtt_agent_config.h delete mode 100644 examples/evkbmimxrt1060/test/include/core_mqtt_config.h delete mode 100644 examples/evkbmimxrt1060/test/include/core_pkcs11_config.h delete mode 100644 examples/evkbmimxrt1060/test/include/demo_config.h delete mode 100644 examples/evkbmimxrt1060/test/include/freertos_tasks_c_additions.h delete mode 100644 examples/evkbmimxrt1060/test/include/fsl_sss_ftr.h delete mode 100644 examples/evkbmimxrt1060/test/include/kvstore_config.h delete mode 100644 examples/evkbmimxrt1060/test/include/lwipopts.h delete mode 100644 examples/evkbmimxrt1060/test/include/ota_config.h delete mode 100644 examples/evkbmimxrt1060/test/include/test_execution_config.h delete mode 100644 examples/evkbmimxrt1060/test/include/test_param_config.h delete mode 100644 examples/evkbmimxrt1060/test/include/unity_config.h delete mode 100644 examples/evkbmimxrt1060/test/integration_test.c delete mode 100644 examples/evkbmimxrt1060/test/linkscripts/bss.ldt delete mode 100644 examples/evkbmimxrt1060/test/linkscripts/data.ldt delete mode 100644 examples/evkbmimxrt1060/test/linkscripts/main_text.ldt delete mode 100644 examples/evkbmimxrt1060/test/main.c delete mode 100644 examples/evkbmimxrt1060/test/manifest.yml delete mode 100644 examples/evkbmimxrt1060/test/pub_sub_test_task.c delete mode 100644 examples/evkbmimxrt1060/test/semihost_hardfault.c delete mode 100644 examples/evkbmimxrt1060/test/test_logging.c delete mode 100644 examples/evkbmimxrt1060/test/test_logging.h delete mode 100644 examples/evkbmimxrt1060/test/unity_config.h delete mode 100644 projects/evkmimxrt1060/test/.cproject delete mode 100644 projects/evkmimxrt1060/test/.gitignore delete mode 100644 projects/evkmimxrt1060/test/.project delete mode 100644 projects/evkmimxrt1060/test/aws_iot_qual_test.ld diff --git a/Middleware/NXP/lwip_ethernet/enet_ethernetif.c b/Middleware/NXP/lwip_ethernet/enet_ethernetif.c deleted file mode 100644 index af4b367..0000000 --- a/Middleware/NXP/lwip_ethernet/enet_ethernetif.c +++ /dev/null @@ -1,281 +0,0 @@ -/* - * Copyright (c) 2001-2004 Swedish Institute of Computer Science. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT - * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT - * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING - * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY - * OF SUCH DAMAGE. - * - * This file is part of the lwIP TCP/IP stack. - * - * Author: Adam Dunkels - * - */ - -/* - * Copyright (c) 2013-2016, Freescale Semiconductor, Inc. - * Copyright 2016-2020 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "lwip/opt.h" -#include "lwip/def.h" -#include "lwip/mem.h" -#include "lwip/pbuf.h" -#include "lwip/stats.h" -#include "lwip/snmp.h" -#include "lwip/ethip6.h" -#include "netif/etharp.h" -#include "netif/ppp/pppoe.h" -#include "lwip/igmp.h" -#include "lwip/mld6.h" - -#if USE_RTOS && defined(SDK_OS_FREE_RTOS) -#include "FreeRTOS.h" -#include "event_groups.h" -#endif - -#include "enet_ethernetif.h" -#include "enet_ethernetif_priv.h" -#include "fsl_debug_console.h" - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/******************************************************************************* - * Code - ******************************************************************************/ - -void ethernetif_phy_init(struct ethernetif *ethernetif, - const ethernetif_config_t *ethernetifConfig, - phy_speed_t *speed, - phy_duplex_t *duplex) -{ - phy_config_t phyConfig; - status_t status; - bool link = false; - bool autonego = false; - uint32_t initWaitCount = 0; - uint32_t autoWaitCount = 0; - - phyConfig.phyAddr = ethernetifConfig->phyHandle->phyAddr; - phyConfig.autoNeg = true; - - ethernetifConfig->phyHandle->mdioHandle->resource.base = *ethernetif_enet_ptr(ethernetif); - - LWIP_PLATFORM_DIAG(("Initializing PHY...")); - - while ((initWaitCount < ENET_ATONEGOTIATION_TIMEOUT) && (!(link && autonego))) - { - status = PHY_Init(ethernetifConfig->phyHandle, &phyConfig); - - if (kStatus_Success != status) - { - LWIP_ASSERT("\r\nCannot initialize PHY.\r\n", 0); - } - - /* Wait for auto-negotiation success and link up */ - autoWaitCount = ENET_ATONEGOTIATION_TIMEOUT; - do - { - PHY_GetAutoNegotiationStatus(ethernetifConfig->phyHandle, &autonego); - PHY_GetLinkStatus(ethernetifConfig->phyHandle, &link); - if (autonego && link) - { - break; - } - } while (--autoWaitCount); - if (!autonego) - { - PRINTF("PHY Auto-negotiation failed. Please check the cable connection and link partner setting.\r\n"); - } - - initWaitCount++; - } - - if (autonego && link) - { - /* Get the actual PHY link speed. */ - PHY_GetLinkSpeedDuplex(ethernetifConfig->phyHandle, speed, duplex); - } -#if 0 /* Disable assert. If initial auto-negation is timeout, \ \ - the ENET is set to default (100Mbs and full-duplex). */ - else - { - LWIP_ASSERT("\r\nGiving up PHY initialization. Please check the ENET cable connection and link partner setting and reset the board.\r\n", 0); - } -#endif -} - -/** - * This function should be called when a packet is ready to be read - * from the interface. It uses the function ethernetif_linkinput() that - * should handle the actual reception of bytes from the network - * interface. Then the type of the received packet is determined and - * the appropriate input function is called. - * - * @param netif the lwip network interface structure for this ethernetif - */ -void ethernetif_input(struct netif *netif) -{ - struct pbuf *p; - - LWIP_ASSERT("netif != NULL", (netif != NULL)); - - /* move received packet into a new pbuf */ - while ((p = ethernetif_linkinput(netif)) != NULL) - { - /* pass all packets to ethernet_input, which decides what packets it supports */ - if (netif->input(p, netif) != ERR_OK) - { - LWIP_DEBUGF(NETIF_DEBUG, ("ethernetif_input: IP input error\n")); - pbuf_free(p); - p = NULL; - } - } -} - -void *ethernetif_get_enet_base(const uint8_t enetIdx) -{ - ENET_Type* enets[] = ENET_BASE_PTRS; - int arrayIdx; - int enetCount; - - for (arrayIdx = 0, enetCount = 0; arrayIdx < ARRAY_SIZE(enets); arrayIdx++) - { - if (enets[arrayIdx] != 0U) /* process only defined positions */ - { /* (some SOC headers count ENETs from 1 instead of 0) */ - if (enetCount == enetIdx) - { - return (void *)enets[arrayIdx]; - } - enetCount++; - } - } - - return NULL; -} - -#if defined(FSL_FEATURE_SOC_ENET_QOS_COUNT) && (FSL_FEATURE_SOC_ENET_QOS_COUNT > 0) -void *ethernetif_get_enet_qos_base(const uint8_t enetIdx) -{ - ENET_QOS_Type* enets[] = ENET_QOS_BASE_PTRS; - int arrayIdx; - int enetCount; - - for (arrayIdx = 0, enetCount = 0; arrayIdx < ARRAY_SIZE(enets); arrayIdx++) - { - if (enets[arrayIdx] != 0U) /* process only defined positions */ - { /* (some SOC headers count ENETs from 1 instead of 0) */ - if (enetCount == enetIdx) - { - return (void *)enets[arrayIdx]; - } - enetCount++; - } - } - - return NULL; -} -#endif - -err_t ethernetif_init(struct netif *netif, struct ethernetif *ethernetif, - void *enetBase, - const ethernetif_config_t *ethernetifConfig) -{ - LWIP_ASSERT("netif != NULL", (netif != NULL)); - LWIP_ASSERT("ethernetifConfig != NULL", (ethernetifConfig != NULL)); - -#if LWIP_NETIF_HOSTNAME - /* Initialize interface hostname */ - netif->hostname = "lwip"; -#endif /* LWIP_NETIF_HOSTNAME */ - - /* - * Initialize the snmp variables and counters inside the struct netif. - * The last argument should be replaced with your link speed, in units - * of bits per second. - */ - MIB2_INIT_NETIF(netif, snmp_ifType_ethernet_csmacd, LINK_SPEED_OF_YOUR_NETIF_IN_BPS); - - netif->state = ethernetif; - netif->name[0] = IFNAME0; - netif->name[1] = IFNAME1; -/* We directly use etharp_output() here to save a function call. - * You can instead declare your own function an call etharp_output() - * from it if you have to do some checks before sending (e.g. if link - * is available...) */ -#if LWIP_IPV4 - netif->output = etharp_output; -#endif -#if LWIP_IPV6 - netif->output_ip6 = ethip6_output; -#endif /* LWIP_IPV6 */ - netif->linkoutput = ethernetif_linkoutput; - -#if LWIP_IPV4 && LWIP_IGMP - netif_set_igmp_mac_filter(netif, ethernetif_igmp_mac_filter); - netif->flags |= NETIF_FLAG_IGMP; -#endif -#if LWIP_IPV6 && LWIP_IPV6_MLD - netif_set_mld_mac_filter(netif, ethernetif_mld_mac_filter); - netif->flags |= NETIF_FLAG_MLD6; -#endif - - /* Init ethernetif parameters.*/ - *ethernetif_enet_ptr(ethernetif) = enetBase; - LWIP_ASSERT("*ethernetif_enet_ptr(ethernetif) != NULL", (*ethernetif_enet_ptr(ethernetif) != NULL)); - - /* set MAC hardware address length */ - netif->hwaddr_len = ETH_HWADDR_LEN; - - /* set MAC hardware address */ - memcpy(netif->hwaddr, ethernetifConfig->macAddress, NETIF_MAX_HWADDR_LEN); - - /* maximum transfer unit */ - netif->mtu = 1500; /* TODO: define a config */ - - /* device capabilities */ - /* don't set NETIF_FLAG_ETHARP if this device is not an ethernet one */ - netif->flags |= NETIF_FLAG_BROADCAST | NETIF_FLAG_ETHARP | NETIF_FLAG_LINK_UP; - - /* ENET driver initialization.*/ - ethernetif_enet_init(netif, ethernetif, ethernetifConfig); - -#if LWIP_IPV6 && LWIP_IPV6_MLD - /* - * For hardware/netifs that implement MAC filtering. - * All-nodes link-local is handled by default, so we must let the hardware know - * to allow multicast packets in. - * Should set mld_mac_filter previously. */ - if (netif->mld_mac_filter != NULL) - { - ip6_addr_t ip6_allnodes_ll; - ip6_addr_set_allnodes_linklocal(&ip6_allnodes_ll); - netif->mld_mac_filter(netif, &ip6_allnodes_ll, NETIF_ADD_MAC_FILTER); - } -#endif /* LWIP_IPV6 && LWIP_IPV6_MLD */ - - return ERR_OK; -} diff --git a/Middleware/NXP/lwip_ethernet/enet_ethernetif.h b/Middleware/NXP/lwip_ethernet/enet_ethernetif.h deleted file mode 100644 index 8fd8f8b..0000000 --- a/Middleware/NXP/lwip_ethernet/enet_ethernetif.h +++ /dev/null @@ -1,125 +0,0 @@ -/* - * Copyright (c) 2001-2003 Swedish Institute of Computer Science. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT - * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT - * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING - * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY - * OF SUCH DAMAGE. - * - * This file is part of the lwIP TCP/IP stack. - * - * Author: Adam Dunkels - * - */ - -/* - * Copyright (c) 2013-2016, Freescale Semiconductor, Inc. - * Copyright 2016-2021 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#ifndef ENET_ETHERNETIF_H -#define ENET_ETHERNETIF_H - -#include "lwip/err.h" -#include "lwip/netif.h" -#include "fsl_phy.h" - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -#define ENET_TIMEOUT (0xFFFU) - -/* ENET IRQ priority. Used in FreeRTOS. */ -/* Interrupt priorities. */ -#ifdef __CA7_REV -#ifndef ENET_PRIORITY - #define ENET_PRIORITY (21U) -#endif -#ifndef ENET_1588_PRIORITY - #define ENET_1588_PRIORITY (20U) -#endif -#else -#ifndef ENET_PRIORITY - #define ENET_PRIORITY (6U) -#endif -#ifndef ENET_1588_PRIORITY - #define ENET_1588_PRIORITY (5U) -#endif -#endif - -/* Defines Ethernet Autonegotiation Timeout during initialization. - * Set it to 0 to disable the waiting. */ -#ifndef ENET_ATONEGOTIATION_TIMEOUT - #define ENET_ATONEGOTIATION_TIMEOUT (0x2FFFFU) -#endif - -/* Define those to better describe your network interface. */ -#define IFNAME0 'e' -#define IFNAME1 'n' - -#define ENET_RING_NUM 1U - -/** - * Helper struct to hold data for configuration of ethernet interface. - */ -typedef struct ethernetif_config -{ - phy_handle_t *phyHandle; - uint8_t macAddress[NETIF_MAX_HWADDR_LEN]; -} ethernetif_config_t; - -#if defined(__cplusplus) -extern "C" { -#endif /* __cplusplus */ - -/** - * This function should be passed as a parameter to netif_add() - * if you initialize the first ENET interface. - */ -err_t ethernetif0_init(struct netif *netif); - -#if (defined(FSL_FEATURE_SOC_ENET_COUNT) && (FSL_FEATURE_SOC_ENET_COUNT > 1)) \ - || (defined(FSL_FEATURE_SOC_LPC_ENET_COUNT) && (FSL_FEATURE_SOC_LPC_ENET_COUNT > 1)) -/** - * This function should be passed as a parameter to netif_add() - * if you initialize the second ENET interface. - */ -err_t ethernetif1_init(struct netif *netif); -#endif /* FSL_FEATURE_SOC_*_ENET_COUNT */ - -/** - * This function should be called when a packet is ready to be read - * from the interface. - * It is used by bare-metal applications. - * - * @param netif the lwip network interface structure for this ethernetif - */ -void ethernetif_input( struct netif *netif); - -#if defined(__cplusplus) -} -#endif /* __cplusplus */ - -#endif /* ENET_ETHERNETIF_H */ diff --git a/Middleware/NXP/lwip_ethernet/enet_ethernetif_kinetis.c b/Middleware/NXP/lwip_ethernet/enet_ethernetif_kinetis.c deleted file mode 100644 index 6f81b9b..0000000 --- a/Middleware/NXP/lwip_ethernet/enet_ethernetif_kinetis.c +++ /dev/null @@ -1,762 +0,0 @@ -/* - * Copyright (c) 2001-2004 Swedish Institute of Computer Science. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT - * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT - * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING - * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY - * OF SUCH DAMAGE. - * - * This file is part of the lwIP TCP/IP stack. - * - * Author: Adam Dunkels - * - */ - -/* - * Copyright (c) 2013-2016, Freescale Semiconductor, Inc. - * Copyright 2016-2021 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "lwip/opt.h" -#include "lwip/def.h" -#include "lwip/ethip6.h" -#include "lwip/igmp.h" -#include "lwip/mem.h" -#include "lwip/mld6.h" -#include "lwip/pbuf.h" -#include "lwip/snmp.h" -#include "lwip/stats.h" -#include "lwip/sys.h" -#include "netif/etharp.h" -#include "netif/ppp/pppoe.h" - -#if USE_RTOS && defined(SDK_OS_FREE_RTOS) -#include "FreeRTOS.h" -#include "event_groups.h" -#endif - -#include "enet_ethernetif.h" -#include "enet_ethernetif_priv.h" - -#include "fsl_enet.h" -#include "fsl_phy.h" - -/* - * Padding of ethernet frames has to be disabled for zero-copy functionality - * since ENET driver requires the starting buffer addresses to be aligned. - */ -#if ETH_PAD_SIZE != 0 -#error "ETH_PAD_SIZE != 0" -#endif /* ETH_PAD_SIZE != 0 */ - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/* The length or RX buffer. */ -#ifndef ENET_RXBUFF_SIZE -#define ENET_RXBUFF_SIZE (ENET_FRAME_MAX_FRAMELEN) -#endif - -/* The number of ENET buffers needed to receive frame of maximum length. */ -#define MAX_BUFFERS_PER_FRAME \ - ((ENET_FRAME_MAX_FRAMELEN / ENET_RXBUFF_SIZE) + ((ENET_FRAME_MAX_FRAMELEN % ENET_RXBUFF_SIZE == 0) ? 0 : 1)) - -/* The length or TX buffer. */ -#ifndef ENET_TXBUFF_SIZE -#define ENET_TXBUFF_SIZE (ENET_FRAME_MAX_FRAMELEN) -#endif - -/* The number of buffer descriptors in ENET RX ring. */ -#ifndef ENET_RXBD_NUM -#define ENET_RXBD_NUM (5) -#endif - -/* Ring should be able to receive at least 1 frame with maximum length. */ -#if ENET_RXBD_NUM < MAX_BUFFERS_PER_FRAME -#error "ENET_RXBD_NUM < MAX_BUFFERS_PER_FRAME" -#endif - -/* The number of RX buffers. ENET_RXBD_NUM is always held by ENET driver, - * so a couple more are needed to pass zero-copy data into lwIP. */ -#ifndef ENET_RXBUFF_NUM -#define ENET_RXBUFF_NUM (ENET_RXBD_NUM * 2) -#endif - -/* At least ENET_RXBD_NUM number of buffers is always held by ENET driver for RX. - * Some additional buffers are needed to pass at least one frame zero-copy data to lwIP. */ -#if ENET_RXBUFF_NUM < (ENET_RXBD_NUM + MAX_BUFFERS_PER_FRAME) -#error "ENET_RXBUFF_NUM < (ENET_RXBD_NUM + MAX_BUFFERS_PER_FRAME)" -#endif - -/* The number of buffer descriptors in ENET TX ring. */ -#ifndef ENET_TXBD_NUM -#define ENET_TXBD_NUM (3) -#endif - -#if defined(FSL_SDK_ENABLE_DRIVER_CACHE_CONTROL) && FSL_SDK_ENABLE_DRIVER_CACHE_CONTROL -#if defined(FSL_FEATURE_L2CACHE_LINESIZE_BYTE) && \ - ((!defined(FSL_SDK_DISBLE_L2CACHE_PRESENT)) || (FSL_SDK_DISBLE_L2CACHE_PRESENT == 0)) -#if defined(FSL_FEATURE_L1DCACHE_LINESIZE_BYTE) -#define FSL_CACHE_LINESIZE_MAX MAX(FSL_FEATURE_L1DCACHE_LINESIZE_BYTE, FSL_FEATURE_L2CACHE_LINESIZE_BYTE) -#define FSL_ENET_BUFF_ALIGNMENT MAX(ENET_BUFF_ALIGNMENT, FSL_CACHE_LINESIZE_MAX) -#else -#define FSL_ENET_BUFF_ALIGNMENT MAX(ENET_BUFF_ALIGNMENT, FSL_FEATURE_L2CACHE_LINESIZE_BYTE) -#endif -#elif defined(FSL_FEATURE_L1DCACHE_LINESIZE_BYTE) -#define FSL_ENET_BUFF_ALIGNMENT MAX(ENET_BUFF_ALIGNMENT, FSL_FEATURE_L1DCACHE_LINESIZE_BYTE) -#else -#define FSL_ENET_BUFF_ALIGNMENT ENET_BUFF_ALIGNMENT -#endif -#else -#define FSL_ENET_BUFF_ALIGNMENT ENET_BUFF_ALIGNMENT -#endif - -typedef uint8_t rx_buffer_t[SDK_SIZEALIGN(ENET_RXBUFF_SIZE, FSL_ENET_BUFF_ALIGNMENT)]; -typedef uint8_t tx_buffer_t[SDK_SIZEALIGN(ENET_TXBUFF_SIZE, FSL_ENET_BUFF_ALIGNMENT)]; - -/*! - * @brief Used to wrap received data in a pbuf to be passed into lwIP - * without copying. - * Once last reference is released, buffer can be used by ENET RX DMA again. - */ -typedef struct rx_pbuf_wrapper -{ - struct pbuf_custom p; /*!< Pbuf wrapper. Has to be first. */ - void *buffer; /*!< Original buffer wrapped by p. */ - volatile bool buffer_used; /*!< Wrapped buffer is used by ENET or lwIP. */ - struct netif *netif; /*!< Network interface context data. */ -} rx_pbuf_wrapper_t; - -/** - * Helper struct to hold private data used to operate your ethernet interface. - */ -struct ethernetif -{ - ENET_Type *base; -#if (defined(FSL_FEATURE_SOC_ENET_COUNT) && (FSL_FEATURE_SOC_ENET_COUNT > 0)) || \ - (USE_RTOS && defined(SDK_OS_FREE_RTOS)) - enet_handle_t handle; -#endif -#if USE_RTOS && defined(SDK_OS_FREE_RTOS) - EventGroupHandle_t enetTransmitAccessEvent; - EventBits_t txFlag; -#endif - enet_rx_bd_struct_t *RxBuffDescrip; - enet_tx_bd_struct_t *TxBuffDescrip; - rx_buffer_t *RxDataBuff; - tx_buffer_t *TxDataBuff; - rx_pbuf_wrapper_t RxPbufs[ENET_RXBUFF_NUM]; -}; - -/******************************************************************************* - * Prototypes - ******************************************************************************/ - -static void ethernetif_rx_release(struct pbuf *p); - -/******************************************************************************* - * Code - ******************************************************************************/ -#if USE_RTOS && defined(SDK_OS_FREE_RTOS) -static void ethernet_callback(ENET_Type *base, - enet_handle_t *handle, -#if FSL_FEATURE_ENET_QUEUE > 1 - uint32_t ringId, -#endif /* FSL_FEATURE_ENET_QUEUE */ - enet_event_t event, - enet_frame_info_t *frameInfo, - void *userData) -{ - struct netif *netif = (struct netif *)userData; - struct ethernetif *ethernetif = netif->state; - BaseType_t xResult; - - switch (event) - { - case kENET_RxEvent: - /* Disabling RX interrupts required by ENET_GetRxFrame() when called from ISR */ - ENET_DisableInterrupts(ethernetif->base, (uint32_t)kENET_RxFrameInterrupt); - ethernetif_input(netif); - ENET_EnableInterrupts(ethernetif->base, (uint32_t)kENET_RxFrameInterrupt); - break; - case kENET_TxEvent: - { - portBASE_TYPE taskToWake = pdFALSE; - -#ifdef __CA7_REV - if (SystemGetIRQNestingLevel()) -#else - if (__get_IPSR()) -#endif - { - xResult = - xEventGroupSetBitsFromISR(ethernetif->enetTransmitAccessEvent, ethernetif->txFlag, &taskToWake); - if ((pdPASS == xResult) && (pdTRUE == taskToWake)) - { - portYIELD_FROM_ISR(taskToWake); - } - } - else - { - xEventGroupSetBits(ethernetif->enetTransmitAccessEvent, ethernetif->txFlag); - } - } - break; - default: - break; - } -} -#endif - -#if LWIP_IPV4 && LWIP_IGMP -err_t ethernetif_igmp_mac_filter(struct netif *netif, const ip4_addr_t *group, enum netif_mac_filter_action action) -{ - struct ethernetif *ethernetif = netif->state; - uint8_t multicastMacAddr[6]; - err_t result; - - multicastMacAddr[0] = 0x01U; - multicastMacAddr[1] = 0x00U; - multicastMacAddr[2] = 0x5EU; - multicastMacAddr[3] = (group->addr >> 8) & 0x7FU; - multicastMacAddr[4] = (group->addr >> 16) & 0xFFU; - multicastMacAddr[5] = (group->addr >> 24) & 0xFFU; - - switch (action) - { - case IGMP_ADD_MAC_FILTER: - /* Adds the ENET device to a multicast group.*/ - ENET_AddMulticastGroup(ethernetif->base, multicastMacAddr); - result = ERR_OK; - break; - case IGMP_DEL_MAC_FILTER: - /* - * Moves the ENET device from a multicast group. - * Since the ENET_LeaveMulticastGroup() could filter out also other - * group addresses having the same hash, the call is commented out. - */ - /* ENET_LeaveMulticastGroup(ethernetif->base, multicastMacAddr); */ - result = ERR_OK; - break; - default: - result = ERR_IF; - break; - } - - return result; -} -#endif - -#if LWIP_IPV6 && LWIP_IPV6_MLD -err_t ethernetif_mld_mac_filter(struct netif *netif, const ip6_addr_t *group, enum netif_mac_filter_action action) -{ - struct ethernetif *ethernetif = netif->state; - uint8_t multicastMacAddr[6]; - err_t result; - - multicastMacAddr[0] = 0x33U; - multicastMacAddr[1] = 0x33U; - multicastMacAddr[2] = (group->addr[3]) & 0xFFU; - multicastMacAddr[3] = (group->addr[3] >> 8) & 0xFFU; - multicastMacAddr[4] = (group->addr[3] >> 16) & 0xFFU; - multicastMacAddr[5] = (group->addr[3] >> 24) & 0xFFU; - - switch (action) - { - case NETIF_ADD_MAC_FILTER: - /* Adds the ENET device to a multicast group.*/ - ENET_AddMulticastGroup(ethernetif->base, multicastMacAddr); - result = ERR_OK; - break; - case NETIF_DEL_MAC_FILTER: - /* - * Moves the ENET device from a multicast group. - * Since the ENET_LeaveMulticastGroup() could filter out also other - * group addresses having the same hash, the call is commented out. - */ - /* ENET_LeaveMulticastGroup(ethernetif->base, multicastMacAddr); */ - result = ERR_OK; - break; - default: - result = ERR_IF; - break; - } - - return result; -} -#endif - -/*! @brief Defines the ENET Rx memeory buffer free function pointer. */ -static void *ethernetif_rx_alloc(ENET_Type *base, void *userData, uint8_t ringId) -{ - struct netif *netif = (struct netif *)userData; - struct ethernetif *ethernetif = netif->state; - void *buffer = NULL; - int i; - - SYS_ARCH_DECL_PROTECT(old_level); - SYS_ARCH_PROTECT(old_level); - - for (i = 0; i < ENET_RXBUFF_NUM; i++) - { - if (!ethernetif->RxPbufs[i].buffer_used) - { - ethernetif->RxPbufs[i].buffer_used = true; - buffer = ðernetif->RxDataBuff[i]; - break; - } - } - - SYS_ARCH_UNPROTECT(old_level); - - return buffer; -} - -/** - * Callback for release of RX zero-copy buffer from ENET driver. - */ -static void ethernetif_rx_free(ENET_Type *base, void *buffer, void *userData, uint8_t ringId) -{ - struct netif *netif = (struct netif *)userData; - struct ethernetif *ethernetif = netif->state; - int idx = ((rx_buffer_t *)buffer) - ethernetif->RxDataBuff; - LWIP_ASSERT("Freed buffer out of range", ((idx >= 0) && (idx < ENET_RXBUFF_NUM))); - - SYS_ARCH_DECL_PROTECT(old_level); - SYS_ARCH_PROTECT(old_level); - - LWIP_ASSERT("ethernetif_rx_free: freeing unallocated buffer", ethernetif->RxPbufs[idx].buffer_used); - ethernetif->RxPbufs[idx].buffer_used = false; - - SYS_ARCH_UNPROTECT(old_level); -} - -/** - * Initializes ENET driver. - */ -void ethernetif_enet_init(struct netif *netif, - struct ethernetif *ethernetif, - const ethernetif_config_t *ethernetifConfig) -{ - enet_config_t config; - uint32_t sysClock; - enet_buffer_config_t buffCfg[ENET_RING_NUM]; - phy_speed_t speed; - phy_duplex_t duplex; - int i; - - /* prepare the buffer configuration. */ - buffCfg[0].rxBdNumber = ENET_RXBD_NUM; /* Receive buffer descriptor number. */ - buffCfg[0].txBdNumber = ENET_TXBD_NUM; /* Transmit buffer descriptor number. */ - buffCfg[0].rxBuffSizeAlign = sizeof(rx_buffer_t); /* Aligned receive data buffer size. */ - buffCfg[0].txBuffSizeAlign = sizeof(tx_buffer_t); /* Aligned transmit data buffer size. */ - buffCfg[0].rxBdStartAddrAlign = - &(ethernetif->RxBuffDescrip[0]); /* Aligned receive buffer descriptor start address. */ - buffCfg[0].txBdStartAddrAlign = - &(ethernetif->TxBuffDescrip[0]); /* Aligned transmit buffer descriptor start address. */ - buffCfg[0].rxBufferAlign = - NULL; /* Receive data buffer start address. NULL when buffers are allocated by callback for RX zero-copy. */ - buffCfg[0].txBufferAlign = &(ethernetif->TxDataBuff[0][0]); /* Transmit data buffer start address. */ - buffCfg[0].txFrameInfo = NULL; /* Transmit frame information start address. Set only if using zero-copy transmit. */ - buffCfg[0].rxMaintainEnable = true; /* Receive buffer cache maintain. */ - buffCfg[0].txMaintainEnable = true; /* Transmit buffer cache maintain. */ - - sysClock = ethernetifConfig->phyHandle->mdioHandle->resource.csrClock_Hz; - - ENET_GetDefaultConfig(&config); - config.ringNum = ENET_RING_NUM; - config.rxBuffAlloc = ethernetif_rx_alloc; - config.rxBuffFree = ethernetif_rx_free; - config.userData = netif; -#ifdef LWIP_ENET_FLEXIBLE_CONFIGURATION - extern void BOARD_ENETFlexibleConfigure(enet_config_t * config); - BOARD_ENETFlexibleConfigure(&config); -#endif - - ethernetif_phy_init(ethernetif, ethernetifConfig, &speed, &duplex); - config.miiSpeed = (enet_mii_speed_t)speed; - config.miiDuplex = (enet_mii_duplex_t)duplex; - -#if USE_RTOS && defined(SDK_OS_FREE_RTOS) - uint32_t instance; - static ENET_Type *const enetBases[] = ENET_BASE_PTRS; - static const IRQn_Type enetTxIrqId[] = ENET_Transmit_IRQS; - /*! @brief Pointers to enet receive IRQ number for each instance. */ - static const IRQn_Type enetRxIrqId[] = ENET_Receive_IRQS; -#if defined(ENET_ENHANCEDBUFFERDESCRIPTOR_MODE) && ENET_ENHANCEDBUFFERDESCRIPTOR_MODE - /*! @brief Pointers to enet timestamp IRQ number for each instance. */ - static const IRQn_Type enetTsIrqId[] = ENET_1588_Timer_IRQS; -#endif /* ENET_ENHANCEDBUFFERDESCRIPTOR_MODE */ - - /* Create the Event for transmit busy release trigger. */ - ethernetif->enetTransmitAccessEvent = xEventGroupCreate(); - ethernetif->txFlag = 0x1; - - config.interrupt |= - kENET_RxFrameInterrupt | kENET_TxFrameInterrupt | kENET_TxBufferInterrupt | kENET_LateCollisionInterrupt; - config.callback = ethernet_callback; - - for (instance = 0; instance < ARRAY_SIZE(enetBases); instance++) - { - if (enetBases[instance] == ethernetif->base) - { -#ifdef __CA7_REV - GIC_SetPriority(enetRxIrqId[instance], ENET_PRIORITY); - GIC_SetPriority(enetTxIrqId[instance], ENET_PRIORITY); -#if defined(ENET_ENHANCEDBUFFERDESCRIPTOR_MODE) && ENET_ENHANCEDBUFFERDESCRIPTOR_MODE - GIC_SetPriority(enetTsIrqId[instance], ENET_1588_PRIORITY); -#endif /* ENET_ENHANCEDBUFFERDESCRIPTOR_MODE */ -#else - NVIC_SetPriority(enetRxIrqId[instance], ENET_PRIORITY); - NVIC_SetPriority(enetTxIrqId[instance], ENET_PRIORITY); -#if defined(ENET_ENHANCEDBUFFERDESCRIPTOR_MODE) && ENET_ENHANCEDBUFFERDESCRIPTOR_MODE - NVIC_SetPriority(enetTsIrqId[instance], ENET_1588_PRIORITY); -#endif /* ENET_ENHANCEDBUFFERDESCRIPTOR_MODE */ -#endif /* __CA7_REV */ - break; - } - } - - LWIP_ASSERT("Input Ethernet base error!", (instance != ARRAY_SIZE(enetBases))); -#endif /* USE_RTOS */ - - for (i = 0; i < ENET_RXBUFF_NUM; i++) - { - ethernetif->RxPbufs[i].p.custom_free_function = ethernetif_rx_release; - ethernetif->RxPbufs[i].buffer = &(ethernetif->RxDataBuff[i][0]); - ethernetif->RxPbufs[i].buffer_used = false; - ethernetif->RxPbufs[i].netif = netif; - } - - /* Initialize the ENET module. */ - ENET_Init(ethernetif->base, ðernetif->handle, &config, &buffCfg[0], netif->hwaddr, sysClock); - - ENET_ActiveRead(ethernetif->base); -} - -void **ethernetif_enet_ptr(struct ethernetif *ethernetif) -{ - return (void **)&(ethernetif->base); -} - -/** - * Returns next buffer for TX. - * Can wait if no buffer available. - */ -static unsigned char *enet_get_tx_buffer(struct ethernetif *ethernetif) -{ - static unsigned char ucBuffer[ENET_FRAME_MAX_FRAMELEN]; - return ucBuffer; -} - -/** - * Sends frame via ENET. - */ -static err_t enet_send_frame(struct ethernetif *ethernetif, unsigned char *data, const uint32_t length) -{ -#if USE_RTOS && defined(SDK_OS_FREE_RTOS) - { - status_t result; - - do - { - result = ENET_SendFrame(ethernetif->base, ðernetif->handle, data, length, 0, false, NULL); - - if (result == kStatus_ENET_TxFrameBusy) - { - xEventGroupWaitBits(ethernetif->enetTransmitAccessEvent, ethernetif->txFlag, pdTRUE, (BaseType_t) false, - portMAX_DELAY); - } - - } while (result == kStatus_ENET_TxFrameBusy); - return ERR_OK; - } -#else - { - uint32_t counter; - - for (counter = ENET_TIMEOUT; counter != 0U; counter--) - { - if (ENET_SendFrame(ethernetif->base, ðernetif->handle, data, length, 0, false, NULL) != - kStatus_ENET_TxFrameBusy) - { - return ERR_OK; - } - } - - return ERR_TIMEOUT; - } -#endif -} - -/** - * Reclaims RX buffer held by the p after p is no longer used - * by the application / lwIP. - */ -static void ethernetif_rx_release(struct pbuf *p) -{ - rx_pbuf_wrapper_t *wrapper = (rx_pbuf_wrapper_t *)p; - struct netif *netif = wrapper->netif; - struct ethernetif *ethernetif = netif->state; - - ethernetif_rx_free(ethernetif->base, wrapper->buffer, netif, 0); -} - -/** Wraps received buffer(s) into a pbuf or a pbuf chain and returns it. */ -static struct pbuf *ethernetif_rx_frame_to_pbufs(struct ethernetif *ethernetif, enet_rx_frame_struct_t *rxFrame) -{ - void *buffer; - uint16_t bufferLength; - rx_pbuf_wrapper_t *wrapper; - uint16_t len = 0U; - struct pbuf *p = NULL; - struct pbuf *q = NULL; - int idx; - int i; - - for (i = 0; ((i < MAX_BUFFERS_PER_FRAME) && (len < rxFrame->totLen)); i++) - { - buffer = rxFrame->rxBuffArray[i].buffer; - bufferLength = rxFrame->rxBuffArray[i].length; - len += bufferLength; - - /* Find pbuf wrapper for the actually read byte buffer */ - idx = ((rx_buffer_t *)buffer) - ethernetif->RxDataBuff; - LWIP_ASSERT("Buffer returned by ENET_GetRxFrame() doesn't match any RX buffer descriptor", - ((idx >= 0) && (idx < ENET_RXBUFF_NUM))); - wrapper = ðernetif->RxPbufs[idx]; - LWIP_ASSERT("Buffer returned by ENET_GetRxFrame() doesn't match wrapper buffer", wrapper->buffer == buffer); - - /* Wrap the received buffer in pbuf. */ - if (p == NULL) - { - p = pbuf_alloced_custom(PBUF_RAW, bufferLength, PBUF_REF, &wrapper->p, buffer, bufferLength); - LWIP_ASSERT("pbuf_alloced_custom() failed", p); - } - else - { - q = pbuf_alloced_custom(PBUF_RAW, bufferLength, PBUF_REF, &wrapper->p, buffer, bufferLength); - LWIP_ASSERT("pbuf_alloced_custom() failed", q); - - pbuf_cat(p, q); - } - } - - LWIP_ASSERT("p->tot_len != rxFrame->totLen", p->tot_len == rxFrame->totLen); - - return p; -} - -struct pbuf *ethernetif_linkinput(struct netif *netif) -{ - struct ethernetif *ethernetif = netif->state; - enet_buffer_struct_t buffers[MAX_BUFFERS_PER_FRAME]; - enet_rx_frame_struct_t rxFrame = {.rxBuffArray = &buffers[0]}; - struct pbuf *p = NULL; - status_t status; - - /* Read frame. */ - status = ENET_GetRxFrame(ethernetif->base, ðernetif->handle, &rxFrame, 0); - - switch (status) - { - case kStatus_Success: - /* Frame read, process it into pbufs. */ - p = ethernetif_rx_frame_to_pbufs(ethernetif, &rxFrame); - - MIB2_STATS_NETIF_ADD(netif, ifinoctets, p->tot_len); - if (((u8_t *)p->payload)[0] & 1) - { - /* broadcast or multicast packet */ - MIB2_STATS_NETIF_INC(netif, ifinnucastpkts); - } - else - { - /* unicast packet */ - MIB2_STATS_NETIF_INC(netif, ifinucastpkts); - } - - LINK_STATS_INC(link.recv); - - break; - - case kStatus_ENET_RxFrameEmpty: - /* Frame not available. */ - break; - - case kStatus_ENET_RxFrameError: - /* Error receiving frame */ - LWIP_DEBUGF(NETIF_DEBUG, ("ethernetif_linkinput: RxFrameError\n")); - LINK_STATS_INC(link.drop); - MIB2_STATS_NETIF_INC(netif, ifindiscards); - break; - - case kStatus_ENET_RxFrameDrop: - /* Frame received, but it had to be dropped - * because new buffer(s) allocation failed in the ENET driver. */ - LINK_STATS_INC(link.drop); - MIB2_STATS_NETIF_INC(netif, ifindiscards); - break; - - default: - LWIP_ASSERT("Unhandled return value.", 0); - break; - } - - return p; -} - -err_t ethernetif_linkoutput(struct netif *netif, struct pbuf *p) -{ - err_t result; - struct ethernetif *ethernetif = netif->state; - struct pbuf *q; - unsigned char *pucBuffer; - unsigned char *pucChar; - - LWIP_ASSERT("Output packet buffer empty", p); - - pucBuffer = enet_get_tx_buffer(ethernetif); - if (pucBuffer == NULL) - { - return ERR_BUF; - } - - /* Initiate transfer. */ - -#if ETH_PAD_SIZE - pbuf_header(p, -ETH_PAD_SIZE); /* drop the padding word */ -#endif - - if (p->len == p->tot_len) - { - /* No pbuf chain, don't have to copy -> faster. */ - pucBuffer = (unsigned char *)p->payload; - } - else - { - /* pbuf chain, copy into contiguous ucBuffer. */ - if (p->tot_len > ENET_FRAME_MAX_FRAMELEN) - { - return ERR_BUF; - } - else - { - pucChar = pucBuffer; - - for (q = p; q != NULL; q = q->next) - { - /* Send the data from the pbuf to the interface, one pbuf at a - time. The size of the data in each pbuf is kept in the ->len - variable. */ - /* send data from(q->payload, q->len); */ - memcpy(pucChar, q->payload, q->len); - pucChar += q->len; - } - } - } - - /* Send frame. */ - result = enet_send_frame(ethernetif, pucBuffer, p->tot_len); - - MIB2_STATS_NETIF_ADD(netif, ifoutoctets, p->tot_len); - if (((u8_t *)p->payload)[0] & 1) - { - /* broadcast or multicast packet*/ - MIB2_STATS_NETIF_INC(netif, ifoutnucastpkts); - } - else - { - /* unicast packet */ - MIB2_STATS_NETIF_INC(netif, ifoutucastpkts); - } - /* increase ifoutdiscards or ifouterrors on error */ - -#if ETH_PAD_SIZE - pbuf_header(p, ETH_PAD_SIZE); /* reclaim the padding word */ -#endif - - LINK_STATS_INC(link.xmit); - - return result; -} - -/** - * Should be called at the beginning of the program to set up the - * first network interface. It calls the function ethernetif_init() to do the - * actual setup of the hardware. - * - * This function should be passed as a parameter to netif_add(). - * - * @param netif the lwip network interface structure for this ethernetif - * @return ERR_OK if the loopif is initialized - * ERR_MEM if private data couldn't be allocated - * any other err_t on error - */ -err_t ethernetif0_init(struct netif *netif) -{ - static struct ethernetif ethernetif_0; - AT_NONCACHEABLE_SECTION_ALIGN(static enet_rx_bd_struct_t rxBuffDescrip_0[ENET_RXBD_NUM], FSL_ENET_BUFF_ALIGNMENT); - AT_NONCACHEABLE_SECTION_ALIGN(static enet_tx_bd_struct_t txBuffDescrip_0[ENET_TXBD_NUM], FSL_ENET_BUFF_ALIGNMENT); - SDK_ALIGN(static rx_buffer_t rxDataBuff_0[ENET_RXBUFF_NUM], FSL_ENET_BUFF_ALIGNMENT); - SDK_ALIGN(static tx_buffer_t txDataBuff_0[ENET_TXBD_NUM], FSL_ENET_BUFF_ALIGNMENT); - - ethernetif_0.RxBuffDescrip = &(rxBuffDescrip_0[0]); - ethernetif_0.TxBuffDescrip = &(txBuffDescrip_0[0]); - ethernetif_0.RxDataBuff = &(rxDataBuff_0[0]); - ethernetif_0.TxDataBuff = &(txDataBuff_0[0]); - - return ethernetif_init(netif, ðernetif_0, ethernetif_get_enet_base(0U), (ethernetif_config_t *)netif->state); -} - -#if defined(FSL_FEATURE_SOC_ENET_COUNT) && (FSL_FEATURE_SOC_ENET_COUNT > 1) -/** - * Should be called at the beginning of the program to set up the - * second network interface. It calls the function ethernetif_init() to do the - * actual setup of the hardware. - * - * This function should be passed as a parameter to netif_add(). - * - * @param netif the lwip network interface structure for this ethernetif - * @return ERR_OK if the loopif is initialized - * ERR_MEM if private data couldn't be allocated - * any other err_t on error - */ -err_t ethernetif1_init(struct netif *netif) -{ - static struct ethernetif ethernetif_1; - AT_NONCACHEABLE_SECTION_ALIGN(static enet_rx_bd_struct_t rxBuffDescrip_1[ENET_RXBD_NUM], FSL_ENET_BUFF_ALIGNMENT); - AT_NONCACHEABLE_SECTION_ALIGN(static enet_tx_bd_struct_t txBuffDescrip_1[ENET_TXBD_NUM], FSL_ENET_BUFF_ALIGNMENT); - SDK_ALIGN(static rx_buffer_t rxDataBuff_1[ENET_RXBUFF_NUM], FSL_ENET_BUFF_ALIGNMENT); - SDK_ALIGN(static tx_buffer_t txDataBuff_1[ENET_TXBD_NUM], FSL_ENET_BUFF_ALIGNMENT); - - ethernetif_1.RxBuffDescrip = &(rxBuffDescrip_1[0]); - ethernetif_1.TxBuffDescrip = &(txBuffDescrip_1[0]); - ethernetif_1.RxDataBuff = &(rxDataBuff_1[0]); - ethernetif_1.TxDataBuff = &(txDataBuff_1[0]); - - return ethernetif_init(netif, ðernetif_1, ethernetif_get_enet_base(1U), (ethernetif_config_t *)netif->state); -} -#endif /* FSL_FEATURE_SOC_*_ENET_COUNT */ diff --git a/Middleware/NXP/lwip_ethernet/enet_ethernetif_priv.h b/Middleware/NXP/lwip_ethernet/enet_ethernetif_priv.h deleted file mode 100644 index 9ba9a86..0000000 --- a/Middleware/NXP/lwip_ethernet/enet_ethernetif_priv.h +++ /dev/null @@ -1,80 +0,0 @@ -/* - * Copyright 2019 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#ifndef ENET_ETHERNETIF_PRIV_H -#define ENET_ETHERNETIF_PRIV_H - -#include "lwip/err.h" - -struct ethernetif; - -#if defined(__cplusplus) -extern "C" { -#endif /* __cplusplus */ - -err_t ethernetif_init(struct netif *netif, struct ethernetif *ethernetif, - void *enetBase, - const ethernetif_config_t *ethernetifConfig); - -void ethernetif_enet_init(struct netif *netif, struct ethernetif *ethernetif, - const ethernetif_config_t *ethernetifConfig); - -void ethernetif_phy_init(struct ethernetif *ethernetif, - const ethernetif_config_t *ethernetifConfig, - phy_speed_t *speed, - phy_duplex_t *duplex); - -void *ethernetif_get_enet_base(const uint8_t enetIdx); - -#if defined(FSL_FEATURE_SOC_ENET_QOS_COUNT) && (FSL_FEATURE_SOC_ENET_QOS_COUNT > 0) -void *ethernetif_get_enet_qos_base(const uint8_t enetIdx); -#endif - -void **ethernetif_enet_ptr(struct ethernetif *ethernetif); - -#if LWIP_IPV4 && LWIP_IGMP -err_t ethernetif_igmp_mac_filter(struct netif *netif, const ip4_addr_t *group, - enum netif_mac_filter_action action); -#endif - -#if LWIP_IPV6 && LWIP_IPV6_MLD -err_t ethernetif_mld_mac_filter(struct netif *netif, const ip6_addr_t *group, - enum netif_mac_filter_action action); -#endif - -/** - * Should allocate a pbuf and transfer the bytes of the incoming - * packet from the interface into the pbuf. - * - * @param netif the lwip network interface structure for this ethernetif - * @return a pbuf filled with the received packet (including MAC header) - * NULL on memory error - */ -struct pbuf *ethernetif_linkinput(struct netif *netif); - -/** - * This function should do the actual transmission of the packet. The packet is - * contained in the pbuf that is passed to the function. This pbuf - * might be chained. - * - * @param netif the lwip network interface structure for this ethernetif - * @param p the MAC packet to send (e.g. IP packet including MAC addresses and type) - * @return ERR_OK if the packet could be sent - * an err_t value if the packet couldn't be sent - * - * @note Returning ERR_MEM here if a DMA queue of your MAC is full can lead to - * strange results. You might consider waiting for space in the DMA queue - * to become available since the stack doesn't retry to send a packet - * dropped because of memory failure (except for the TCP timers). - */ -err_t ethernetif_linkoutput(struct netif *netif, struct pbuf *p); - -#if defined(__cplusplus) -} -#endif /* __cplusplus */ - -#endif /* ENET_ETHERNETIF_PRIV_H */ diff --git a/examples/evkbmimxrt1060/test/README.md b/examples/evkbmimxrt1060/test/README.md deleted file mode 100644 index 6998c37..0000000 --- a/examples/evkbmimxrt1060/test/README.md +++ /dev/null @@ -1,107 +0,0 @@ -## MQTT Publish Subscribe Demo - -### Introduction -This example demonstrates multiple MQTT publish subscribe task running concurrently with Over-The-Air firmware update background task, using coreMQTT agent libary to manage the thread safety for the MQTT connection.Each publish subscribe task runs in a loop to publish a message to AWS IoT MQTT broker on a topic, and receive same message back by subscribing to the publish topic. Topics are constructed per device and per task for this demo. You can view the number of messages published by each task by logging to AWS IoT console and subscribing to respective topics. -OTA firmware update task runs OTA Agent loop which polls for and subscribes to OTA job requests from AWS IoT OTA service. The OTA agent task receives firmware chunks and sends control packets over MQTT, concurrently using coreMQTT agent task for thread safety. - -### Hardware requirements - -- Mini/micro USB cable -- MIMXRT1060-EVKB board -- OM-SE050ARD Development kit -- Personal Computer with Windows platform -- Network cable RJ45 standard (Network with Internet access) - -### Toolchain Requirements - -- MCUXpresso IDE -- python3 and pip -- openssl - -### Board Setup - -1. Plug in the OM-SE050ARD development kit to arduino headers on the MIMXRT1060-EVKB board. -3. Connect the USB cable between the personal computer and open SDA USB port (J1) on the board. -2. Connect the RJ45 cable to the ethernet port. - -### Preparing the demo - -#### Setting up the bootloader project - -The demo contains firmware over the air updates functionality for which the secure bootloader is required. To setup, build and flash bootloader project see the [README](https://github.com/FreeRTOS/lab-iot-reference-nxp-rt1060/tree/main/examples/evkbmimxrt1060/bootloader/README.md). - -#### Setting up the demo project - -1. Open the MCUXpresso IDE and choose a workspace location in your filesystem. -2. Click on `File` then `Open Projects from the FileSystem`. Choose the project from folder `projects/evkmimxrt1060/pubsub`. Import the project into the workspace. -3. Build and flash the demo from the IDE. -4. The project is configured to flash the demo to an address known to the bootloader. To boot a new application image from IDE, we have to jump start the application from the debugger. To do so: - a. Launch the application as normal from the debugger IDE. The debugger goes into an endless loop after flashing the image. - b. Pause the debugger. Go to `Debugger Console` in the bottom pane and type `jump ResetISR` to jump to application starting address. From then, application execution can be continued normally. - -### Provisioning the board - -The project requires a one time setup of MQTT broker endpoint and device credentials required for connecting to AWS IoT core, and also the thing name by which the device is registered with AWS IoT. - -1. By default the project boots into a provision mode at startup where all the configuration can be setup. The provisioning mode can be controlled using the flag `appmainPROVISIONING_MODE` in `examples/evkbmimxrt1060/pubsub/app_main.c`. -2. The provisioning mode waits for user input commands from a CLI task. -3. Connect to the USB port using a serial terminal of the choice. -4. Run the following command to get the pre-provisioned X.509 certificate from secure element: -``` -pki get cert sss:F0000001 -``` -`sss:F0000001` is the slot where the certificate is stored in secure element. - -5. Copy the PEM certificate from console and register the certificate with AWS IoT without a CA using doc [here](https://docs.aws.amazon.com/iot/latest/developerguide/manual-cert-registration.html#manual-cert-registration-console-noca). - -6. Get the AWS IoT MQTT broker endpoint from `Settings` tab in AWS IoT console. Provision the endpoint by executing the following command: -``` -conf set mqtt_endpoint -``` -7. Create a new thing, device policy in AWS as mentioned in the doc [here](https://docs.aws.amazon.com/iot/latest/developerguide/create-iot-resources.html). Attach the certificate registered in step 5 with the thing name. Provision the new thing name to the device: -``` -conf set thing_name -``` -8. Once the configurations are setup turn off the provisioning mode by setting `appmainPROVISIONING_MODE` to `0` and then recompiling and flashing the image onto the board. - -### Runnning the publish subscribe demo - -The board should be successfully provisioned at this time. Provisioning mode should be turned off by seting `appmainPROVISIONING_MODE` to `0` in `examples/evkbmimxrt1060/pubsub/app_main.c`. Demo on startup, establishes a TLS connection with AWS IoT MQTT broker and runs the publish subscribe demo tasks using coreMQTT agent. By default two pubsub task are created. You can adjust the number of tasks created by setting the config `appmainMQTT_NUM_PUBSUB_TASKS` in `examples/evkbmimxrt1060/pubsub/app_main.c` to respective value. - -### Perform Firmware Over-The-Air Updates with AWS IoT - -The demo leverages OTA client library and AWS IoT OTA service for code signing and secure download of firmware updates. Safe and secure boot process along with root of trust verification is performed using opensource MCUBoot secondary bootloader. As a pre-requisite you should have built and flash the bootloader project from this repository. - -#### Setup -This is a one time setup required for performing OTA firmware updates. - -1. Setup AWS IoT OTA service resources as mentioned in pre-requisites doc [here](https://docs.aws.amazon.com/freertos/latest/userguide/ota-prereqs.html). -2. Create ECDSA credentials to perform code signing verification by the OTA library. You can refer to the doc [here](https://docs.aws.amazon.com/freertos/latest/userguide/ota-code-sign-cert-win.html) on how to create the credentials and register a new code signing profile in your AWS account. -3. Provision the code signining public key to the board using the steps below. - 1. Get the ECDSA public key from the code signing credentials generated in step 2: - ``` - openssl ec -in ecdsasigner.key -outform PEM -out ecdsasigner-pub-key.pem - ``` - 2. Switch to device provisioning mode by setting `appmainPROVISIONING_MODE` to `1`, recompiling and downloading the firmware. - 3. On the terminal CLI prompt, run the following command: - ``` - pki set pub_key sss:00223344 - ``` - 4. CLI waits to input the public key. Copy the PEM public key created in above step and paste it to serial terminal. Press `Enter`. - 5. On successful provisioning, the CLI should print `OK`. At this point you can switch back to device normal mode by turning off `appmainPROVISIONING_MODE` flag. - -#### Creating a new firmware update job - -1. Go to `examples/common/ota/ota_update.c` and increment the version number `APP_VERSION_MAJOR` for the new image. -2. Build the new image. -3. Sign the new binary image using MCUBoot key-pair generated as part of setting up the bootloader project. From the repository root folder execute following command: -``` -python3 Middleware/mcuboot/scripts/imgtool.py sign -k examples/evkbmimxrt1060/bootloader/keys/ --align 4 --header-size 0x400 --pad-header --slot-size 0x200000 --max-sectors 800 --version "1.0" projects/evkmimxrt1060/pubsub/Debug/aws_iot_pubsub.bin aws_iot_pubsub_signed.bin -``` -This should create a new signed MCUboot image named `aws_iot_pubsub_signed.bin` - -4. Create a firmware update job using the signed image following the steps [here](https://docs.aws.amazon.com/freertos/latest/userguide/ota-console-workflow.html). -5. Once the job is create successfully, the demo should start downloading the firmware chunks. The process can be monitored using logs from the console. - -#### Verification and Bootup of new Image -Once all the firmware image chunks are downloaded and the signature is validated, the demo resets by itself. MCUBoot loader verifies the new image using the signing public key created as part of bootloader project. Once the image is verified, the bootloader swaps the image and boots up the new image. The new image on booting up verifies the image version with AWS IoT and marks the job as completed successfully. diff --git a/examples/evkbmimxrt1060/test/app_main.c b/examples/evkbmimxrt1060/test/app_main.c deleted file mode 100644 index 6c3ddb7..0000000 --- a/examples/evkbmimxrt1060/test/app_main.c +++ /dev/null @@ -1,161 +0,0 @@ -/* - * Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - * http://www.FreeRTOS.org - * http://aws.amazon.com/freertos - */ - - -/** - * @brief Contains the application main function which spawns different demo tasks - * included in the project. - */ - -#include "FreeRTOS.h" -#include "task.h" -#include "kvstore.h" -#include "mqtt_agent_task.h" -#include "test_execution_config.h" - - -#define appmainPROVISIONING_MODE ( 0 ) - - -#define appmainMQTT_OTA_UPDATE_TASK_STACK_SIZE ( 4096 ) -#define appmainMQTT_OTA_UPDATE_TASK_PRIORITY ( tskIDLE_PRIORITY + 1 ) - -#define appmainTEST_TASK_STACK_SIZE ( 6144 ) -#define appmainTEST_TASK_PRIORITY ( tskIDLE_PRIORITY + 1 ) - -#define appmainCLI_TASK_STACK_SIZE ( 6144 ) -#define appmainCLI_TASK_PRIORITY ( tskIDLE_PRIORITY + 1 ) - -#define appmainMQTT_OTA_UPDATE_TASK_STACK_SIZE ( 4096 ) -#define appmainMQTT_OTA_UPDATE_TASK_PRIORITY ( tskIDLE_PRIORITY + 1 ) - -/** - * @brief Stack size and priority for MQTT agent task. - * Stack size is capped to an adequate value based on requirements from MbedTLS stack - * for establishing a TLS connection. Task priority of MQTT agent is set to a priority - * higher than other MQTT application tasks, so that the agent can drain the queue - * as work is being produced. - */ -#define appmainMQTT_AGENT_TASK_STACK_SIZE ( 6144 ) -#define appmainMQTT_AGENT_TASK_PRIORITY ( tskIDLE_PRIORITY + 2 ) - -extern void prvQualificationTestTask( void * pvParameters ); - -extern void vSubscribePublishTestTask( void * pvParameters ); - -extern void vCLITask( void * pvParam ); - -extern void vOTAUpdateTask( void * pvParam ); - -int RunDeviceAdvisorDemo( void ) -{ - BaseType_t xResult = pdFAIL; - - if( xGetMQTTAgentState() < MQTT_AGENT_STATE_INITIALIZED ) - { - xResult = xMQTTAgentInit( appmainMQTT_AGENT_TASK_STACK_SIZE, appmainMQTT_AGENT_TASK_PRIORITY ); - } - else - { - xResult = pdPASS; - } - - if( xResult == pdPASS ) - { - xResult = xTaskCreate( vSubscribePublishTestTask, - "TEST", - appmainTEST_TASK_STACK_SIZE, - NULL, - appmainTEST_TASK_PRIORITY, - NULL ); - } - - return ( xResult == pdPASS ) ? 0 : -1; -} - -int RunOtaE2eDemo( void ) -{ - BaseType_t xResult = pdFAIL; - - if( xGetMQTTAgentState() < MQTT_AGENT_STATE_INITIALIZED ) - { - xResult = xMQTTAgentInit( appmainMQTT_AGENT_TASK_STACK_SIZE, appmainMQTT_AGENT_TASK_PRIORITY ); - } - else - { - xResult = pdPASS; - } - - if( xResult == pdPASS ) - { - xResult = xTaskCreate( vOTAUpdateTask, - "OTA", - appmainMQTT_OTA_UPDATE_TASK_STACK_SIZE, - NULL, - appmainMQTT_OTA_UPDATE_TASK_PRIORITY, - NULL ); - } - - return ( xResult == pdPASS ) ? 0 : -1; -} - -int app_main( void ) -{ - BaseType_t xResult = pdFAIL; - - xResult = KVStore_init(); - - if( xResult == pdFAIL ) - { - configPRINTF( ( "Failed to initialize key value configuration store.\r\n" ) ); - } - -#if ( appmainPROVISIONING_MODE == 1 ) - { - if( xResult == pdPASS ) - { - xResult = xTaskCreate( vCLITask, - "CLI", - appmainCLI_TASK_STACK_SIZE, - NULL, - appmainCLI_TASK_PRIORITY, - NULL ); - } - } -#endif /* if ( appmainPROVISIONING_MODE == 1 ) */ - - { - if( xResult == pdPASS ) - { - xResult = xTaskCreate( prvQualificationTestTask, - "TEST", - appmainTEST_TASK_STACK_SIZE, - NULL, - appmainTEST_TASK_PRIORITY, - NULL ); - } - } - - return pdPASS; -} diff --git a/examples/evkbmimxrt1060/test/board/board.c b/examples/evkbmimxrt1060/test/board/board.c deleted file mode 100644 index 8f20928..0000000 --- a/examples/evkbmimxrt1060/test/board/board.c +++ /dev/null @@ -1,416 +0,0 @@ -/* - * Copyright 2018-2019 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "fsl_common.h" -#include "fsl_debug_console.h" -#include "board.h" -#if defined( SDK_I2C_BASED_COMPONENT_USED ) && SDK_I2C_BASED_COMPONENT_USED -#include "fsl_lpi2c.h" -#endif /* SDK_I2C_BASED_COMPONENT_USED */ -#include "fsl_iomuxc.h" - -/******************************************************************************* - * Variables - ******************************************************************************/ - -/******************************************************************************* - * Code - ******************************************************************************/ - -/* Get debug console frequency. */ -uint32_t BOARD_DebugConsoleSrcFreq( void ) -{ - uint32_t freq; - - /* To make it simple, we assume default PLL and divider settings, and the only variable - * from application is use PLL3 source or OSC source */ - if( CLOCK_GetMux( kCLOCK_UartMux ) == 0 ) /* PLL3 div6 80M */ - { - freq = ( CLOCK_GetPllFreq( kCLOCK_PllUsb1 ) / 6U ) / ( CLOCK_GetDiv( kCLOCK_UartDiv ) + 1U ); - } - else - { - freq = CLOCK_GetOscFreq() / ( CLOCK_GetDiv( kCLOCK_UartDiv ) + 1U ); - } - - return freq; -} - -/* Initialize debug console. */ -void BOARD_InitDebugConsole( void ) -{ - uint32_t uartClkSrcFreq = BOARD_DebugConsoleSrcFreq(); - - DbgConsole_Init( BOARD_DEBUG_UART_INSTANCE, BOARD_DEBUG_UART_BAUDRATE, BOARD_DEBUG_UART_TYPE, uartClkSrcFreq ); -} - -#if defined( SDK_I2C_BASED_COMPONENT_USED ) && SDK_I2C_BASED_COMPONENT_USED -void BOARD_LPI2C_Init( LPI2C_Type * base, - uint32_t clkSrc_Hz ) -{ - lpi2c_master_config_t lpi2cConfig = { 0 }; - - /* - * lpi2cConfig.debugEnable = false; - * lpi2cConfig.ignoreAck = false; - * lpi2cConfig.pinConfig = kLPI2C_2PinOpenDrain; - * lpi2cConfig.baudRate_Hz = 100000U; - * lpi2cConfig.busIdleTimeout_ns = 0; - * lpi2cConfig.pinLowTimeout_ns = 0; - * lpi2cConfig.sdaGlitchFilterWidth_ns = 0; - * lpi2cConfig.sclGlitchFilterWidth_ns = 0; - */ - LPI2C_MasterGetDefaultConfig( &lpi2cConfig ); - LPI2C_MasterInit( base, &lpi2cConfig, clkSrc_Hz ); -} - -status_t BOARD_LPI2C_Send( LPI2C_Type * base, - uint8_t deviceAddress, - uint32_t subAddress, - uint8_t subAddressSize, - uint8_t * txBuff, - uint8_t txBuffSize ) -{ - lpi2c_master_transfer_t xfer; - - xfer.flags = kLPI2C_TransferDefaultFlag; - xfer.slaveAddress = deviceAddress; - xfer.direction = kLPI2C_Write; - xfer.subaddress = subAddress; - xfer.subaddressSize = subAddressSize; - xfer.data = txBuff; - xfer.dataSize = txBuffSize; - - return LPI2C_MasterTransferBlocking( base, &xfer ); -} - -status_t BOARD_LPI2C_Receive( LPI2C_Type * base, - uint8_t deviceAddress, - uint32_t subAddress, - uint8_t subAddressSize, - uint8_t * rxBuff, - uint8_t rxBuffSize ) -{ - lpi2c_master_transfer_t xfer; - - xfer.flags = kLPI2C_TransferDefaultFlag; - xfer.slaveAddress = deviceAddress; - xfer.direction = kLPI2C_Read; - xfer.subaddress = subAddress; - xfer.subaddressSize = subAddressSize; - xfer.data = rxBuff; - xfer.dataSize = rxBuffSize; - - return LPI2C_MasterTransferBlocking( base, &xfer ); -} - -status_t BOARD_LPI2C_SendSCCB( LPI2C_Type * base, - uint8_t deviceAddress, - uint32_t subAddress, - uint8_t subAddressSize, - uint8_t * txBuff, - uint8_t txBuffSize ) -{ - lpi2c_master_transfer_t xfer; - - xfer.flags = kLPI2C_TransferDefaultFlag; - xfer.slaveAddress = deviceAddress; - xfer.direction = kLPI2C_Write; - xfer.subaddress = subAddress; - xfer.subaddressSize = subAddressSize; - xfer.data = txBuff; - xfer.dataSize = txBuffSize; - - return LPI2C_MasterTransferBlocking( base, &xfer ); -} - -status_t BOARD_LPI2C_ReceiveSCCB( LPI2C_Type * base, - uint8_t deviceAddress, - uint32_t subAddress, - uint8_t subAddressSize, - uint8_t * rxBuff, - uint8_t rxBuffSize ) -{ - status_t status; - lpi2c_master_transfer_t xfer; - - xfer.flags = kLPI2C_TransferDefaultFlag; - xfer.slaveAddress = deviceAddress; - xfer.direction = kLPI2C_Write; - xfer.subaddress = subAddress; - xfer.subaddressSize = subAddressSize; - xfer.data = NULL; - xfer.dataSize = 0; - - status = LPI2C_MasterTransferBlocking( base, &xfer ); - - if( kStatus_Success == status ) - { - xfer.subaddressSize = 0; - xfer.direction = kLPI2C_Read; - xfer.data = rxBuff; - xfer.dataSize = rxBuffSize; - - status = LPI2C_MasterTransferBlocking( base, &xfer ); - } - - return status; -} - -void BOARD_Accel_I2C_Init( void ) -{ - BOARD_LPI2C_Init( BOARD_ACCEL_I2C_BASEADDR, BOARD_ACCEL_I2C_CLOCK_FREQ ); -} - -status_t BOARD_Accel_I2C_Send( uint8_t deviceAddress, - uint32_t subAddress, - uint8_t subaddressSize, - uint32_t txBuff ) -{ - uint8_t data = ( uint8_t ) txBuff; - - return BOARD_LPI2C_Send( BOARD_ACCEL_I2C_BASEADDR, deviceAddress, subAddress, subaddressSize, &data, 1 ); -} - -status_t BOARD_Accel_I2C_Receive( uint8_t deviceAddress, - uint32_t subAddress, - uint8_t subaddressSize, - uint8_t * rxBuff, - uint8_t rxBuffSize ) -{ - return BOARD_LPI2C_Receive( BOARD_ACCEL_I2C_BASEADDR, deviceAddress, subAddress, subaddressSize, rxBuff, rxBuffSize ); -} - -void BOARD_Codec_I2C_Init( void ) -{ - BOARD_LPI2C_Init( BOARD_CODEC_I2C_BASEADDR, BOARD_CODEC_I2C_CLOCK_FREQ ); -} - -status_t BOARD_Codec_I2C_Send( uint8_t deviceAddress, - uint32_t subAddress, - uint8_t subAddressSize, - const uint8_t * txBuff, - uint8_t txBuffSize ) -{ - return BOARD_LPI2C_Send( BOARD_CODEC_I2C_BASEADDR, deviceAddress, subAddress, subAddressSize, ( uint8_t * ) txBuff, - txBuffSize ); -} - -status_t BOARD_Codec_I2C_Receive( uint8_t deviceAddress, - uint32_t subAddress, - uint8_t subAddressSize, - uint8_t * rxBuff, - uint8_t rxBuffSize ) -{ - return BOARD_LPI2C_Receive( BOARD_CODEC_I2C_BASEADDR, deviceAddress, subAddress, subAddressSize, rxBuff, rxBuffSize ); -} - -void BOARD_Camera_I2C_Init( void ) -{ - CLOCK_SetMux( kCLOCK_Lpi2cMux, BOARD_CAMERA_I2C_CLOCK_SOURCE_SELECT ); - CLOCK_SetDiv( kCLOCK_Lpi2cDiv, BOARD_CAMERA_I2C_CLOCK_SOURCE_DIVIDER ); - BOARD_LPI2C_Init( BOARD_CAMERA_I2C_BASEADDR, BOARD_CAMERA_I2C_CLOCK_FREQ ); -} - -status_t BOARD_Camera_I2C_Send( uint8_t deviceAddress, - uint32_t subAddress, - uint8_t subAddressSize, - const uint8_t * txBuff, - uint8_t txBuffSize ) -{ - return BOARD_LPI2C_Send( BOARD_CAMERA_I2C_BASEADDR, deviceAddress, subAddress, subAddressSize, ( uint8_t * ) txBuff, - txBuffSize ); -} - -status_t BOARD_Camera_I2C_Receive( uint8_t deviceAddress, - uint32_t subAddress, - uint8_t subAddressSize, - uint8_t * rxBuff, - uint8_t rxBuffSize ) -{ - return BOARD_LPI2C_Receive( BOARD_CAMERA_I2C_BASEADDR, deviceAddress, subAddress, subAddressSize, rxBuff, - rxBuffSize ); -} - -status_t BOARD_Camera_I2C_SendSCCB( uint8_t deviceAddress, - uint32_t subAddress, - uint8_t subAddressSize, - const uint8_t * txBuff, - uint8_t txBuffSize ) -{ - return BOARD_LPI2C_SendSCCB( BOARD_CAMERA_I2C_BASEADDR, deviceAddress, subAddress, subAddressSize, ( uint8_t * ) txBuff, - txBuffSize ); -} - -status_t BOARD_Camera_I2C_ReceiveSCCB( uint8_t deviceAddress, - uint32_t subAddress, - uint8_t subAddressSize, - uint8_t * rxBuff, - uint8_t rxBuffSize ) -{ - return BOARD_LPI2C_ReceiveSCCB( BOARD_CAMERA_I2C_BASEADDR, deviceAddress, subAddress, subAddressSize, rxBuff, - rxBuffSize ); -} -#endif /* SDK_I2C_BASED_COMPONENT_USED */ - -/* MPU configuration. */ -void BOARD_ConfigMPU( void ) -{ -#if defined( __CC_ARM ) || defined( __ARMCC_VERSION ) - extern uint32_t Image$$RW_m_ncache$$Base[]; - /* RW_m_ncache_unused is a auxiliary region which is used to get the whole size of noncache section */ - extern uint32_t Image$$RW_m_ncache_unused$$Base[]; - extern uint32_t Image$$RW_m_ncache_unused$$ZI$$Limit[]; - uint32_t nonCacheStart = ( uint32_t ) Image$$RW_m_ncache$$Base; - uint32_t size = ( ( uint32_t ) Image$$RW_m_ncache_unused$$Base == nonCacheStart ) ? - 0 : - ( ( uint32_t ) Image$$RW_m_ncache_unused$$ZI$$Limit - nonCacheStart ); -#elif defined( __MCUXPRESSO ) - extern uint32_t __base_NCACHE_REGION; - extern uint32_t __top_NCACHE_REGION; - uint32_t nonCacheStart = ( uint32_t ) ( &__base_NCACHE_REGION ); - uint32_t size = ( uint32_t ) ( &__top_NCACHE_REGION ) - nonCacheStart; -#elif defined( __ICCARM__ ) || defined( __GNUC__ ) - extern uint32_t __NCACHE_REGION_START[]; - extern uint32_t __NCACHE_REGION_SIZE[]; - uint32_t nonCacheStart = ( uint32_t ) __NCACHE_REGION_START; - uint32_t size = ( uint32_t ) __NCACHE_REGION_SIZE; -#endif /* if defined( __CC_ARM ) || defined( __ARMCC_VERSION ) */ - volatile uint32_t i = 0; - - /* Disable I cache and D cache */ - if( SCB_CCR_IC_Msk == ( SCB_CCR_IC_Msk & SCB->CCR ) ) - { - SCB_DisableICache(); - } - - if( SCB_CCR_DC_Msk == ( SCB_CCR_DC_Msk & SCB->CCR ) ) - { - SCB_DisableDCache(); - } - - /* Disable MPU */ - ARM_MPU_Disable(); - - /* MPU configure: - * Use ARM_MPU_RASR(DisableExec, AccessPermission, TypeExtField, IsShareable, IsCacheable, IsBufferable, - * SubRegionDisable, Size) - * API in mpu_armv7.h. - * param DisableExec Instruction access (XN) disable bit,0=instruction fetches enabled, 1=instruction fetches - * disabled. - * param AccessPermission Data access permissions, allows you to configure read/write access for User and - * Privileged mode. - * Use MACROS defined in mpu_armv7.h: - * ARM_MPU_AP_NONE/ARM_MPU_AP_PRIV/ARM_MPU_AP_URO/ARM_MPU_AP_FULL/ARM_MPU_AP_PRO/ARM_MPU_AP_RO - * Combine TypeExtField/IsShareable/IsCacheable/IsBufferable to configure MPU memory access attributes. - * TypeExtField IsShareable IsCacheable IsBufferable Memory Attribute Shareability Cache - * 0 x 0 0 Strongly Ordered shareable - * 0 x 0 1 Device shareable - * 0 0 1 0 Normal not shareable Outer and inner write - * through no write allocate - * 0 0 1 1 Normal not shareable Outer and inner write - * back no write allocate - * 0 1 1 0 Normal shareable Outer and inner write - * through no write allocate - * 0 1 1 1 Normal shareable Outer and inner write - * back no write allocate - * 1 0 0 0 Normal not shareable outer and inner - * noncache - * 1 1 0 0 Normal shareable outer and inner - * noncache - * 1 0 1 1 Normal not shareable outer and inner write - * back write/read allocate - * 1 1 1 1 Normal shareable outer and inner write - * back write/read allocate - * 2 x 0 0 Device not shareable - * Above are normal use settings, if your want to see more details or want to config different inner/outter cache - * policy. - * please refer to Table 4-55 /4-56 in arm cortex-M7 generic user guide - * param SubRegionDisable Sub-region disable field. 0=sub-region is enabled, 1=sub-region is disabled. - * param Size Region size of the region to be configured. use ARM_MPU_REGION_SIZE_xxx MACRO in - * mpu_armv7.h. - */ - - /* - * Add default region to deny access to whole address space to workaround speculative prefetch. - * Refer to Arm errata 1013783-B for more details. - * - */ - /* Region 0 setting: Instruction access disabled, No data access permission. */ - MPU->RBAR = ARM_MPU_RBAR( 0, 0x00000000U ); - MPU->RASR = ARM_MPU_RASR( 1, ARM_MPU_AP_NONE, 2, 0, 0, 0, 0, ARM_MPU_REGION_SIZE_4GB ); - - /* Region 1 setting: Memory with Device type, not shareable, non-cacheable. */ - MPU->RBAR = ARM_MPU_RBAR( 1, 0x80000000U ); - MPU->RASR = ARM_MPU_RASR( 0, ARM_MPU_AP_FULL, 2, 0, 0, 0, 0, ARM_MPU_REGION_SIZE_512MB ); - - /* Region 2 setting: Memory with Device type, not shareable, non-cacheable. */ - MPU->RBAR = ARM_MPU_RBAR( 2, 0x60000000U ); - MPU->RASR = ARM_MPU_RASR( 0, ARM_MPU_AP_FULL, 2, 0, 0, 0, 0, ARM_MPU_REGION_SIZE_512MB ); - -#if defined( XIP_EXTERNAL_FLASH ) && ( XIP_EXTERNAL_FLASH == 1 ) - /* Region 3 setting: Memory with Normal type, not shareable, outer/inner write back. */ - MPU->RBAR = ARM_MPU_RBAR( 3, 0x60000000U ); - MPU->RASR = ARM_MPU_RASR( 0, ARM_MPU_AP_RO, 0, 0, 1, 1, 0, ARM_MPU_REGION_SIZE_8MB ); -#endif - - /* Region 4 setting: Memory with Device type, not shareable, non-cacheable. */ - MPU->RBAR = ARM_MPU_RBAR( 4, 0x00000000U ); - MPU->RASR = ARM_MPU_RASR( 0, ARM_MPU_AP_FULL, 2, 0, 0, 0, 0, ARM_MPU_REGION_SIZE_1GB ); - - /* Region 5 setting: Memory with Normal type, not shareable, outer/inner write back */ - MPU->RBAR = ARM_MPU_RBAR( 5, 0x00000000U ); - MPU->RASR = ARM_MPU_RASR( 0, ARM_MPU_AP_FULL, 0, 0, 1, 1, 0, ARM_MPU_REGION_SIZE_128KB ); - - /* Region 6 setting: Memory with Normal type, not shareable, outer/inner write back */ - MPU->RBAR = ARM_MPU_RBAR( 6, 0x20000000U ); - MPU->RASR = ARM_MPU_RASR( 0, ARM_MPU_AP_FULL, 0, 0, 1, 1, 0, ARM_MPU_REGION_SIZE_128KB ); - - /* Region 7 setting: Memory with Normal type, not shareable, outer/inner write back */ - MPU->RBAR = ARM_MPU_RBAR( 7, 0x20200000U ); - MPU->RASR = ARM_MPU_RASR( 0, ARM_MPU_AP_FULL, 0, 0, 1, 1, 0, ARM_MPU_REGION_SIZE_512KB ); - - /* Region 8 setting: Memory with Normal type, not shareable, outer/inner write back */ - MPU->RBAR = ARM_MPU_RBAR( 8, 0x20280000U ); - MPU->RASR = ARM_MPU_RASR( 0, ARM_MPU_AP_FULL, 0, 0, 1, 1, 0, ARM_MPU_REGION_SIZE_256KB ); - - /* Region 9 setting: Memory with Normal type, not shareable, outer/inner write back */ - MPU->RBAR = ARM_MPU_RBAR( 9, 0x80000000U ); - MPU->RASR = ARM_MPU_RASR( 0, ARM_MPU_AP_FULL, 0, 0, 1, 1, 0, ARM_MPU_REGION_SIZE_32MB ); - - while( ( size >> i ) > 0x1U ) - { - i++; - } - - if( i != 0 ) - { - /* The MPU region size should be 2^N, 5<=N<=32, region base should be multiples of size. */ - assert( !( nonCacheStart % size ) ); - assert( size == ( uint32_t ) ( 1 << i ) ); - assert( i >= 5 ); - - /* Region 10 setting: Memory with Normal type, not shareable, non-cacheable */ - MPU->RBAR = ARM_MPU_RBAR( 10, nonCacheStart ); - MPU->RASR = ARM_MPU_RASR( 0, ARM_MPU_AP_FULL, 1, 0, 0, 0, 0, i - 1 ); - } - - /* Region 10 setting: Memory with Device type, not shareable, non-cacheable */ - MPU->RBAR = ARM_MPU_RBAR( 11, 0x40000000 ); - MPU->RASR = ARM_MPU_RASR( 0, ARM_MPU_AP_FULL, 2, 0, 0, 0, 0, ARM_MPU_REGION_SIZE_4MB ); - - /* Region 12 setting: Memory with Device type, not shareable, non-cacheable */ - MPU->RBAR = ARM_MPU_RBAR( 12, 0x42000000 ); - MPU->RASR = ARM_MPU_RASR( 0, ARM_MPU_AP_FULL, 2, 0, 0, 0, 0, ARM_MPU_REGION_SIZE_1MB ); - - /* Enable MPU */ - ARM_MPU_Enable( MPU_CTRL_PRIVDEFENA_Msk ); - - /* Enable I cache and D cache */ - SCB_EnableDCache(); - SCB_EnableICache(); -} diff --git a/examples/evkbmimxrt1060/test/board/board.h b/examples/evkbmimxrt1060/test/board/board.h deleted file mode 100644 index 7b5f340..0000000 --- a/examples/evkbmimxrt1060/test/board/board.h +++ /dev/null @@ -1,218 +0,0 @@ -/* - * Copyright 2018-2019 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#ifndef _BOARD_H_ -#define _BOARD_H_ - -#include "clock_config.h" -#include "fsl_common.h" -#include "fsl_gpio.h" -#include "fsl_clock.h" - -/******************************************************************************* - * Definitions - ******************************************************************************/ -/*! @brief The board name */ -#define BOARD_NAME "MIMXRT1060-EVK" - -/* The UART to use for debug messages. */ -#define BOARD_DEBUG_UART_TYPE kSerialPort_Uart -#define BOARD_DEBUG_UART_BASEADDR ( uint32_t ) LPUART1 -#define BOARD_DEBUG_UART_INSTANCE 1U - -#define BOARD_DEBUG_UART_CLK_FREQ BOARD_DebugConsoleSrcFreq() - -#define BOARD_UART_IRQ LPUART1_IRQn -#define BOARD_UART_IRQ_HANDLER LPUART1_IRQHandler - -#ifndef BOARD_DEBUG_UART_BAUDRATE -#define BOARD_DEBUG_UART_BAUDRATE ( 115200U ) -#endif /* BOARD_DEBUG_UART_BAUDRATE */ - -/*! @brief The USER_LED used for board */ -#define LOGIC_LED_ON ( 0U ) -#define LOGIC_LED_OFF ( 1U ) -#ifndef BOARD_USER_LED_GPIO -#define BOARD_USER_LED_GPIO GPIO1 -#endif -#ifndef BOARD_USER_LED_GPIO_PIN -#define BOARD_USER_LED_GPIO_PIN ( 9U ) -#endif - -#define USER_LED_INIT( output ) \ - GPIO_PinWrite( BOARD_USER_LED_GPIO, BOARD_USER_LED_GPIO_PIN, output ); \ - BOARD_USER_LED_GPIO->GDIR |= ( 1U << BOARD_USER_LED_GPIO_PIN ) /*!< Enable target USER_LED */ -#define USER_LED_ON() \ - GPIO_PortClear( BOARD_USER_LED_GPIO, 1U << BOARD_USER_LED_GPIO_PIN ) /*!< Turn off target USER_LED */ -#define USER_LED_OFF() GPIO_PortSet( BOARD_USER_LED_GPIO, 1U << BOARD_USER_LED_GPIO_PIN ) /*!OSC_CONFIG2 |= XTALOSC24M_OSC_CONFIG2_ENABLE_1M_MASK; - /* Use free 1MHz clock output. */ - XTALOSC24M->OSC_CONFIG2 &= ~XTALOSC24M_OSC_CONFIG2_MUX_1M_MASK; - /* Set XTAL 24MHz clock frequency. */ - CLOCK_SetXtalFreq( 24000000U ); - /* Enable XTAL 24MHz clock source. */ - CLOCK_InitExternalClk( 0 ); - /* Enable internal RC. */ - CLOCK_InitRcOsc24M(); - /* Switch clock source to external OSC. */ - CLOCK_SwitchOsc( kCLOCK_XtalOsc ); - /* Set Oscillator ready counter value. */ - CCM->CCR = ( CCM->CCR & ( ~CCM_CCR_OSCNT_MASK ) ) | CCM_CCR_OSCNT( 127 ); - /* Setting PeriphClk2Mux and PeriphMux to provide stable clock before PLLs are initialed */ - CLOCK_SetMux( kCLOCK_PeriphClk2Mux, 1 ); /* Set PERIPH_CLK2 MUX to OSC */ - CLOCK_SetMux( kCLOCK_PeriphMux, 1 ); /* Set PERIPH_CLK MUX to PERIPH_CLK2 */ - /* Setting the VDD_SOC to 1.275V. It is necessary to config AHB to 600Mhz. */ - DCDC->REG3 = ( DCDC->REG3 & ( ~DCDC_REG3_TRG_MASK ) ) | DCDC_REG3_TRG( 0x13 ); - - /* Waiting for DCDC_STS_DC_OK bit is asserted */ - while( DCDC_REG0_STS_DC_OK_MASK != ( DCDC_REG0_STS_DC_OK_MASK & DCDC->REG0 ) ) - { - } - - /* Set AHB_PODF. */ - CLOCK_SetDiv( kCLOCK_AhbDiv, 0 ); - /* Disable IPG clock gate. */ - CLOCK_DisableClock( kCLOCK_Adc1 ); - CLOCK_DisableClock( kCLOCK_Adc2 ); - CLOCK_DisableClock( kCLOCK_Xbar1 ); - CLOCK_DisableClock( kCLOCK_Xbar2 ); - CLOCK_DisableClock( kCLOCK_Xbar3 ); - /* Set IPG_PODF. */ - CLOCK_SetDiv( kCLOCK_IpgDiv, 3 ); - /* Set ARM_PODF. */ - CLOCK_SetDiv( kCLOCK_ArmDiv, 1 ); - /* Set PERIPH_CLK2_PODF. */ - CLOCK_SetDiv( kCLOCK_PeriphClk2Div, 0 ); - /* Disable PERCLK clock gate. */ - CLOCK_DisableClock( kCLOCK_Gpt1 ); - CLOCK_DisableClock( kCLOCK_Gpt1S ); - CLOCK_DisableClock( kCLOCK_Gpt2 ); - CLOCK_DisableClock( kCLOCK_Gpt2S ); - CLOCK_DisableClock( kCLOCK_Pit ); - /* Set PERCLK_PODF. */ - CLOCK_SetDiv( kCLOCK_PerclkDiv, 1 ); - /* Disable USDHC1 clock gate. */ - CLOCK_DisableClock( kCLOCK_Usdhc1 ); - /* Set USDHC1_PODF. */ - CLOCK_SetDiv( kCLOCK_Usdhc1Div, 1 ); - /* Set Usdhc1 clock source. */ - CLOCK_SetMux( kCLOCK_Usdhc1Mux, 0 ); - /* Disable USDHC2 clock gate. */ - CLOCK_DisableClock( kCLOCK_Usdhc2 ); - /* Set USDHC2_PODF. */ - CLOCK_SetDiv( kCLOCK_Usdhc2Div, 1 ); - /* Set Usdhc2 clock source. */ - CLOCK_SetMux( kCLOCK_Usdhc2Mux, 0 ); - - /* In SDK projects, SDRAM (configured by SEMC) will be initialized in either debug script or dcd. - * With this macro SKIP_SYSCLK_INIT, system pll (selected to be SEMC source clock in SDK projects) will be left unchanged. - * Note: If another clock source is selected for SEMC, user may want to avoid changing that clock as well.*/ -#ifndef SKIP_SYSCLK_INIT - /* Disable Semc clock gate. */ - CLOCK_DisableClock( kCLOCK_Semc ); - /* Set SEMC_PODF. */ - CLOCK_SetDiv( kCLOCK_SemcDiv, 7 ); - /* Set Semc alt clock source. */ - CLOCK_SetMux( kCLOCK_SemcAltMux, 0 ); - /* Set Semc clock source. */ - CLOCK_SetMux( kCLOCK_SemcMux, 0 ); -#endif - - /* In SDK projects, external flash (configured by FLEXSPI) will be initialized by dcd. - * With this macro XIP_EXTERNAL_FLASH, usb1 pll (selected to be FLEXSPI clock source in SDK projects) will be left unchanged. - * Note: If another clock source is selected for FLEXSPI, user may want to avoid changing that clock as well.*/ -#if !( defined( XIP_EXTERNAL_FLASH ) && ( XIP_EXTERNAL_FLASH == 1 ) ) - /* Disable Flexspi clock gate. */ - CLOCK_DisableClock( kCLOCK_FlexSpi ); - /* Set FLEXSPI_PODF. */ - CLOCK_SetDiv( kCLOCK_FlexspiDiv, 1 ); - /* Set Flexspi clock source. */ - CLOCK_SetMux( kCLOCK_FlexspiMux, 3 ); -#endif - /* Disable Flexspi2 clock gate. */ - CLOCK_DisableClock( kCLOCK_FlexSpi2 ); - /* Set FLEXSPI2_PODF. */ - CLOCK_SetDiv( kCLOCK_Flexspi2Div, 1 ); - /* Set Flexspi2 clock source. */ - CLOCK_SetMux( kCLOCK_Flexspi2Mux, 1 ); - /* Disable CSI clock gate. */ - CLOCK_DisableClock( kCLOCK_Csi ); - /* Set CSI_PODF. */ - CLOCK_SetDiv( kCLOCK_CsiDiv, 1 ); - /* Set Csi clock source. */ - CLOCK_SetMux( kCLOCK_CsiMux, 0 ); - /* Disable LPSPI clock gate. */ - CLOCK_DisableClock( kCLOCK_Lpspi1 ); - CLOCK_DisableClock( kCLOCK_Lpspi2 ); - CLOCK_DisableClock( kCLOCK_Lpspi3 ); - CLOCK_DisableClock( kCLOCK_Lpspi4 ); - /* Set LPSPI_PODF. */ - CLOCK_SetDiv( kCLOCK_LpspiDiv, 4 ); - /* Set Lpspi clock source. */ - CLOCK_SetMux( kCLOCK_LpspiMux, 2 ); - /* Disable TRACE clock gate. */ - CLOCK_DisableClock( kCLOCK_Trace ); - /* Set TRACE_PODF. */ - CLOCK_SetDiv( kCLOCK_TraceDiv, 3 ); - /* Set Trace clock source. */ - CLOCK_SetMux( kCLOCK_TraceMux, 0 ); - /* Disable SAI1 clock gate. */ - CLOCK_DisableClock( kCLOCK_Sai1 ); - /* Set SAI1_CLK_PRED. */ - CLOCK_SetDiv( kCLOCK_Sai1PreDiv, 3 ); - /* Set SAI1_CLK_PODF. */ - CLOCK_SetDiv( kCLOCK_Sai1Div, 1 ); - /* Set Sai1 clock source. */ - CLOCK_SetMux( kCLOCK_Sai1Mux, 0 ); - /* Disable SAI2 clock gate. */ - CLOCK_DisableClock( kCLOCK_Sai2 ); - /* Set SAI2_CLK_PRED. */ - CLOCK_SetDiv( kCLOCK_Sai2PreDiv, 3 ); - /* Set SAI2_CLK_PODF. */ - CLOCK_SetDiv( kCLOCK_Sai2Div, 1 ); - /* Set Sai2 clock source. */ - CLOCK_SetMux( kCLOCK_Sai2Mux, 0 ); - /* Disable SAI3 clock gate. */ - CLOCK_DisableClock( kCLOCK_Sai3 ); - /* Set SAI3_CLK_PRED. */ - CLOCK_SetDiv( kCLOCK_Sai3PreDiv, 3 ); - /* Set SAI3_CLK_PODF. */ - CLOCK_SetDiv( kCLOCK_Sai3Div, 1 ); - /* Set Sai3 clock source. */ - CLOCK_SetMux( kCLOCK_Sai3Mux, 0 ); - /* Disable Lpi2c clock gate. */ - CLOCK_DisableClock( kCLOCK_Lpi2c1 ); - CLOCK_DisableClock( kCLOCK_Lpi2c2 ); - CLOCK_DisableClock( kCLOCK_Lpi2c3 ); - /* Set LPI2C_CLK_PODF. */ - CLOCK_SetDiv( kCLOCK_Lpi2cDiv, 0 ); - /* Set Lpi2c clock source. */ - CLOCK_SetMux( kCLOCK_Lpi2cMux, 0 ); - /* Disable CAN clock gate. */ - CLOCK_DisableClock( kCLOCK_Can1 ); - CLOCK_DisableClock( kCLOCK_Can2 ); - CLOCK_DisableClock( kCLOCK_Can3 ); - CLOCK_DisableClock( kCLOCK_Can1S ); - CLOCK_DisableClock( kCLOCK_Can2S ); - CLOCK_DisableClock( kCLOCK_Can3S ); - /* Set CAN_CLK_PODF. */ - CLOCK_SetDiv( kCLOCK_CanDiv, 1 ); - /* Set Can clock source. */ - CLOCK_SetMux( kCLOCK_CanMux, 2 ); - /* Disable UART clock gate. */ - CLOCK_DisableClock( kCLOCK_Lpuart1 ); - CLOCK_DisableClock( kCLOCK_Lpuart2 ); - CLOCK_DisableClock( kCLOCK_Lpuart3 ); - CLOCK_DisableClock( kCLOCK_Lpuart4 ); - CLOCK_DisableClock( kCLOCK_Lpuart5 ); - CLOCK_DisableClock( kCLOCK_Lpuart6 ); - CLOCK_DisableClock( kCLOCK_Lpuart7 ); - CLOCK_DisableClock( kCLOCK_Lpuart8 ); - /* Set UART_CLK_PODF. */ - CLOCK_SetDiv( kCLOCK_UartDiv, 0 ); - /* Set Uart clock source. */ - CLOCK_SetMux( kCLOCK_UartMux, 0 ); - /* Disable LCDIF clock gate. */ - CLOCK_DisableClock( kCLOCK_LcdPixel ); - /* Set LCDIF_PRED. */ - CLOCK_SetDiv( kCLOCK_LcdifPreDiv, 1 ); - /* Set LCDIF_CLK_PODF. */ - CLOCK_SetDiv( kCLOCK_LcdifDiv, 3 ); - /* Set Lcdif pre clock source. */ - CLOCK_SetMux( kCLOCK_LcdifPreMux, 5 ); - /* Disable SPDIF clock gate. */ - CLOCK_DisableClock( kCLOCK_Spdif ); - /* Set SPDIF0_CLK_PRED. */ - CLOCK_SetDiv( kCLOCK_Spdif0PreDiv, 1 ); - /* Set SPDIF0_CLK_PODF. */ - CLOCK_SetDiv( kCLOCK_Spdif0Div, 7 ); - /* Set Spdif clock source. */ - CLOCK_SetMux( kCLOCK_SpdifMux, 3 ); - /* Disable Flexio1 clock gate. */ - CLOCK_DisableClock( kCLOCK_Flexio1 ); - /* Set FLEXIO1_CLK_PRED. */ - CLOCK_SetDiv( kCLOCK_Flexio1PreDiv, 1 ); - /* Set FLEXIO1_CLK_PODF. */ - CLOCK_SetDiv( kCLOCK_Flexio1Div, 7 ); - /* Set Flexio1 clock source. */ - CLOCK_SetMux( kCLOCK_Flexio1Mux, 3 ); - /* Disable Flexio2 clock gate. */ - CLOCK_DisableClock( kCLOCK_Flexio2 ); - /* Set FLEXIO2_CLK_PRED. */ - CLOCK_SetDiv( kCLOCK_Flexio2PreDiv, 1 ); - /* Set FLEXIO2_CLK_PODF. */ - CLOCK_SetDiv( kCLOCK_Flexio2Div, 7 ); - /* Set Flexio2 clock source. */ - CLOCK_SetMux( kCLOCK_Flexio2Mux, 3 ); - /* Set Pll3 sw clock source. */ - CLOCK_SetMux( kCLOCK_Pll3SwMux, 0 ); - /* Init ARM PLL. */ - CLOCK_InitArmPll( &armPllConfig_BOARD_BootClockRUN ); - - /* In SDK projects, SDRAM (configured by SEMC) will be initialized in either debug script or dcd. - * With this macro SKIP_SYSCLK_INIT, system pll (selected to be SEMC source clock in SDK projects) will be left unchanged. - * Note: If another clock source is selected for SEMC, user may want to avoid changing that clock as well.*/ -#ifndef SKIP_SYSCLK_INIT -#if defined( XIP_BOOT_HEADER_DCD_ENABLE ) && ( XIP_BOOT_HEADER_DCD_ENABLE == 1 ) -#warning "SKIP_SYSCLK_INIT should be defined to keep system pll (selected to be SEMC source clock in SDK projects) unchanged." -#endif - /* Init System PLL. */ - CLOCK_InitSysPll( &sysPllConfig_BOARD_BootClockRUN ); - /* Init System pfd0. */ - CLOCK_InitSysPfd( kCLOCK_Pfd0, 27 ); - /* Init System pfd1. */ - CLOCK_InitSysPfd( kCLOCK_Pfd1, 16 ); - /* Init System pfd2. */ - CLOCK_InitSysPfd( kCLOCK_Pfd2, 24 ); - /* Init System pfd3. */ - CLOCK_InitSysPfd( kCLOCK_Pfd3, 16 ); -#endif /* ifndef SKIP_SYSCLK_INIT */ - - /* In SDK projects, external flash (configured by FLEXSPI) will be initialized by dcd. - * With this macro XIP_EXTERNAL_FLASH, usb1 pll (selected to be FLEXSPI clock source in SDK projects) will be left unchanged. - * Note: If another clock source is selected for FLEXSPI, user may want to avoid changing that clock as well.*/ -#if !( defined( XIP_EXTERNAL_FLASH ) && ( XIP_EXTERNAL_FLASH == 1 ) ) - /* Init Usb1 PLL. */ - CLOCK_InitUsb1Pll( &usb1PllConfig_BOARD_BootClockRUN ); - /* Init Usb1 pfd0. */ - CLOCK_InitUsb1Pfd( kCLOCK_Pfd0, 33 ); - /* Init Usb1 pfd1. */ - CLOCK_InitUsb1Pfd( kCLOCK_Pfd1, 16 ); - /* Init Usb1 pfd2. */ - CLOCK_InitUsb1Pfd( kCLOCK_Pfd2, 17 ); - /* Init Usb1 pfd3. */ - CLOCK_InitUsb1Pfd( kCLOCK_Pfd3, 19 ); - /* Disable Usb1 PLL output for USBPHY1. */ - CCM_ANALOG->PLL_USB1 &= ~CCM_ANALOG_PLL_USB1_EN_USB_CLKS_MASK; -#endif /* if !( defined( XIP_EXTERNAL_FLASH ) && ( XIP_EXTERNAL_FLASH == 1 ) ) */ - /* DeInit Audio PLL. */ - CLOCK_DeinitAudioPll(); - /* Bypass Audio PLL. */ - CLOCK_SetPllBypass( CCM_ANALOG, kCLOCK_PllAudio, 1 ); - /* Set divider for Audio PLL. */ - CCM_ANALOG->MISC2 &= ~CCM_ANALOG_MISC2_AUDIO_DIV_LSB_MASK; - CCM_ANALOG->MISC2 &= ~CCM_ANALOG_MISC2_AUDIO_DIV_MSB_MASK; - /* Enable Audio PLL output. */ - CCM_ANALOG->PLL_AUDIO |= CCM_ANALOG_PLL_AUDIO_ENABLE_MASK; - /* Init Video PLL. */ - uint32_t pllVideo; - /* Disable Video PLL output before initial Video PLL. */ - CCM_ANALOG->PLL_VIDEO &= ~CCM_ANALOG_PLL_VIDEO_ENABLE_MASK; - /* Bypass PLL first */ - CCM_ANALOG->PLL_VIDEO = ( CCM_ANALOG->PLL_VIDEO & ( ~CCM_ANALOG_PLL_VIDEO_BYPASS_CLK_SRC_MASK ) ) | - CCM_ANALOG_PLL_VIDEO_BYPASS_MASK | CCM_ANALOG_PLL_VIDEO_BYPASS_CLK_SRC( 0 ); - CCM_ANALOG->PLL_VIDEO_NUM = CCM_ANALOG_PLL_VIDEO_NUM_A( 0 ); - CCM_ANALOG->PLL_VIDEO_DENOM = CCM_ANALOG_PLL_VIDEO_DENOM_B( 1 ); - pllVideo = ( CCM_ANALOG->PLL_VIDEO & ( ~( CCM_ANALOG_PLL_VIDEO_DIV_SELECT_MASK | CCM_ANALOG_PLL_VIDEO_POWERDOWN_MASK ) ) ) | - CCM_ANALOG_PLL_VIDEO_ENABLE_MASK | CCM_ANALOG_PLL_VIDEO_DIV_SELECT( 31 ); - pllVideo |= CCM_ANALOG_PLL_VIDEO_POST_DIV_SELECT( 1 ); - CCM_ANALOG->MISC2 = ( CCM_ANALOG->MISC2 & ( ~CCM_ANALOG_MISC2_VIDEO_DIV_MASK ) ) | CCM_ANALOG_MISC2_VIDEO_DIV( 3 ); - CCM_ANALOG->PLL_VIDEO = pllVideo; - - while( ( CCM_ANALOG->PLL_VIDEO & CCM_ANALOG_PLL_VIDEO_LOCK_MASK ) == 0 ) - { - } - - /* Disable bypass for Video PLL. */ - CLOCK_SetPllBypass( CCM_ANALOG, kCLOCK_PllVideo, 0 ); - /* DeInit Enet PLL. */ - CLOCK_DeinitEnetPll(); - /* Bypass Enet PLL. */ - CLOCK_SetPllBypass( CCM_ANALOG, kCLOCK_PllEnet, 1 ); - /* Set Enet output divider. */ - CCM_ANALOG->PLL_ENET = ( CCM_ANALOG->PLL_ENET & ( ~CCM_ANALOG_PLL_ENET_DIV_SELECT_MASK ) ) | CCM_ANALOG_PLL_ENET_DIV_SELECT( 1 ); - /* Enable Enet output. */ - CCM_ANALOG->PLL_ENET |= CCM_ANALOG_PLL_ENET_ENABLE_MASK; - /* Set Enet2 output divider. */ - CCM_ANALOG->PLL_ENET = ( CCM_ANALOG->PLL_ENET & ( ~CCM_ANALOG_PLL_ENET_ENET2_DIV_SELECT_MASK ) ) | CCM_ANALOG_PLL_ENET_ENET2_DIV_SELECT( 0 ); - /* Enable Enet2 output. */ - CCM_ANALOG->PLL_ENET |= CCM_ANALOG_PLL_ENET_ENET2_REF_EN_MASK; - /* Enable Enet25M output. */ - CCM_ANALOG->PLL_ENET |= CCM_ANALOG_PLL_ENET_ENET_25M_REF_EN_MASK; - /* DeInit Usb2 PLL. */ - CLOCK_DeinitUsb2Pll(); - /* Bypass Usb2 PLL. */ - CLOCK_SetPllBypass( CCM_ANALOG, kCLOCK_PllUsb2, 1 ); - /* Enable Usb2 PLL output. */ - CCM_ANALOG->PLL_USB2 |= CCM_ANALOG_PLL_USB2_ENABLE_MASK; - /* Set preperiph clock source. */ - CLOCK_SetMux( kCLOCK_PrePeriphMux, 3 ); - /* Set periph clock source. */ - CLOCK_SetMux( kCLOCK_PeriphMux, 0 ); - /* Set periph clock2 clock source. */ - CLOCK_SetMux( kCLOCK_PeriphClk2Mux, 0 ); - /* Set per clock source. */ - CLOCK_SetMux( kCLOCK_PerclkMux, 0 ); - /* Set lvds1 clock source. */ - CCM_ANALOG->MISC1 = ( CCM_ANALOG->MISC1 & ( ~CCM_ANALOG_MISC1_LVDS1_CLK_SEL_MASK ) ) | CCM_ANALOG_MISC1_LVDS1_CLK_SEL( 0 ); - /* Set clock out1 divider. */ - CCM->CCOSR = ( CCM->CCOSR & ( ~CCM_CCOSR_CLKO1_DIV_MASK ) ) | CCM_CCOSR_CLKO1_DIV( 0 ); - /* Set clock out1 source. */ - CCM->CCOSR = ( CCM->CCOSR & ( ~CCM_CCOSR_CLKO1_SEL_MASK ) ) | CCM_CCOSR_CLKO1_SEL( 1 ); - /* Set clock out2 divider. */ - CCM->CCOSR = ( CCM->CCOSR & ( ~CCM_CCOSR_CLKO2_DIV_MASK ) ) | CCM_CCOSR_CLKO2_DIV( 0 ); - /* Set clock out2 source. */ - CCM->CCOSR = ( CCM->CCOSR & ( ~CCM_CCOSR_CLKO2_SEL_MASK ) ) | CCM_CCOSR_CLKO2_SEL( 18 ); - /* Set clock out1 drives clock out1. */ - CCM->CCOSR &= ~CCM_CCOSR_CLK_OUT_SEL_MASK; - /* Disable clock out1. */ - CCM->CCOSR &= ~CCM_CCOSR_CLKO1_EN_MASK; - /* Disable clock out2. */ - CCM->CCOSR &= ~CCM_CCOSR_CLKO2_EN_MASK; - /* Set SAI1 MCLK1 clock source. */ - IOMUXC_SetSaiMClkClockSource( IOMUXC_GPR, kIOMUXC_GPR_SAI1MClk1Sel, 0 ); - /* Set SAI1 MCLK2 clock source. */ - IOMUXC_SetSaiMClkClockSource( IOMUXC_GPR, kIOMUXC_GPR_SAI1MClk2Sel, 0 ); - /* Set SAI1 MCLK3 clock source. */ - IOMUXC_SetSaiMClkClockSource( IOMUXC_GPR, kIOMUXC_GPR_SAI1MClk3Sel, 0 ); - /* Set SAI2 MCLK3 clock source. */ - IOMUXC_SetSaiMClkClockSource( IOMUXC_GPR, kIOMUXC_GPR_SAI2MClk3Sel, 0 ); - /* Set SAI3 MCLK3 clock source. */ - IOMUXC_SetSaiMClkClockSource( IOMUXC_GPR, kIOMUXC_GPR_SAI3MClk3Sel, 0 ); - /* Set MQS configuration. */ - IOMUXC_MQSConfig( IOMUXC_GPR, kIOMUXC_MqsPwmOverSampleRate32, 0 ); - /* Set ENET1 Tx clock source. */ - IOMUXC_EnableMode( IOMUXC_GPR, kIOMUXC_GPR_ENET1RefClkMode, false ); - /* Set ENET2 Tx clock source. */ -#if defined( FSL_IOMUXC_DRIVER_VERSION ) && ( FSL_IOMUXC_DRIVER_VERSION != ( MAKE_VERSION( 2, 0, 0 ) ) ) - IOMUXC_EnableMode( IOMUXC_GPR, kIOMUXC_GPR_ENET2RefClkMode, false ); -#else - IOMUXC_EnableMode( IOMUXC_GPR, IOMUXC_GPR_GPR1_ENET2_CLK_SEL_MASK, false ); -#endif - /* Set GPT1 High frequency reference clock source. */ - IOMUXC_GPR->GPR5 &= ~IOMUXC_GPR_GPR5_VREF_1M_CLK_GPT1_MASK; - /* Set GPT2 High frequency reference clock source. */ - IOMUXC_GPR->GPR5 &= ~IOMUXC_GPR_GPR5_VREF_1M_CLK_GPT2_MASK; - /* Set SystemCoreClock variable. */ - SystemCoreClock = BOARD_BOOTCLOCKRUN_CORE_CLOCK; -} diff --git a/examples/evkbmimxrt1060/test/board/clock_config.h b/examples/evkbmimxrt1060/test/board/clock_config.h deleted file mode 100644 index f07889a..0000000 --- a/examples/evkbmimxrt1060/test/board/clock_config.h +++ /dev/null @@ -1,138 +0,0 @@ -/* - * Copyright 2018-2020 ,2021 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#ifndef _CLOCK_CONFIG_H_ -#define _CLOCK_CONFIG_H_ - -#include "fsl_common.h" - -/******************************************************************************* - * Definitions - ******************************************************************************/ -#define BOARD_XTAL0_CLK_HZ 24000000U /*!< Board xtal0 frequency in Hz */ - -#define BOARD_XTAL32K_CLK_HZ 32768U /*!< Board xtal32k frequency in Hz */ - -/******************************************************************************* - ************************ BOARD_InitBootClocks function ************************ - ******************************************************************************/ - -/* *INDENT-OFF* */ -#if defined( __cplusplus ) -extern "C" { -#endif /* __cplusplus*/ -/* *INDENT-ON* */ - -/*! - * @brief This function executes default configuration of clocks. - * - */ -void BOARD_InitBootClocks( void ); - -/* *INDENT-OFF* */ -#if defined( __cplusplus ) -} -#endif /* __cplusplus*/ -/* *INDENT-ON* */ - -/******************************************************************************* - ********************** Configuration BOARD_BootClockRUN *********************** - ******************************************************************************/ - -/******************************************************************************* - * Definitions for BOARD_BootClockRUN configuration - ******************************************************************************/ -#define BOARD_BOOTCLOCKRUN_CORE_CLOCK 600000000U /*!< Core clock frequency: 600000000Hz */ - -/* Clock outputs (values are in Hz): */ -#define BOARD_BOOTCLOCKRUN_AHB_CLK_ROOT 600000000UL -#define BOARD_BOOTCLOCKRUN_CAN_CLK_ROOT 40000000UL -#define BOARD_BOOTCLOCKRUN_CKIL_SYNC_CLK_ROOT 32768UL -#define BOARD_BOOTCLOCKRUN_CLKO1_CLK 0UL -#define BOARD_BOOTCLOCKRUN_CLKO2_CLK 0UL -#define BOARD_BOOTCLOCKRUN_CLK_1M 1000000UL -#define BOARD_BOOTCLOCKRUN_CLK_24M 24000000UL -#define BOARD_BOOTCLOCKRUN_CSI_CLK_ROOT 12000000UL -#define BOARD_BOOTCLOCKRUN_ENET1_TX_CLK 2400000UL -#define BOARD_BOOTCLOCKRUN_ENET2_125M_CLK 1200000UL -#define BOARD_BOOTCLOCKRUN_ENET2_TX_CLK 1200000UL -#define BOARD_BOOTCLOCKRUN_ENET_125M_CLK 2400000UL -#define BOARD_BOOTCLOCKRUN_ENET_25M_REF_CLK 1200000UL -#define BOARD_BOOTCLOCKRUN_FLEXIO1_CLK_ROOT 30000000UL -#define BOARD_BOOTCLOCKRUN_FLEXIO2_CLK_ROOT 30000000UL -#define BOARD_BOOTCLOCKRUN_FLEXSPI2_CLK_ROOT 130909090UL -#define BOARD_BOOTCLOCKRUN_FLEXSPI_CLK_ROOT 130909090UL -#define BOARD_BOOTCLOCKRUN_GPT1_IPG_CLK_HIGHFREQ 75000000UL -#define BOARD_BOOTCLOCKRUN_GPT2_IPG_CLK_HIGHFREQ 75000000UL -#define BOARD_BOOTCLOCKRUN_IPG_CLK_ROOT 150000000UL -#define BOARD_BOOTCLOCKRUN_LCDIF_CLK_ROOT 67500000UL -#define BOARD_BOOTCLOCKRUN_LPI2C_CLK_ROOT 60000000UL -#define BOARD_BOOTCLOCKRUN_LPSPI_CLK_ROOT 105600000UL -#define BOARD_BOOTCLOCKRUN_LVDS1_CLK 1200000000UL -#define BOARD_BOOTCLOCKRUN_MQS_MCLK 63529411UL -#define BOARD_BOOTCLOCKRUN_PERCLK_CLK_ROOT 75000000UL -#define BOARD_BOOTCLOCKRUN_PLL7_MAIN_CLK 24000000UL -#define BOARD_BOOTCLOCKRUN_SAI1_CLK_ROOT 63529411UL -#define BOARD_BOOTCLOCKRUN_SAI1_MCLK1 63529411UL -#define BOARD_BOOTCLOCKRUN_SAI1_MCLK2 63529411UL -#define BOARD_BOOTCLOCKRUN_SAI1_MCLK3 30000000UL -#define BOARD_BOOTCLOCKRUN_SAI2_CLK_ROOT 63529411UL -#define BOARD_BOOTCLOCKRUN_SAI2_MCLK1 63529411UL -#define BOARD_BOOTCLOCKRUN_SAI2_MCLK2 0UL -#define BOARD_BOOTCLOCKRUN_SAI2_MCLK3 30000000UL -#define BOARD_BOOTCLOCKRUN_SAI3_CLK_ROOT 63529411UL -#define BOARD_BOOTCLOCKRUN_SAI3_MCLK1 63529411UL -#define BOARD_BOOTCLOCKRUN_SAI3_MCLK2 0UL -#define BOARD_BOOTCLOCKRUN_SAI3_MCLK3 30000000UL -#define BOARD_BOOTCLOCKRUN_SEMC_CLK_ROOT 75000000UL -#define BOARD_BOOTCLOCKRUN_SPDIF0_CLK_ROOT 30000000UL -#define BOARD_BOOTCLOCKRUN_SPDIF0_EXTCLK_OUT 0UL -#define BOARD_BOOTCLOCKRUN_TRACE_CLK_ROOT 132000000UL -#define BOARD_BOOTCLOCKRUN_UART_CLK_ROOT 80000000UL -#define BOARD_BOOTCLOCKRUN_USBPHY1_CLK 0UL -#define BOARD_BOOTCLOCKRUN_USBPHY2_CLK 0UL -#define BOARD_BOOTCLOCKRUN_USDHC1_CLK_ROOT 198000000UL -#define BOARD_BOOTCLOCKRUN_USDHC2_CLK_ROOT 198000000UL - -/*! @brief Arm PLL set for BOARD_BootClockRUN configuration. - */ -extern const clock_arm_pll_config_t armPllConfig_BOARD_BootClockRUN; - -/*! @brief Usb1 PLL set for BOARD_BootClockRUN configuration. - */ -extern const clock_usb_pll_config_t usb1PllConfig_BOARD_BootClockRUN; - -/*! @brief Sys PLL for BOARD_BootClockRUN configuration. - */ -extern const clock_sys_pll_config_t sysPllConfig_BOARD_BootClockRUN; - -/*! @brief Video PLL set for BOARD_BootClockRUN configuration. - */ -extern const clock_video_pll_config_t videoPllConfig_BOARD_BootClockRUN; - -/******************************************************************************* - * API for BOARD_BootClockRUN configuration - ******************************************************************************/ -/* *INDENT-OFF* */ -#if defined( __cplusplus ) -extern "C" { -#endif /* __cplusplus*/ -/* *INDENT-ON* */ - -/*! - * @brief This function executes configuration of clocks. - * - */ -void BOARD_BootClockRUN( void ); - -/* *INDENT-OFF* */ -#if defined( __cplusplus ) -} -#endif /* __cplusplus*/ -/* *INDENT-ON* */ - -#endif /* _CLOCK_CONFIG_H_ */ diff --git a/examples/evkbmimxrt1060/test/board/dcd.c b/examples/evkbmimxrt1060/test/board/dcd.c deleted file mode 100644 index 1de912c..0000000 --- a/examples/evkbmimxrt1060/test/board/dcd.c +++ /dev/null @@ -1,316 +0,0 @@ -/* - * Copyright 2020 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -/*********************************************************************************************************************** - * This file was generated by the MCUXpresso Config Tools. Any manual edits made to this file - * will be overwritten if the respective MCUXpresso Config Tools is used to update this file. - **********************************************************************************************************************/ - -#include "dcd.h" - -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.xip_board" -#endif - -#if defined( XIP_BOOT_HEADER_ENABLE ) && ( XIP_BOOT_HEADER_ENABLE == 1 ) -#if defined( XIP_BOOT_HEADER_DCD_ENABLE ) && ( XIP_BOOT_HEADER_DCD_ENABLE == 1 ) -#if defined( __CC_ARM ) || defined( __ARMCC_VERSION ) || defined( __GNUC__ ) -__attribute__( ( section( ".boot_hdr.dcd_data" ), used ) ) -#elif defined( __ICCARM__ ) -#pragma location = ".boot_hdr.dcd_data" -#endif - -/* TEXT BELOW IS USED AS SETTING FOR TOOLS ************************************* - * !!GlobalInfo - * product: DCDx V2.0 - * processor: MIMXRT1062xxxxA - * package_id: MIMXRT1062DVL6A - * mcu_data: ksdk2_0 - * processor_version: 0.0.0 - * board: MIMXRT1060-EVK - * output_format: c_array - * BE CAREFUL MODIFYING THIS COMMENT - IT IS YAML SETTINGS FOR TOOLS **********/ -/* COMMENTS BELOW ARE USED AS SETTINGS FOR DCD DATA */ -const uint8_t dcd_data[] = -{ - /* HEADER */ - /* Tag */ - 0xD2, - /* Image Length */ - 0x04,0x10, - /* Version */ - 0x41, - - /* COMMANDS */ - - /* group: 'Imported Commands' */ - /* #1.1-113, command header bytes for merged 'Write - value' command */ - 0xCC,0x03, 0x8C, 0x04, - /* #1.1, command: write_value, address: CCM_CCGR0, value: 0xFFFFFFFF, size: 4 */ - 0x40,0x0F, 0xC0, 0x68,0xFF, 0xFF, 0xFF, 0xFF, - /* #1.2, command: write_value, address: CCM_CCGR1, value: 0xFFFFFFFF, size: 4 */ - 0x40,0x0F, 0xC0, 0x6C,0xFF, 0xFF, 0xFF, 0xFF, - /* #1.3, command: write_value, address: CCM_CCGR2, value: 0xFFFFFFFF, size: 4 */ - 0x40,0x0F, 0xC0, 0x70,0xFF, 0xFF, 0xFF, 0xFF, - /* #1.4, command: write_value, address: CCM_CCGR3, value: 0xFFFFFFFF, size: 4 */ - 0x40,0x0F, 0xC0, 0x74,0xFF, 0xFF, 0xFF, 0xFF, - /* #1.5, command: write_value, address: CCM_CCGR4, value: 0xFFFFFFFF, size: 4 */ - 0x40,0x0F, 0xC0, 0x78,0xFF, 0xFF, 0xFF, 0xFF, - /* #1.6, command: write_value, address: CCM_CCGR5, value: 0xFFFFFFFF, size: 4 */ - 0x40,0x0F, 0xC0, 0x7C,0xFF, 0xFF, 0xFF, 0xFF, - /* #1.7, command: write_value, address: CCM_CCGR6, value: 0xFFFFFFFF, size: 4 */ - 0x40,0x0F, 0xC0, 0x80,0xFF, 0xFF, 0xFF, 0xFF, - /* #1.8, command: write_value, address: CCM_ANALOG_PLL_SYS, value: 0x2001, size: 4 */ - 0x40,0x0D, 0x80, 0x30,0x00, 0x00, 0x20, 0x01, - /* #1.9, command: write_value, address: CCM_ANALOG_PFD_528, value: 0x1D0000, size: 4 */ - 0x40,0x0D, 0x81, 0x00,0x00, 0x1D, 0x00, 0x00, - /* #1.10, command: write_value, address: CCM_CBCDR, value: 0x10D40, size: 4 */ - 0x40,0x0F, 0xC0, 0x14,0x00, 0x01, 0x0D, 0x40, - /* #1.11, command: write_value, address: IOMUXC_SW_MUX_CTL_PAD_GPIO_EMC_00, value: 0x00, size: 4 */ - 0x40,0x1F, 0x80, 0x14,0x00, 0x00, 0x00, 0x00, - /* #1.12, command: write_value, address: IOMUXC_SW_MUX_CTL_PAD_GPIO_EMC_01, value: 0x00, size: 4 */ - 0x40,0x1F, 0x80, 0x18,0x00, 0x00, 0x00, 0x00, - /* #1.13, command: write_value, address: IOMUXC_SW_MUX_CTL_PAD_GPIO_EMC_02, value: 0x00, size: 4 */ - 0x40,0x1F, 0x80, 0x1C,0x00, 0x00, 0x00, 0x00, - /* #1.14, command: write_value, address: IOMUXC_SW_MUX_CTL_PAD_GPIO_EMC_03, value: 0x00, size: 4 */ - 0x40,0x1F, 0x80, 0x20,0x00, 0x00, 0x00, 0x00, - /* #1.15, command: write_value, address: IOMUXC_SW_MUX_CTL_PAD_GPIO_EMC_04, value: 0x00, size: 4 */ - 0x40,0x1F, 0x80, 0x24,0x00, 0x00, 0x00, 0x00, - /* #1.16, command: write_value, address: IOMUXC_SW_MUX_CTL_PAD_GPIO_EMC_05, value: 0x00, size: 4 */ - 0x40,0x1F, 0x80, 0x28,0x00, 0x00, 0x00, 0x00, - /* #1.17, command: write_value, address: IOMUXC_SW_MUX_CTL_PAD_GPIO_EMC_06, value: 0x00, size: 4 */ - 0x40,0x1F, 0x80, 0x2C,0x00, 0x00, 0x00, 0x00, - /* #1.18, command: write_value, address: IOMUXC_SW_MUX_CTL_PAD_GPIO_EMC_07, value: 0x00, size: 4 */ - 0x40,0x1F, 0x80, 0x30,0x00, 0x00, 0x00, 0x00, - /* #1.19, command: write_value, address: IOMUXC_SW_MUX_CTL_PAD_GPIO_EMC_08, value: 0x00, size: 4 */ - 0x40,0x1F, 0x80, 0x34,0x00, 0x00, 0x00, 0x00, - /* #1.20, command: write_value, address: IOMUXC_SW_MUX_CTL_PAD_GPIO_EMC_09, value: 0x00, size: 4 */ - 0x40,0x1F, 0x80, 0x38,0x00, 0x00, 0x00, 0x00, - /* #1.21, command: write_value, address: IOMUXC_SW_MUX_CTL_PAD_GPIO_EMC_10, value: 0x00, size: 4 */ - 0x40,0x1F, 0x80, 0x3C,0x00, 0x00, 0x00, 0x00, - /* #1.22, command: write_value, address: IOMUXC_SW_MUX_CTL_PAD_GPIO_EMC_11, value: 0x00, size: 4 */ - 0x40,0x1F, 0x80, 0x40,0x00, 0x00, 0x00, 0x00, - /* #1.23, command: write_value, address: IOMUXC_SW_MUX_CTL_PAD_GPIO_EMC_12, value: 0x00, size: 4 */ - 0x40,0x1F, 0x80, 0x44,0x00, 0x00, 0x00, 0x00, - /* #1.24, command: write_value, address: IOMUXC_SW_MUX_CTL_PAD_GPIO_EMC_13, value: 0x00, size: 4 */ - 0x40,0x1F, 0x80, 0x48,0x00, 0x00, 0x00, 0x00, - /* #1.25, command: write_value, address: IOMUXC_SW_MUX_CTL_PAD_GPIO_EMC_14, value: 0x00, size: 4 */ - 0x40,0x1F, 0x80, 0x4C,0x00, 0x00, 0x00, 0x00, - /* #1.26, command: write_value, address: IOMUXC_SW_MUX_CTL_PAD_GPIO_EMC_15, value: 0x00, size: 4 */ - 0x40,0x1F, 0x80, 0x50,0x00, 0x00, 0x00, 0x00, - /* #1.27, command: write_value, address: IOMUXC_SW_MUX_CTL_PAD_GPIO_EMC_16, value: 0x00, size: 4 */ - 0x40,0x1F, 0x80, 0x54,0x00, 0x00, 0x00, 0x00, - /* #1.28, command: write_value, address: IOMUXC_SW_MUX_CTL_PAD_GPIO_EMC_17, value: 0x00, size: 4 */ - 0x40,0x1F, 0x80, 0x58,0x00, 0x00, 0x00, 0x00, - /* #1.29, command: write_value, address: IOMUXC_SW_MUX_CTL_PAD_GPIO_EMC_18, value: 0x00, size: 4 */ - 0x40,0x1F, 0x80, 0x5C,0x00, 0x00, 0x00, 0x00, - /* #1.30, command: write_value, address: IOMUXC_SW_MUX_CTL_PAD_GPIO_EMC_19, value: 0x00, size: 4 */ - 0x40,0x1F, 0x80, 0x60,0x00, 0x00, 0x00, 0x00, - /* #1.31, command: write_value, address: IOMUXC_SW_MUX_CTL_PAD_GPIO_EMC_20, value: 0x00, size: 4 */ - 0x40,0x1F, 0x80, 0x64,0x00, 0x00, 0x00, 0x00, - /* #1.32, command: write_value, address: IOMUXC_SW_MUX_CTL_PAD_GPIO_EMC_21, value: 0x00, size: 4 */ - 0x40,0x1F, 0x80, 0x68,0x00, 0x00, 0x00, 0x00, - /* #1.33, command: write_value, address: IOMUXC_SW_MUX_CTL_PAD_GPIO_EMC_22, value: 0x00, size: 4 */ - 0x40,0x1F, 0x80, 0x6C,0x00, 0x00, 0x00, 0x00, - /* #1.34, command: write_value, address: IOMUXC_SW_MUX_CTL_PAD_GPIO_EMC_23, value: 0x00, size: 4 */ - 0x40,0x1F, 0x80, 0x70,0x00, 0x00, 0x00, 0x00, - /* #1.35, command: write_value, address: IOMUXC_SW_MUX_CTL_PAD_GPIO_EMC_24, value: 0x00, size: 4 */ - 0x40,0x1F, 0x80, 0x74,0x00, 0x00, 0x00, 0x00, - /* #1.36, command: write_value, address: IOMUXC_SW_MUX_CTL_PAD_GPIO_EMC_25, value: 0x00, size: 4 */ - 0x40,0x1F, 0x80, 0x78,0x00, 0x00, 0x00, 0x00, - /* #1.37, command: write_value, address: IOMUXC_SW_MUX_CTL_PAD_GPIO_EMC_26, value: 0x00, size: 4 */ - 0x40,0x1F, 0x80, 0x7C,0x00, 0x00, 0x00, 0x00, - /* #1.38, command: write_value, address: IOMUXC_SW_MUX_CTL_PAD_GPIO_EMC_27, value: 0x00, size: 4 */ - 0x40,0x1F, 0x80, 0x80,0x00, 0x00, 0x00, 0x00, - /* #1.39, command: write_value, address: IOMUXC_SW_MUX_CTL_PAD_GPIO_EMC_28, value: 0x00, size: 4 */ - 0x40,0x1F, 0x80, 0x84,0x00, 0x00, 0x00, 0x00, - /* #1.40, command: write_value, address: IOMUXC_SW_MUX_CTL_PAD_GPIO_EMC_29, value: 0x00, size: 4 */ - 0x40,0x1F, 0x80, 0x88,0x00, 0x00, 0x00, 0x00, - /* #1.41, command: write_value, address: IOMUXC_SW_MUX_CTL_PAD_GPIO_EMC_30, value: 0x00, size: 4 */ - 0x40,0x1F, 0x80, 0x8C,0x00, 0x00, 0x00, 0x00, - /* #1.42, command: write_value, address: IOMUXC_SW_MUX_CTL_PAD_GPIO_EMC_31, value: 0x00, size: 4 */ - 0x40,0x1F, 0x80, 0x90,0x00, 0x00, 0x00, 0x00, - /* #1.43, command: write_value, address: IOMUXC_SW_MUX_CTL_PAD_GPIO_EMC_32, value: 0x00, size: 4 */ - 0x40,0x1F, 0x80, 0x94,0x00, 0x00, 0x00, 0x00, - /* #1.44, command: write_value, address: IOMUXC_SW_MUX_CTL_PAD_GPIO_EMC_33, value: 0x00, size: 4 */ - 0x40,0x1F, 0x80, 0x98,0x00, 0x00, 0x00, 0x00, - /* #1.45, command: write_value, address: IOMUXC_SW_MUX_CTL_PAD_GPIO_EMC_34, value: 0x00, size: 4 */ - 0x40,0x1F, 0x80, 0x9C,0x00, 0x00, 0x00, 0x00, - /* #1.46, command: write_value, address: IOMUXC_SW_MUX_CTL_PAD_GPIO_EMC_35, value: 0x00, size: 4 */ - 0x40,0x1F, 0x80, 0xA0,0x00, 0x00, 0x00, 0x00, - /* #1.47, command: write_value, address: IOMUXC_SW_MUX_CTL_PAD_GPIO_EMC_36, value: 0x00, size: 4 */ - 0x40,0x1F, 0x80, 0xA4,0x00, 0x00, 0x00, 0x00, - /* #1.48, command: write_value, address: IOMUXC_SW_MUX_CTL_PAD_GPIO_EMC_37, value: 0x00, size: 4 */ - 0x40,0x1F, 0x80, 0xA8,0x00, 0x00, 0x00, 0x00, - /* #1.49, command: write_value, address: IOMUXC_SW_MUX_CTL_PAD_GPIO_EMC_38, value: 0x00, size: 4 */ - 0x40,0x1F, 0x80, 0xAC,0x00, 0x00, 0x00, 0x00, - /* #1.50, command: write_value, address: IOMUXC_SW_MUX_CTL_PAD_GPIO_EMC_39, value: 0x10, size: 4 */ - 0x40,0x1F, 0x80, 0xB0,0x00, 0x00, 0x00, 0x10, - /* #1.51, command: write_value, address: IOMUXC_SW_PAD_CTL_PAD_GPIO_EMC_00, value: 0x110F9, size: 4 */ - 0x40,0x1F, 0x82, 0x04,0x00, 0x01, 0x10, 0xF9, - /* #1.52, command: write_value, address: IOMUXC_SW_PAD_CTL_PAD_GPIO_EMC_01, value: 0x110F9, size: 4 */ - 0x40,0x1F, 0x82, 0x08,0x00, 0x01, 0x10, 0xF9, - /* #1.53, command: write_value, address: IOMUXC_SW_PAD_CTL_PAD_GPIO_EMC_02, value: 0x110F9, size: 4 */ - 0x40,0x1F, 0x82, 0x0C,0x00, 0x01, 0x10, 0xF9, - /* #1.54, command: write_value, address: IOMUXC_SW_PAD_CTL_PAD_GPIO_EMC_03, value: 0x110F9, size: 4 */ - 0x40,0x1F, 0x82, 0x10,0x00, 0x01, 0x10, 0xF9, - /* #1.55, command: write_value, address: IOMUXC_SW_PAD_CTL_PAD_GPIO_EMC_04, value: 0x110F9, size: 4 */ - 0x40,0x1F, 0x82, 0x14,0x00, 0x01, 0x10, 0xF9, - /* #1.56, command: write_value, address: IOMUXC_SW_PAD_CTL_PAD_GPIO_EMC_05, value: 0x110F9, size: 4 */ - 0x40,0x1F, 0x82, 0x18,0x00, 0x01, 0x10, 0xF9, - /* #1.57, command: write_value, address: IOMUXC_SW_PAD_CTL_PAD_GPIO_EMC_06, value: 0x110F9, size: 4 */ - 0x40,0x1F, 0x82, 0x1C,0x00, 0x01, 0x10, 0xF9, - /* #1.58, command: write_value, address: IOMUXC_SW_PAD_CTL_PAD_GPIO_EMC_07, value: 0x110F9, size: 4 */ - 0x40,0x1F, 0x82, 0x20,0x00, 0x01, 0x10, 0xF9, - /* #1.59, command: write_value, address: IOMUXC_SW_PAD_CTL_PAD_GPIO_EMC_08, value: 0x110F9, size: 4 */ - 0x40,0x1F, 0x82, 0x24,0x00, 0x01, 0x10, 0xF9, - /* #1.60, command: write_value, address: IOMUXC_SW_PAD_CTL_PAD_GPIO_EMC_09, value: 0x110F9, size: 4 */ - 0x40,0x1F, 0x82, 0x28,0x00, 0x01, 0x10, 0xF9, - /* #1.61, command: write_value, address: IOMUXC_SW_PAD_CTL_PAD_GPIO_EMC_10, value: 0x110F9, size: 4 */ - 0x40,0x1F, 0x82, 0x2C,0x00, 0x01, 0x10, 0xF9, - /* #1.62, command: write_value, address: IOMUXC_SW_PAD_CTL_PAD_GPIO_EMC_11, value: 0x110F9, size: 4 */ - 0x40,0x1F, 0x82, 0x30,0x00, 0x01, 0x10, 0xF9, - /* #1.63, command: write_value, address: IOMUXC_SW_PAD_CTL_PAD_GPIO_EMC_12, value: 0x110F9, size: 4 */ - 0x40,0x1F, 0x82, 0x34,0x00, 0x01, 0x10, 0xF9, - /* #1.64, command: write_value, address: IOMUXC_SW_PAD_CTL_PAD_GPIO_EMC_13, value: 0x110F9, size: 4 */ - 0x40,0x1F, 0x82, 0x38,0x00, 0x01, 0x10, 0xF9, - /* #1.65, command: write_value, address: IOMUXC_SW_PAD_CTL_PAD_GPIO_EMC_14, value: 0x110F9, size: 4 */ - 0x40,0x1F, 0x82, 0x3C,0x00, 0x01, 0x10, 0xF9, - /* #1.66, command: write_value, address: IOMUXC_SW_PAD_CTL_PAD_GPIO_EMC_15, value: 0x110F9, size: 4 */ - 0x40,0x1F, 0x82, 0x40,0x00, 0x01, 0x10, 0xF9, - /* #1.67, command: write_value, address: IOMUXC_SW_PAD_CTL_PAD_GPIO_EMC_16, value: 0x110F9, size: 4 */ - 0x40,0x1F, 0x82, 0x44,0x00, 0x01, 0x10, 0xF9, - /* #1.68, command: write_value, address: IOMUXC_SW_PAD_CTL_PAD_GPIO_EMC_17, value: 0x110F9, size: 4 */ - 0x40,0x1F, 0x82, 0x48,0x00, 0x01, 0x10, 0xF9, - /* #1.69, command: write_value, address: IOMUXC_SW_PAD_CTL_PAD_GPIO_EMC_18, value: 0x110F9, size: 4 */ - 0x40,0x1F, 0x82, 0x4C,0x00, 0x01, 0x10, 0xF9, - /* #1.70, command: write_value, address: IOMUXC_SW_PAD_CTL_PAD_GPIO_EMC_19, value: 0x110F9, size: 4 */ - 0x40,0x1F, 0x82, 0x50,0x00, 0x01, 0x10, 0xF9, - /* #1.71, command: write_value, address: IOMUXC_SW_PAD_CTL_PAD_GPIO_EMC_20, value: 0x110F9, size: 4 */ - 0x40,0x1F, 0x82, 0x54,0x00, 0x01, 0x10, 0xF9, - /* #1.72, command: write_value, address: IOMUXC_SW_PAD_CTL_PAD_GPIO_EMC_21, value: 0x110F9, size: 4 */ - 0x40,0x1F, 0x82, 0x58,0x00, 0x01, 0x10, 0xF9, - /* #1.73, command: write_value, address: IOMUXC_SW_PAD_CTL_PAD_GPIO_EMC_22, value: 0x110F9, size: 4 */ - 0x40,0x1F, 0x82, 0x5C,0x00, 0x01, 0x10, 0xF9, - /* #1.74, command: write_value, address: IOMUXC_SW_PAD_CTL_PAD_GPIO_EMC_23, value: 0x110F9, size: 4 */ - 0x40,0x1F, 0x82, 0x60,0x00, 0x01, 0x10, 0xF9, - /* #1.75, command: write_value, address: IOMUXC_SW_PAD_CTL_PAD_GPIO_EMC_24, value: 0x110F9, size: 4 */ - 0x40,0x1F, 0x82, 0x64,0x00, 0x01, 0x10, 0xF9, - /* #1.76, command: write_value, address: IOMUXC_SW_PAD_CTL_PAD_GPIO_EMC_25, value: 0x110F9, size: 4 */ - 0x40,0x1F, 0x82, 0x68,0x00, 0x01, 0x10, 0xF9, - /* #1.77, command: write_value, address: IOMUXC_SW_PAD_CTL_PAD_GPIO_EMC_26, value: 0x110F9, size: 4 */ - 0x40,0x1F, 0x82, 0x6C,0x00, 0x01, 0x10, 0xF9, - /* #1.78, command: write_value, address: IOMUXC_SW_PAD_CTL_PAD_GPIO_EMC_27, value: 0x110F9, size: 4 */ - 0x40,0x1F, 0x82, 0x70,0x00, 0x01, 0x10, 0xF9, - /* #1.79, command: write_value, address: IOMUXC_SW_PAD_CTL_PAD_GPIO_EMC_28, value: 0x110F9, size: 4 */ - 0x40,0x1F, 0x82, 0x74,0x00, 0x01, 0x10, 0xF9, - /* #1.80, command: write_value, address: IOMUXC_SW_PAD_CTL_PAD_GPIO_EMC_29, value: 0x110F9, size: 4 */ - 0x40,0x1F, 0x82, 0x78,0x00, 0x01, 0x10, 0xF9, - /* #1.81, command: write_value, address: IOMUXC_SW_PAD_CTL_PAD_GPIO_EMC_30, value: 0x110F9, size: 4 */ - 0x40,0x1F, 0x82, 0x7C,0x00, 0x01, 0x10, 0xF9, - /* #1.82, command: write_value, address: IOMUXC_SW_PAD_CTL_PAD_GPIO_EMC_31, value: 0x110F9, size: 4 */ - 0x40,0x1F, 0x82, 0x80,0x00, 0x01, 0x10, 0xF9, - /* #1.83, command: write_value, address: IOMUXC_SW_PAD_CTL_PAD_GPIO_EMC_32, value: 0x110F9, size: 4 */ - 0x40,0x1F, 0x82, 0x84,0x00, 0x01, 0x10, 0xF9, - /* #1.84, command: write_value, address: IOMUXC_SW_PAD_CTL_PAD_GPIO_EMC_33, value: 0x110F9, size: 4 */ - 0x40,0x1F, 0x82, 0x88,0x00, 0x01, 0x10, 0xF9, - /* #1.85, command: write_value, address: IOMUXC_SW_PAD_CTL_PAD_GPIO_EMC_34, value: 0x110F9, size: 4 */ - 0x40,0x1F, 0x82, 0x8C,0x00, 0x01, 0x10, 0xF9, - /* #1.86, command: write_value, address: IOMUXC_SW_PAD_CTL_PAD_GPIO_EMC_35, value: 0x110F9, size: 4 */ - 0x40,0x1F, 0x82, 0x90,0x00, 0x01, 0x10, 0xF9, - /* #1.87, command: write_value, address: IOMUXC_SW_PAD_CTL_PAD_GPIO_EMC_36, value: 0x110F9, size: 4 */ - 0x40,0x1F, 0x82, 0x94,0x00, 0x01, 0x10, 0xF9, - /* #1.88, command: write_value, address: IOMUXC_SW_PAD_CTL_PAD_GPIO_EMC_37, value: 0x110F9, size: 4 */ - 0x40,0x1F, 0x82, 0x98,0x00, 0x01, 0x10, 0xF9, - /* #1.89, command: write_value, address: IOMUXC_SW_PAD_CTL_PAD_GPIO_EMC_38, value: 0x110F9, size: 4 */ - 0x40,0x1F, 0x82, 0x9C,0x00, 0x01, 0x10, 0xF9, - /* #1.90, command: write_value, address: IOMUXC_SW_PAD_CTL_PAD_GPIO_EMC_39, value: 0x110F9, size: 4 */ - 0x40,0x1F, 0x82, 0xA0,0x00, 0x01, 0x10, 0xF9, - /* #1.91, command: write_value, address: SEMC_MCR, value: 0x10000004, size: 4 */ - 0x40,0x2F, 0x00, 0x00,0x10, 0x00, 0x00, 0x04, - /* #1.92, command: write_value, address: SEMC_BMCR0, value: 0x81, size: 4 */ - 0x40,0x2F, 0x00, 0x08,0x00, 0x00, 0x00, 0x81, - /* #1.93, command: write_value, address: SEMC_BMCR1, value: 0x81, size: 4 */ - 0x40,0x2F, 0x00, 0x0C,0x00, 0x00, 0x00, 0x81, - /* #1.94, command: write_value, address: SEMC_BR0, value: 0x8000001B, size: 4 */ - 0x40,0x2F, 0x00, 0x10,0x80, 0x00, 0x00, 0x1B, - /* #1.95, command: write_value, address: SEMC_BR1, value: 0x8200001B, size: 4 */ - 0x40,0x2F, 0x00, 0x14,0x82, 0x00, 0x00, 0x1B, - /* #1.96, command: write_value, address: SEMC_BR2, value: 0x8400001B, size: 4 */ - 0x40,0x2F, 0x00, 0x18,0x84, 0x00, 0x00, 0x1B, - /* #1.97, command: write_value, address: SEMC_BR3, value: 0x8600001B, size: 4 */ - 0x40,0x2F, 0x00, 0x1C,0x86, 0x00, 0x00, 0x1B, - /* #1.98, command: write_value, address: SEMC_BR4, value: 0x90000021, size: 4 */ - 0x40,0x2F, 0x00, 0x20,0x90, 0x00, 0x00, 0x21, - /* #1.99, command: write_value, address: SEMC_BR5, value: 0xA0000019, size: 4 */ - 0x40,0x2F, 0x00, 0x24,0xA0, 0x00, 0x00, 0x19, - /* #1.100, command: write_value, address: SEMC_BR6, value: 0xA8000017, size: 4 */ - 0x40,0x2F, 0x00, 0x28,0xA8, 0x00, 0x00, 0x17, - /* #1.101, command: write_value, address: SEMC_BR7, value: 0xA900001B, size: 4 */ - 0x40,0x2F, 0x00, 0x2C,0xA9, 0x00, 0x00, 0x1B, - /* #1.102, command: write_value, address: SEMC_BR8, value: 0x21, size: 4 */ - 0x40,0x2F, 0x00, 0x30,0x00, 0x00, 0x00, 0x21, - /* #1.103, command: write_value, address: SEMC_IOCR, value: 0x79A8, size: 4 */ - 0x40,0x2F, 0x00, 0x04,0x00, 0x00, 0x79, 0xA8, - /* #1.104, command: write_value, address: SEMC_SDRAMCR0, value: 0xF31, size: 4 */ - 0x40,0x2F, 0x00, 0x40,0x00, 0x00, 0x0F, 0x31, - /* #1.105, command: write_value, address: SEMC_SDRAMCR1, value: 0x652922, size: 4 */ - 0x40,0x2F, 0x00, 0x44,0x00, 0x65, 0x29, 0x22, - /* #1.106, command: write_value, address: SEMC_SDRAMCR2, value: 0x10920, size: 4 */ - 0x40,0x2F, 0x00, 0x48,0x00, 0x01, 0x09, 0x20, - /* #1.107, command: write_value, address: SEMC_SDRAMCR3, value: 0x50210A08, size: 4 */ - 0x40,0x2F, 0x00, 0x4C,0x50, 0x21, 0x0A, 0x08, - /* #1.108, command: write_value, address: SEMC_DBICR0, value: 0x21, size: 4 */ - 0x40,0x2F, 0x00, 0x80,0x00, 0x00, 0x00, 0x21, - /* #1.109, command: write_value, address: SEMC_DBICR1, value: 0x888888, size: 4 */ - 0x40,0x2F, 0x00, 0x84,0x00, 0x88, 0x88, 0x88, - /* #1.110, command: write_value, address: SEMC_IPCR1, value: 0x02, size: 4 */ - 0x40,0x2F, 0x00, 0x94,0x00, 0x00, 0x00, 0x02, - /* #1.111, command: write_value, address: SEMC_IPCR2, value: 0x00, size: 4 */ - 0x40,0x2F, 0x00, 0x98,0x00, 0x00, 0x00, 0x00, - /* #1.112, command: write_value, address: SEMC_IPCR0, value: 0x80000000, size: 4 */ - 0x40,0x2F, 0x00, 0x90,0x80, 0x00, 0x00, 0x00, - /* #1.113, command: write_value, address: SEMC_IPCMD, value: 0xA55A000F, size: 4 */ - 0x40,0x2F, 0x00, 0x9C,0xA5, 0x5A, 0x00, 0x0F, - /* #2, command: check_any_bit_set, address: SEMC_INTR, value: 0x01, size: 4 */ - 0xCF,0x00, 0x0C, 0x1C,0x40, 0x2F, 0x00, 0x3C,0x00, 0x00, 0x00, 0x01, - /* #3.1-2, command header bytes for merged 'Write - value' command */ - 0xCC,0x00, 0x14, 0x04, - /* #3.1, command: write_value, address: SEMC_IPCR0, value: 0x80000000, size: 4 */ - 0x40,0x2F, 0x00, 0x90,0x80, 0x00, 0x00, 0x00, - /* #3.2, command: write_value, address: SEMC_IPCMD, value: 0xA55A000C, size: 4 */ - 0x40,0x2F, 0x00, 0x9C,0xA5, 0x5A, 0x00, 0x0C, - /* #4, command: check_any_bit_set, address: SEMC_INTR, value: 0x01, size: 4 */ - 0xCF,0x00, 0x0C, 0x1C,0x40, 0x2F, 0x00, 0x3C,0x00, 0x00, 0x00, 0x01, - /* #5.1-2, command header bytes for merged 'Write - value' command */ - 0xCC,0x00, 0x14, 0x04, - /* #5.1, command: write_value, address: SEMC_IPCR0, value: 0x80000000, size: 4 */ - 0x40,0x2F, 0x00, 0x90,0x80, 0x00, 0x00, 0x00, - /* #5.2, command: write_value, address: SEMC_IPCMD, value: 0xA55A000C, size: 4 */ - 0x40,0x2F, 0x00, 0x9C,0xA5, 0x5A, 0x00, 0x0C, - /* #6, command: check_any_bit_set, address: SEMC_INTR, value: 0x01, size: 4 */ - 0xCF,0x00, 0x0C, 0x1C,0x40, 0x2F, 0x00, 0x3C,0x00, 0x00, 0x00, 0x01, - /* #7.1-3, command header bytes for merged 'Write - value' command */ - 0xCC,0x00, 0x1C, 0x04, - /* #7.1, command: write_value, address: SEMC_IPTXDAT, value: 0x33, size: 4 */ - 0x40,0x2F, 0x00, 0xA0,0x00, 0x00, 0x00, 0x33, - /* #7.2, command: write_value, address: SEMC_IPCR0, value: 0x80000000, size: 4 */ - 0x40,0x2F, 0x00, 0x90,0x80, 0x00, 0x00, 0x00, - /* #7.3, command: write_value, address: SEMC_IPCMD, value: 0xA55A000A, size: 4 */ - 0x40,0x2F, 0x00, 0x9C,0xA5, 0x5A, 0x00, 0x0A, - /* #8, command: check_any_bit_set, address: SEMC_INTR, value: 0x01, size: 4 */ - 0xCF,0x00, 0x0C, 0x1C,0x40, 0x2F, 0x00, 0x3C,0x00, 0x00, 0x00, 0x01, - /* #9, command: write_value, address: SEMC_SDRAMCR3, value: 0x50210A09, size: 4 */ - 0xCC,0x00, 0x0C, 0x04,0x40, 0x2F, 0x00, 0x4C,0x50, 0x21, 0x0A, 0x09 -}; -/* BE CAREFUL MODIFYING THIS SETTINGS - IT IS YAML SETTINGS FOR TOOLS */ - -#else /* if defined( XIP_BOOT_HEADER_DCD_ENABLE ) && ( XIP_BOOT_HEADER_DCD_ENABLE == 1 ) */ -const uint8_t dcd_data[] = { 0x00 }; -#endif /* XIP_BOOT_HEADER_DCD_ENABLE */ -#endif /* XIP_BOOT_HEADER_ENABLE */ diff --git a/examples/evkbmimxrt1060/test/board/dcd.h b/examples/evkbmimxrt1060/test/board/dcd.h deleted file mode 100644 index 24a0a1e..0000000 --- a/examples/evkbmimxrt1060/test/board/dcd.h +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright 2020 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -/*********************************************************************************************************************** - * This file was generated by the MCUXpresso Config Tools. Any manual edits made to this file - * will be overwritten if the respective MCUXpresso Config Tools is used to update this file. - **********************************************************************************************************************/ - -#ifndef __DCD__ -#define __DCD__ - -#include - -/*! @name Driver version */ -/*@{*/ -/*! @brief XIP_BOARD driver version 2.0.1. */ -#define FSL_XIP_BOARD_DRIVER_VERSION ( MAKE_VERSION( 2, 0, 1 ) ) -/*@}*/ - -/************************************* -* DCD Data -*************************************/ -#define DCD_TAG_HEADER ( 0xD2 ) -#define DCD_VERSION ( 0x41 ) -#define DCD_TAG_HEADER_SHIFT ( 24 ) -#define DCD_ARRAY_SIZE 1 - -#endif /* __DCD__ */ diff --git a/examples/evkbmimxrt1060/test/board/flash_partitioning.h b/examples/evkbmimxrt1060/test/board/flash_partitioning.h deleted file mode 100644 index 5eb11d9..0000000 --- a/examples/evkbmimxrt1060/test/board/flash_partitioning.h +++ /dev/null @@ -1,55 +0,0 @@ -/* - * FreeRTOS version 202107.00-LTS - * Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - * http://aws.amazon.com/freertos - * http://www.FreeRTOS.org - */ - - -/** - * @brief Header file containing platform abstraction layer APIS for OTA update. - */ - -#ifndef FLASH_PARTITIONING_H -#define FLASH_PARTITIONING_H - -/** Flash device type enabled */ -#define ISSI_IS25WPxxxA - -/* Total Flash Size */ -#define COMPONENT_FLASHIAP_SIZE 8388608 - -/* MCU Flash layout. */ -#define BOOT_FLASH_BASE 0x60000000 -#define BOOT_FLASH_ACT_APP 0x60040000 -#define BOOT_FLASH_CAND_APP 0x60240000 - - -/* Offsets for each image slots used for OTA. */ -#define FLASH_AREA_IMAGE_1_OFFSET ( BOOT_FLASH_ACT_APP - BOOT_FLASH_BASE ) /*MCUboot occupies 512KB */ -#define FLASH_AREA_IMAGE_1_SIZE ( BOOT_FLASH_CAND_APP - BOOT_FLASH_ACT_APP ) /*image1 slot occupies 2MB */ -#define FLASH_AREA_IMAGE_2_OFFSET ( FLASH_AREA_IMAGE_1_OFFSET + FLASH_AREA_IMAGE_1_SIZE ) -#define FLASH_AREA_IMAGE_2_SIZE FLASH_AREA_IMAGE_1_SIZE /*image2 slot occupies 2MB */ -#define FLASH_AREA_IMAGE_3_OFFSET ( FLASH_AREA_IMAGE_2_OFFSET + FLASH_AREA_IMAGE_2_SIZE ) -#define FLASH_AREA_IMAGE_3_SIZE 0x80000 /* scratch slot occupies 512KB */ - - -#endif /* FLASH_PARTITIONING_H */ diff --git a/examples/evkbmimxrt1060/test/board/flexspi_nor_flash_ops.c b/examples/evkbmimxrt1060/test/board/flexspi_nor_flash_ops.c deleted file mode 100644 index 87e8754..0000000 --- a/examples/evkbmimxrt1060/test/board/flexspi_nor_flash_ops.c +++ /dev/null @@ -1,669 +0,0 @@ -/* - * Copyright (c) 2016, Freescale Semiconductor, Inc. - * Copyright 2016-2021 NXP - * All rights reserved. - * - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "flexspi_nor_flash_ops.h" - -/******************************************************************************* - * Definitions - ******************************************************************************/ -#define FLASH_BUSY_STATUS_POL 1 -#define FLASH_BUSY_STATUS_OFFSET 0 - -/******************************************************************************* - * Prototypes - ******************************************************************************/ - -/******************************************************************************* - * Variables - *****************************************************************************/ - -extern const uint32_t customLUT[ CUSTOM_LUT_LENGTH ]; - -/******************************************************************************* - * Code - ******************************************************************************/ -#if defined( ISSI_AT25SFxxxA ) || defined( ISSI_IS25LPxxxA ) || defined( ISSI_IS25WPxxxA ) || defined( WINBOND_W25QxxxJV ) -static status_t flexspi_nor_write_enable( FLEXSPI_Type * base, - uint32_t baseAddr ) -{ - flexspi_transfer_t flashXfer; - status_t status; - - /* Write enable */ - flashXfer.deviceAddress = baseAddr; - flashXfer.port = kFLEXSPI_PortA1; - flashXfer.cmdType = kFLEXSPI_Command; - flashXfer.SeqNumber = 1; - flashXfer.seqIndex = NOR_CMD_LUT_SEQ_IDX_WRITEENABLE; - - status = FLEXSPI_TransferBlocking( base, &flashXfer ); - - return status; -} - -static status_t flexspi_nor_wait_bus_busy( FLEXSPI_Type * base ) -{ - /* Wait status ready. */ - bool isBusy; - uint32_t readValue; - status_t status; - flexspi_transfer_t flashXfer; - - flashXfer.deviceAddress = 0; - flashXfer.port = kFLEXSPI_PortA1; - flashXfer.cmdType = kFLEXSPI_Read; - flashXfer.SeqNumber = 1; - flashXfer.seqIndex = NOR_CMD_LUT_SEQ_IDX_READSTATUSREG; - flashXfer.data = &readValue; - flashXfer.dataSize = 1; - - do - { - status = FLEXSPI_TransferBlocking( base, &flashXfer ); - - if( status != kStatus_Success ) - { - return status; - } - - if( FLASH_BUSY_STATUS_POL ) - { - if( readValue & ( 1U << FLASH_BUSY_STATUS_OFFSET ) ) - { - isBusy = true; - } - else - { - isBusy = false; - } - } - else - { - if( readValue & ( 1U << FLASH_BUSY_STATUS_OFFSET ) ) - { - isBusy = false; - } - else - { - isBusy = true; - } - } - } while( isBusy ); - - return status; -} - -status_t flexspi_nor_flash_erase_sector( FLEXSPI_Type * base, - uint32_t address ) -{ - status_t status; - flexspi_transfer_t flashXfer; - - /* Write enable */ - flashXfer.deviceAddress = address; - flashXfer.port = kFLEXSPI_PortA1; - flashXfer.cmdType = kFLEXSPI_Command; - flashXfer.SeqNumber = 1; - flashXfer.seqIndex = NOR_CMD_LUT_SEQ_IDX_WRITEENABLE; - - status = FLEXSPI_TransferBlocking( base, &flashXfer ); - - if( status != kStatus_Success ) - { - return status; - } - - flashXfer.deviceAddress = address; - flashXfer.port = kFLEXSPI_PortA1; - flashXfer.cmdType = kFLEXSPI_Command; - flashXfer.SeqNumber = 1; - flashXfer.seqIndex = NOR_CMD_LUT_SEQ_IDX_ERASESECTOR; - status = FLEXSPI_TransferBlocking( base, &flashXfer ); - - if( status != kStatus_Success ) - { - return status; - } - - status = flexspi_nor_wait_bus_busy( base ); - - /* Do software reset. */ - FLEXSPI_SoftwareReset( base ); - - return status; -} - -status_t flexspi_nor_flash_page_program( FLEXSPI_Type * base, - uint32_t dstAddr, - const uint32_t * src, - size_t len ) -{ - status_t status; - flexspi_transfer_t flashXfer; - - /* Write enable */ - status = flexspi_nor_write_enable( base, dstAddr ); - - if( status != kStatus_Success ) - { - return status; - } - - /* Prepare page program command */ - flashXfer.deviceAddress = dstAddr; - flashXfer.port = kFLEXSPI_PortA1; - flashXfer.cmdType = kFLEXSPI_Write; - flashXfer.SeqNumber = 1; - flashXfer.seqIndex = NOR_CMD_LUT_SEQ_IDX_PAGEPROGRAM_QUAD; - flashXfer.data = ( uint32_t * ) src; - flashXfer.dataSize = len /*FLASH_PAGE_SIZE*/; - status = FLEXSPI_TransferBlocking( base, &flashXfer ); - - if( status != kStatus_Success ) - { - return status; - } - - status = flexspi_nor_wait_bus_busy( base ); - - /* Do software reset. */ -#if defined( FSL_FEATURE_SOC_OTFAD_COUNT ) - base->AHBCR |= FLEXSPI_AHBCR_CLRAHBRXBUF_MASK | FLEXSPI_AHBCR_CLRAHBTXBUF_MASK; - base->AHBCR &= ~( FLEXSPI_AHBCR_CLRAHBRXBUF_MASK | FLEXSPI_AHBCR_CLRAHBTXBUF_MASK ); -#else - FLEXSPI_SoftwareReset( base ); -#endif - - return status; -} - -#elif defined( Macronix_MX25UM51345G ) || defined( Macronix_MX25UM51345G_2nd ) -status_t flexspi_nor_write_enable( FLEXSPI_Type * base, - uint32_t baseAddr, - bool enableOctal ) -{ - flexspi_transfer_t flashXfer; - status_t status; - - /* Write neable */ - flashXfer.deviceAddress = baseAddr; - flashXfer.port = kFLEXSPI_PortA1; - flashXfer.cmdType = kFLEXSPI_Command; - flashXfer.SeqNumber = 1; - - if( enableOctal ) - { - flashXfer.seqIndex = NOR_CMD_LUT_SEQ_IDX_WRITEENABLE_OPI; - } - else - { - flashXfer.seqIndex = NOR_CMD_LUT_SEQ_IDX_WRITEENABLE; - } - - status = FLEXSPI_TransferBlocking( base, &flashXfer ); - - return status; -} - -status_t flexspi_nor_wait_bus_busy( FLEXSPI_Type * base, - bool enableOctal ) -{ - /* Wait status ready. */ - bool isBusy; - uint32_t readValue; - status_t status; - flexspi_transfer_t flashXfer; - - flashXfer.deviceAddress = 0; - flashXfer.port = kFLEXSPI_PortA1; - flashXfer.cmdType = kFLEXSPI_Read; - flashXfer.SeqNumber = 1; - - if( enableOctal ) - { - flashXfer.seqIndex = NOR_CMD_LUT_SEQ_IDX_READSTATUS_OPI; - } - else - { - flashXfer.seqIndex = NOR_CMD_LUT_SEQ_IDX_READSTATUS; - } - - flashXfer.data = &readValue; - flashXfer.dataSize = 1; - - do - { - status = FLEXSPI_TransferBlocking( base, &flashXfer ); - - if( status != kStatus_Success ) - { - return status; - } - - if( FLASH_BUSY_STATUS_POL ) - { - if( readValue & ( 1U << FLASH_BUSY_STATUS_OFFSET ) ) - { - isBusy = true; - } - else - { - isBusy = false; - } - } - else - { - if( readValue & ( 1U << FLASH_BUSY_STATUS_OFFSET ) ) - { - isBusy = false; - } - else - { - isBusy = true; - } - } - } while( isBusy ); - - return status; -} - -status_t flexspi_nor_enable_octal_mode( FLEXSPI_Type * base ) -{ - flexspi_transfer_t flashXfer; - status_t status; - uint32_t writeValue = FLASH_ENABLE_OCTAL_CMD; - - /* Write neable */ - status = flexspi_nor_write_enable( base, 0, false ); - - if( status != kStatus_Success ) - { - return status; - } - - /* Enable quad mode. */ - flashXfer.deviceAddress = 0; - flashXfer.port = kFLEXSPI_PortA1; - flashXfer.cmdType = kFLEXSPI_Write; - flashXfer.SeqNumber = 1; - flashXfer.seqIndex = NOR_CMD_LUT_SEQ_IDX_ENTEROPI; - flashXfer.data = &writeValue; - flashXfer.dataSize = 1; - - status = FLEXSPI_TransferBlocking( base, &flashXfer ); - - if( status != kStatus_Success ) - { - return status; - } - - status = flexspi_nor_wait_bus_busy( base, true ); - - return status; -} - -status_t flexspi_nor_flash_erase_sector( FLEXSPI_Type * base, - uint32_t address ) -{ - status_t status; - flexspi_transfer_t flashXfer; - - /* Write neable */ - status = flexspi_nor_write_enable( base, 0, true ); - - if( status != kStatus_Success ) - { - return status; - } - - flashXfer.deviceAddress = address; - flashXfer.port = kFLEXSPI_PortA1; - flashXfer.cmdType = kFLEXSPI_Command; - flashXfer.SeqNumber = 1; - flashXfer.seqIndex = NOR_CMD_LUT_SEQ_IDX_ERASESECTOR; - status = FLEXSPI_TransferBlocking( base, &flashXfer ); - - if( status != kStatus_Success ) - { - return status; - } - - status = flexspi_nor_wait_bus_busy( base, true ); - - /* Do software reset. */ - FLEXSPI_SoftwareReset( base ); - - return status; -} - -status_t flexspi_nor_flash_program( FLEXSPI_Type * base, - uint32_t dstAddr, - const uint32_t * src, - uint32_t length ) -{ - status_t status; - flexspi_transfer_t flashXfer; - - /* Write neable */ - status = flexspi_nor_write_enable( base, dstAddr, true ); - - if( status != kStatus_Success ) - { - return status; - } - - /* Prepare page program command */ - flashXfer.deviceAddress = dstAddr; - flashXfer.port = kFLEXSPI_PortA1; - flashXfer.cmdType = kFLEXSPI_Write; - flashXfer.SeqNumber = 1; - flashXfer.seqIndex = NOR_CMD_LUT_SEQ_IDX_PAGEPROGRAM; - flashXfer.data = ( uint32_t * ) src; - flashXfer.dataSize = length; - status = FLEXSPI_TransferBlocking( base, &flashXfer ); - - if( status != kStatus_Success ) - { - return status; - } - - status = flexspi_nor_wait_bus_busy( base, true ); - - /* Do software reset. */ - FLEXSPI_SoftwareReset( base ); - - return status; -} - -#elif defined( Cypress_S26KSxxxS ) -static status_t flexspi_nor_write_enable( FLEXSPI_Type * base, - uint32_t baseAddr ) -{ - flexspi_transfer_t flashXfer; - status_t status; - - /* Write neable */ - flashXfer.deviceAddress = baseAddr; - flashXfer.port = kFLEXSPI_PortA1; - flashXfer.cmdType = kFLEXSPI_Command; - flashXfer.SeqNumber = 2; - flashXfer.seqIndex = HYPERFLASH_CMD_LUT_SEQ_IDX_WRITEENABLE; - - status = FLEXSPI_TransferBlocking( base, &flashXfer ); - - return status; -} - -static status_t flexspi_nor_wait_bus_busy( FLEXSPI_Type * base ) -{ - /* Wait status ready. */ - bool isBusy; - uint32_t readValue; - status_t status; - flexspi_transfer_t flashXfer; - - flashXfer.deviceAddress = 0; - flashXfer.port = kFLEXSPI_PortA1; - flashXfer.cmdType = kFLEXSPI_Read; - flashXfer.SeqNumber = 2; - flashXfer.seqIndex = HYPERFLASH_CMD_LUT_SEQ_IDX_READSTATUS; - flashXfer.data = &readValue; - flashXfer.dataSize = 2; - - do - { - status = FLEXSPI_TransferBlocking( base, &flashXfer ); - - if( status != kStatus_Success ) - { - return status; - } - - if( readValue & 0x8000 ) - { - isBusy = false; - } - else - { - isBusy = true; - } - - if( readValue & 0x3200 ) - { - status = kStatus_Fail; - break; - } - } while( isBusy ); - - return status; -} - - -status_t flexspi_nor_hyperbus_read( FLEXSPI_Type * base, - uint32_t addr, - uint32_t * buffer, - uint32_t bytes ) -{ - flexspi_transfer_t flashXfer; - status_t status; - - flashXfer.deviceAddress = addr * 2; - flashXfer.port = kFLEXSPI_PortA1; - flashXfer.cmdType = kFLEXSPI_Read; - flashXfer.SeqNumber = 1; - flashXfer.seqIndex = HYPERFLASH_CMD_LUT_SEQ_IDX_READDATA; - flashXfer.data = buffer; - flashXfer.dataSize = bytes; - status = FLEXSPI_TransferBlocking( base, &flashXfer ); - - if( status != kStatus_Success ) - { - return status; - } - - return status; -} - -status_t flexspi_nor_flash_erase_sector( FLEXSPI_Type * base, - uint32_t address ) -{ - status_t status; - flexspi_transfer_t flashXfer; - - /* Write enable */ - status = flexspi_nor_write_enable( base, address ); - - if( status != kStatus_Success ) - { - return status; - } - - flashXfer.deviceAddress = address; - flashXfer.port = kFLEXSPI_PortA1; - flashXfer.cmdType = kFLEXSPI_Command; - flashXfer.SeqNumber = 4; - flashXfer.seqIndex = HYPERFLASH_CMD_LUT_SEQ_IDX_ERASESECTOR; - status = FLEXSPI_TransferBlocking( base, &flashXfer ); - - if( status != kStatus_Success ) - { - return status; - } - - status = flexspi_nor_wait_bus_busy( base ); - - /* Do software reset. */ - FLEXSPI_SoftwareReset( EXAMPLE_FLEXSPI ); - - return status; -} - -status_t flexspi_nor_flash_page_program( FLEXSPI_Type * base, - uint32_t address, - const uint32_t * src, - size_t len ) -{ - status_t status; - flexspi_transfer_t flashXfer; - - flexspi_clock_set(); - - /* Write neable */ - status = flexspi_nor_write_enable( base, address ); - - if( status != kStatus_Success ) - { - return status; - } - - /* Prepare page program command */ - flashXfer.deviceAddress = address; - flashXfer.port = kFLEXSPI_PortA1; - flashXfer.cmdType = kFLEXSPI_Write; - flashXfer.SeqNumber = 2; - flashXfer.seqIndex = HYPERFLASH_CMD_LUT_SEQ_IDX_PAGEPROGRAM; - flashXfer.data = ( uint32_t * ) src; - flashXfer.dataSize = len /*FLASH_PAGE_SIZE*/; - status = FLEXSPI_TransferBlocking( base, &flashXfer ); - - if( status != kStatus_Success ) - { - return status; - } - - status = flexspi_nor_wait_bus_busy( base ); - - flexspi_clock_update(); - - return status; -} -#endif /* ISSI_AT25SFxxxA ISSI_IS25LPxxxA ISSI_IS25WPxxxA WINBOND_W25QxxxJV */ - - -/* Make sure the data address is 4 bytes aligned */ -static uint32_t flash_program_buffer[ 64 ]; -status_t sfw_flash_write( uint32_t dstAddr, - const void * src, - size_t len ) -{ - status_t status; - uint8_t page_off = 0; - const uint8_t * src_addr = ( const uint8_t * ) src; - uint16_t write_size = 0; - - if( ( ( dstAddr + len ) & FLEXSPI_BASE_ADDRESS_MASK ) > ( FLASH_SIZE_KB * 0x400 ) ) - { - return -1; - } - - for( ; len > 0; ) - { - page_off = dstAddr % FLASH_PAGE_SIZE; /* An offset value in a page */ - - if( ( page_off + len ) <= FLASH_PAGE_SIZE ) /* Write the last page */ - { - write_size = len; - } - else - { - write_size = FLASH_PAGE_SIZE - page_off; - } - - memcpy( flash_program_buffer, src_addr, write_size ); - status = flexspi_nor_flash_page_program( EXAMPLE_FLEXSPI, dstAddr, flash_program_buffer, write_size ); - - if( status != kStatus_Success ) - { - return -1; - } - - src_addr += write_size; - dstAddr += write_size; - len -= write_size; - } - - return 0; -} - -status_t sfw_flash_read( uint32_t dstAddr, - void * buf, - size_t len ) -{ - uint32_t addr = dstAddr | EXAMPLE_FLEXSPI_AMBA_BASE; - - -/* DCACHE_CleanInvalidateByRange(area->fa_off + off, len); */ - memcpy( buf, ( void * ) addr, len ); - - return 0; -} - -status_t sfw_flash_erase( uint32_t address, - size_t len ) -{ - status_t status; - - if( ( address % SECTOR_SIZE ) || ( len % SECTOR_SIZE ) ) - { - return -1; - } - - for( ; len > 0; len -= SECTOR_SIZE ) - { - /* Erase sectors. */ - status = flexspi_nor_flash_erase_sector( EXAMPLE_FLEXSPI, address ); - - if( status != kStatus_Success ) - { - return -1; - } - - address += SECTOR_SIZE; - } - - return 0; -} - -status_t sfw_flash_init( void ) -{ - /* Update LUT table. */ - FLEXSPI_UpdateLUT( EXAMPLE_FLEXSPI, 0, &customLUT[ 0 ], CUSTOM_LUT_LENGTH ); - - /* Do software reset. */ - FLEXSPI_SoftwareReset( EXAMPLE_FLEXSPI ); - - return kStatus_Success; -} - -status_t sfw_flash_read_ipc( uint32_t address, - uint8_t * buffer, - uint32_t length ) -{ - status_t status; - flexspi_transfer_t flashXfer; - - /* Prepare page program command */ - flashXfer.deviceAddress = address & ( ~EXAMPLE_FLEXSPI_AMBA_BASE ); - flashXfer.port = kFLEXSPI_PortA1; - flashXfer.cmdType = kFLEXSPI_Read; - flashXfer.SeqNumber = 1; - flashXfer.seqIndex = NOR_CMD_LUT_SEQ_IDX_READ_FAST_QUAD; - flashXfer.data = ( uint32_t * ) ( void * ) buffer; - flashXfer.dataSize = length; - status = FLEXSPI_TransferBlocking( EXAMPLE_FLEXSPI, &flashXfer ); - - if( status != kStatus_Success ) - { - return status; - } - - status = flexspi_nor_wait_bus_busy( EXAMPLE_FLEXSPI ); - - return status; -} diff --git a/examples/evkbmimxrt1060/test/board/flexspi_nor_flash_ops.h b/examples/evkbmimxrt1060/test/board/flexspi_nor_flash_ops.h deleted file mode 100644 index 76fa090..0000000 --- a/examples/evkbmimxrt1060/test/board/flexspi_nor_flash_ops.h +++ /dev/null @@ -1,79 +0,0 @@ -/* - * Copyright 2018-2021 NXP - * All rights reserved. - * - * - * SPDX-License-Identifier: BSD-3-Clause - */ -#ifndef _FLEXSPI_FLASH_CONFIG_H_ -#define _FLEXSPI_FLASH_CONFIG_H_ - -#include -#include "fsl_flexspi.h" - -/******************************************************************************* - * Definitions - ******************************************************************************/ -/*${macro:start}*/ -#define EXAMPLE_FLEXSPI FLEXSPI -#define FLASH_SIZE_KB ( COMPONENT_FLASHIAP_SIZE / 1024 ) /* 0x2000= 64Mb/KByte */ -#define EXAMPLE_FLEXSPI_AMBA_BASE FlexSPI_AMBA_BASE -#define FLASH_PAGE_SIZE ( 256 ) -#define SECTOR_SIZE ( 0x1000 ) /* 4K */ -#define FLEXSPI_BASE_ADDRESS_MASK ( FLASH_SIZE_KB * 0x400 - 1 ) - -#define NOR_CMD_LUT_SEQ_IDX_READ_FAST_QUAD 0 /* set it to index0 to align with xip settings */ -#define NOR_CMD_LUT_SEQ_IDX_WRITEENABLE 2 -#define NOR_CMD_LUT_SEQ_IDX_ERASESECTOR 3 -#define NOR_CMD_LUT_SEQ_IDX_PAGEPROGRAM_QUAD 4 -#define NOR_CMD_LUT_SEQ_IDX_ERASECHIP 5 -#define NOR_CMD_LUT_SEQ_IDX_WRITESTATUSREG 9 -#define NOR_CMD_LUT_SEQ_IDX_READSTATUSREG 12 - -#define CUSTOM_LUT_LENGTH 60 -#define FLASH_BUSY_STATUS_POL 1 -#define FLASH_BUSY_STATUS_OFFSET 0 - -/*${macro:end}*/ - -/******************************************************************************* - * Prototypes - ******************************************************************************/ -/*${prototype:start}*/ -void BOARD_InitHardware( void ); -static inline void flexspi_clock_init( void ) -{ -#if defined( XIP_EXTERNAL_FLASH ) && ( XIP_EXTERNAL_FLASH == 1 ) - CLOCK_SetMux( kCLOCK_FlexspiMux, 0x2 ); /* Choose PLL2 PFD2 clock as flexspi source clock. 396M */ - CLOCK_SetDiv( kCLOCK_FlexspiDiv, 2 ); /* flexspi clock 133M. */ -#else - const clock_usb_pll_config_t g_ccmConfigUsbPll = { .loopDivider = 0U }; - CLOCK_InitUsb1Pll( &g_ccmConfigUsbPll ); - CLOCK_InitUsb1Pfd( kCLOCK_Pfd0, 24 ); /* Set PLL3 PFD0 clock 360MHZ. */ - CLOCK_SetMux( kCLOCK_FlexspiMux, 0x3 ); /* Choose PLL3 PFD0 clock as flexspi source clock. */ - CLOCK_SetDiv( kCLOCK_FlexspiDiv, 2 ); /* flexspi clock 120M. */ -#endif -} - -status_t sfw_flash_erase( uint32_t address, - size_t len ); -status_t sfw_flash_write( uint32_t dstAddr, - const void * src, - size_t len ); -status_t sfw_flash_read( uint32_t dstAddr, - void * buf, - size_t len ); -status_t sfw_flash_init( void ); -status_t sfw_flash_read_ipc( uint32_t address, - uint8_t * buffer, - uint32_t length ); -status_t flexspi_nor_flash_erase_sector( FLEXSPI_Type * base, - uint32_t address ); -status_t flexspi_nor_flash_page_program( FLEXSPI_Type * base, - uint32_t dstAddr, - const uint32_t * src, - size_t len ); - -/*${prototype:end}*/ - -#endif /* _FLEXSPI_FLASH_H_ */ diff --git a/examples/evkbmimxrt1060/test/board/mflash_drv.c b/examples/evkbmimxrt1060/test/board/mflash_drv.c deleted file mode 100644 index 4006471..0000000 --- a/examples/evkbmimxrt1060/test/board/mflash_drv.c +++ /dev/null @@ -1,691 +0,0 @@ -/* - * Copyright 2018-2021 NXP - * - * SPDX - * License-Identifier: BSD-3-Clause - */ - -#include - -#include "fsl_flexspi.h" -#include "fsl_cache.h" -#include "pin_mux.h" - -#include "mflash_drv.h" -#include "flexspi_nor_flash_ops.h" - - -#ifndef XIP_EXTERNAL_FLASH - -#define FLASH_SIZE 0x8000 - -flexspi_device_config_t deviceconfig = -{ - .flexspiRootClk = 100000000, - .flashSize = FLASH_SIZE, - .CSIntervalUnit = kFLEXSPI_CsIntervalUnit1SckCycle, - .CSInterval = 2, - .CSHoldTime = 3, - .CSSetupTime = 3, - .dataValidTime = 0, - .columnspace = 0, - .enableWordAddress = 0, - .AWRSeqIndex = 0, - .AWRSeqNumber = 0, - .ARDSeqIndex = NOR_CMD_LUT_SEQ_IDX_READ_FAST_QUAD, - .ARDSeqNumber = 1, - .AHBWriteWaitUnit = kFLEXSPI_AhbWriteWaitUnit2AhbCycle, - .AHBWriteWaitInterval = 0, -}; -#endif /* ifndef XIP_EXTERNAL_FLASH */ - -/* Custom LUT Table for ISSI_IS25WPxxxA used in RT1060. */ -static uint32_t customLUT[ CUSTOM_LUT_LENGTH ] = -{ - [ 4 * NOR_CMD_LUT_SEQ_IDX_READ_FAST_QUAD ] = - FLEXSPI_LUT_SEQ( kFLEXSPI_Command_SDR, kFLEXSPI_1PAD, 0xEB, kFLEXSPI_Command_RADDR_SDR, kFLEXSPI_4PAD, 0x18 ), - [ 4 * NOR_CMD_LUT_SEQ_IDX_READ_FAST_QUAD + 1 ] = FLEXSPI_LUT_SEQ( - kFLEXSPI_Command_DUMMY_SDR, kFLEXSPI_4PAD, 0x06, kFLEXSPI_Command_READ_SDR, kFLEXSPI_4PAD, 0x04 ), - - /* Erase Sector */ - [ 4 * NOR_CMD_LUT_SEQ_IDX_ERASESECTOR ] = - FLEXSPI_LUT_SEQ( kFLEXSPI_Command_SDR, kFLEXSPI_1PAD, 0xD7, kFLEXSPI_Command_RADDR_SDR, kFLEXSPI_1PAD, 0x18 ), - - /* Erase whole chip */ - [ 4 * NOR_CMD_LUT_SEQ_IDX_ERASECHIP ] = - FLEXSPI_LUT_SEQ( kFLEXSPI_Command_SDR, kFLEXSPI_1PAD, 0xC7, kFLEXSPI_Command_STOP, kFLEXSPI_1PAD, 0 ), - - /* Page Program - quad mode or Octal mode */ - [ 4 * NOR_CMD_LUT_SEQ_IDX_PAGEPROGRAM_QUAD ] = - FLEXSPI_LUT_SEQ( kFLEXSPI_Command_SDR, kFLEXSPI_1PAD, 0x32, kFLEXSPI_Command_RADDR_SDR, kFLEXSPI_1PAD, 0x18 ), - [ 4 * NOR_CMD_LUT_SEQ_IDX_PAGEPROGRAM_QUAD + 1 ] = - FLEXSPI_LUT_SEQ( kFLEXSPI_Command_WRITE_SDR, kFLEXSPI_4PAD, 0x01 /*0x04*/, kFLEXSPI_Command_STOP, kFLEXSPI_1PAD, 0 ), - - /* Read status register */ - [ 4 * NOR_CMD_LUT_SEQ_IDX_READSTATUSREG ] = - FLEXSPI_LUT_SEQ( kFLEXSPI_Command_SDR, kFLEXSPI_1PAD, 0x05, kFLEXSPI_Command_READ_SDR, kFLEXSPI_1PAD, 0x04 ), - - /* Write Enable */ - [ 4 * NOR_CMD_LUT_SEQ_IDX_WRITEENABLE ] = - FLEXSPI_LUT_SEQ( kFLEXSPI_Command_SDR, kFLEXSPI_1PAD, 0x06, kFLEXSPI_Command_STOP, kFLEXSPI_1PAD, 0 ) -}; - -static status_t flexspi_nor_wait_bus_busy( FLEXSPI_Type * base ) -{ - /* Wait status ready. */ - bool isBusy; - uint32_t readValue; - status_t status; - flexspi_transfer_t flashXfer; - - flashXfer.deviceAddress = 0; - flashXfer.port = kFLEXSPI_PortA1; - flashXfer.cmdType = kFLEXSPI_Read; - flashXfer.SeqNumber = 1; - flashXfer.seqIndex = NOR_CMD_LUT_SEQ_IDX_READSTATUSREG; - flashXfer.data = &readValue; - flashXfer.dataSize = 1; - - do - { - status = FLEXSPI_TransferBlocking( base, &flashXfer ); - - if( status != kStatus_Success ) - { - return status; - } - - if( FLASH_BUSY_STATUS_POL ) - { - if( readValue & ( 1U << FLASH_BUSY_STATUS_OFFSET ) ) - { - isBusy = true; - } - else - { - isBusy = false; - } - } - else - { - if( readValue & ( 1U << FLASH_BUSY_STATUS_OFFSET ) ) - { - isBusy = false; - } - else - { - isBusy = true; - } - } - } while( isBusy ); - - return status; -} - -static status_t flexspi_nor_write_enable( FLEXSPI_Type * base, - uint32_t address ) -{ - flexspi_transfer_t flashXfer; - status_t status; - - /* Write neable */ - flashXfer.deviceAddress = address; - flashXfer.port = kFLEXSPI_PortA1; - flashXfer.cmdType = kFLEXSPI_Command; - flashXfer.SeqNumber = 1; - flashXfer.seqIndex = NOR_CMD_LUT_SEQ_IDX_WRITEENABLE; - - status = FLEXSPI_TransferBlocking( base, &flashXfer ); - - return status; -} - -status_t flexspi_nor_enable_quad_mode( FLEXSPI_Type * base ) -{ - flexspi_transfer_t flashXfer; - status_t status; - uint32_t writeValue = 0x40; - - /* Write neable */ - status = flexspi_nor_write_enable( base, 0 ); - - if( status != kStatus_Success ) - { - return status; - } - - /* Enable quad mode. */ - flashXfer.deviceAddress = 0; - flashXfer.port = kFLEXSPI_PortA1; - flashXfer.cmdType = kFLEXSPI_Write; - flashXfer.SeqNumber = 1; - flashXfer.seqIndex = NOR_CMD_LUT_SEQ_IDX_WRITESTATUSREG; - flashXfer.data = &writeValue; - flashXfer.dataSize = 1; - - status = FLEXSPI_TransferBlocking( base, &flashXfer ); - - if( status != kStatus_Success ) - { - return status; - } - - status = flexspi_nor_wait_bus_busy( base ); - - return status; -} - -static status_t flexspi_nor_flash_sector_erase( FLEXSPI_Type * base, - uint32_t address ) -{ - status_t status; - flexspi_transfer_t flashXfer; - - /* Write enable */ - status = flexspi_nor_write_enable( base, address ); - - if( status != kStatus_Success ) - { - return status; - } - - flashXfer.deviceAddress = address; - flashXfer.port = kFLEXSPI_PortA1; - flashXfer.cmdType = kFLEXSPI_Command; - flashXfer.SeqNumber = 1; - flashXfer.seqIndex = NOR_CMD_LUT_SEQ_IDX_ERASESECTOR; - status = FLEXSPI_TransferBlocking( base, &flashXfer ); - - if( status != kStatus_Success ) - { - return status; - } - - status = flexspi_nor_wait_bus_busy( base ); - - return status; -} - - -status_t flexspi_nor_read_data( FLEXSPI_Type * base, - uint32_t startAddress, - uint32_t * buffer, - uint32_t length ) -{ - status_t status; - flexspi_transfer_t flashXfer; - uint32_t readAddress = startAddress; - - /* Read page. */ - flashXfer.deviceAddress = readAddress; - flashXfer.port = kFLEXSPI_PortA1; - flashXfer.cmdType = kFLEXSPI_Read; - flashXfer.SeqNumber = 1; - flashXfer.seqIndex = NOR_CMD_LUT_SEQ_IDX_READ_FAST_QUAD; - flashXfer.data = buffer; - flashXfer.dataSize = length; - - status = FLEXSPI_TransferBlocking( base, &flashXfer ); - - return status; -} - -/* Initialize flash peripheral, - * cannot be invoked directly, requires calling wrapper in non XIP memory */ -static int32_t mflash_drv_init_internal( void ) -{ - /* NOTE: Multithread access is not supported for SRAM target. - * XIP target MUST be protected by disabling global interrupts - * since all ISR (and API that is used inside) is placed at XIP. - * It is necessary to place at least "mflash_drv.o", "fsl_flexspi.o" to SRAM */ - /* disable interrupts when running from XIP */ - uint32_t primask = __get_PRIMASK(); - - __asm( "cpsid i" ); - - status_t status = kStatus_Success; - -#ifndef XIP_EXTERNAL_FLASH - flexspi_config_t config; - - /* Get FLEXSPI default settings and configure the flexspi. */ - FLEXSPI_GetDefaultConfig( &config ); - - /* Set AHB buffer size for reading data through AHB bus. */ - config.ahbConfig.enableAHBPrefetch = true; - config.ahbConfig.enableAHBBufferable = true; - config.ahbConfig.enableAHBCachable = true; - config.rxSampleClock = kFLEXSPI_ReadSampleClkLoopbackFromDqsPad; - FLEXSPI_Init( MFLASH_FLEXSPI, &config ); - - /* AHB Read Address option bit. This option bit is intend to remove AHB burst start address alignment limitation */ - MFLASH_FLEXSPI->AHBCR |= FLEXSPI_AHBCR_READADDROPT_MASK; - - /* Configure flash settings according to serial flash feature. */ - FLEXSPI_SetFlashConfig( MFLASH_FLEXSPI, &deviceconfig, kFLEXSPI_PortA1 ); -#endif /* ifndef XIP_EXTERNAL_FLASH */ - - /* Update LUT table. */ - FLEXSPI_UpdateLUT( MFLASH_FLEXSPI, 0, customLUT, CUSTOM_LUT_LENGTH ); - - /*FLEXSPI_SoftwareReset(MFLASH_FLEXSPI); */ - - -#ifndef XIP_EXTERNAL_FLASH - /* Enter quad mode. */ - status = flexspi_nor_enable_quad_mode( MFLASH_FLEXSPI ); -#endif - - if( primask == 0 ) - { - __asm( "cpsie i" ); - } - - return status; -} - -/* API - initialize 'mflash' */ -int32_t mflash_drv_init( void ) -{ - /* Necessary to have double wrapper call in non_xip memory */ - return mflash_drv_init_internal(); -} - -/* Internal - erase single sector */ -static int32_t mflash_drv_sector_erase_internal( uint32_t sector_addr ) -{ - status_t status; - uint32_t primask = __get_PRIMASK(); - - __asm( "cpsid i" ); - - status = flexspi_nor_flash_sector_erase( MFLASH_FLEXSPI, sector_addr ); - - /* Do software reset. */ - FLEXSPI_SoftwareReset( MFLASH_FLEXSPI ); - - DCACHE_InvalidateByRange( MFLASH_BASE_ADDRESS + sector_addr, MFLASH_SECTOR_SIZE ); - - if( primask == 0 ) - { - __asm( "cpsie i" ); - } - - /* Flush pipeline to allow pending interrupts take place - * before starting next loop */ - __ISB(); - - return status; -} - -/* Calling wrapper for 'mflash_drv_sector_erase_internal'. - * Erase one sector starting at 'sector_addr' - must be sector aligned. - */ -int32_t mflash_drv_sector_erase( uint32_t sector_addr ) -{ - if( 0 == mflash_drv_is_sector_aligned( sector_addr ) ) - { - return kStatus_InvalidArgument; - } - - return mflash_drv_sector_erase_internal( sector_addr ); -} - -/* Internal - write single page */ -static int32_t mflash_drv_page_program_internal( uint32_t page_addr, - uint32_t * data ) -{ - uint32_t primask = __get_PRIMASK(); - - __asm( "cpsid i" ); - - status_t status; - - status = flexspi_nor_flash_page_program( MFLASH_FLEXSPI, page_addr, data, MFLASH_PAGE_SIZE ); - - /* Do software reset. */ - FLEXSPI_SoftwareReset( MFLASH_FLEXSPI ); - - DCACHE_InvalidateByRange( MFLASH_BASE_ADDRESS + page_addr, MFLASH_PAGE_SIZE ); - - if( primask == 0 ) - { - __asm( "cpsie i" ); - } - - /* Flush pipeline to allow pending interrupts take place - * before starting next loop */ - __ISB(); - - return status; -} - -/* Calling wrapper for 'mflash_drv_page_program_internal'. - * Write 'data' to 'page_addr' - must be page aligned. - * NOTE: Don't try to store constant data that are located in XIP !! - */ -int32_t mflash_drv_page_program( uint32_t page_addr, - uint32_t * data ) -{ - if( 0 == mflash_drv_is_page_aligned( page_addr ) ) - { - return kStatus_InvalidArgument; - } - - return mflash_drv_page_program_internal( page_addr, data ); -} - -/* Internal - read data */ -static int32_t mflash_drv_read_internal( uint32_t addr, - uint32_t * buffer, - uint32_t len ) -{ - uint32_t primask = __get_PRIMASK(); - - __asm( "cpsid i" ); - - status_t status; - - status = flexspi_nor_read_data( MFLASH_FLEXSPI, addr, buffer, len ); - - /* Do software reset. */ - FLEXSPI_SoftwareReset( MFLASH_FLEXSPI ); - - if( primask == 0 ) - { - __asm( "cpsie i" ); - } - - /* Flush pipeline to allow pending interrupts take place - * before starting next loop */ - __ISB(); - - return status; -} - -/* Calling wrapper for 'mflash_drv_read_internal'. */ -int32_t mflash_drv_read( uint32_t addr, - uint32_t * buffer, - uint32_t len ) -{ - /* Check alignment */ - if( ( ( uint32_t ) buffer % 4 ) || ( len % 4 ) ) - { - return kStatus_InvalidArgument; - } - - return mflash_drv_read_internal( addr, buffer, len ); -} - -/* Returns pointer (AHB address) to memory area where the specified region of FLASH is mapped, NULL on failure (could - * not map continuous block) */ -void * mflash_drv_phys2log( uint32_t addr, - uint32_t len ) -{ - /* take FLEXSPI remapping into account */ - uint32_t remap_offset = IOMUXC_GPR->GPR32 & 0xFFFFF000; - uint32_t remap_start = IOMUXC_GPR->GPR30 & 0xFFFFF000; - uint32_t remap_end = IOMUXC_GPR->GPR31 & 0xFFFFF000; - - /* calculate the bus address where the requested FLASH region is expected to be available */ - uint32_t bus_addr = addr + MFLASH_BASE_ADDRESS; - - if( ( remap_offset == 0 ) || ( remap_end <= remap_start ) ) - { - /* remapping is not active */ - return ( void * ) bus_addr; - } - - if( ( remap_start >= bus_addr + len ) || ( remap_end <= bus_addr ) ) - { - /* remapping window does not collide with bus addresses normally assigned for requested range of FLASH */ - return ( void * ) bus_addr; - } - - if( ( remap_start + remap_offset <= bus_addr ) && ( remap_end + remap_offset >= bus_addr + len ) ) - { - /* remapping window covers the whole requested range of FLASH, return address adjusted by negative offset */ - return ( void * ) ( bus_addr - remap_offset ); - } - - /* the bus address region normally assigned for requested range of FLASH is partially or completely shadowed by - * remapping, fail */ - return NULL; -} - -/* Returns address of physical memory where the area accessible by given pointer is actually stored, UINT32_MAX on - * failure (could not map as continuous block) */ -uint32_t mflash_drv_log2phys( void * ptr, - uint32_t len ) -{ - /* take FLEXSPI remapping into account */ - uint32_t remap_offset = IOMUXC_GPR->GPR32 & 0xFFFFF000; - uint32_t remap_start = IOMUXC_GPR->GPR30 & 0xFFFFF000; - uint32_t remap_end = IOMUXC_GPR->GPR31 & 0xFFFFF000; - - /* calculate the bus address where the requested FLASH region is expected to be available */ - uint32_t bus_addr = ( uint32_t ) ptr; - - if( bus_addr < MFLASH_BASE_ADDRESS ) - { - /* the pointer points outside of the flash memory area */ - return UINT32_MAX; - } - - if( ( remap_offset == 0 ) || ( remap_end <= remap_start ) ) - { - /* remapping is not active */ - return( bus_addr - MFLASH_BASE_ADDRESS ); - } - - if( ( remap_start >= bus_addr + len ) || ( remap_end <= bus_addr ) ) - { - /* remapping window does not affect the requested memory area */ - return( bus_addr - MFLASH_BASE_ADDRESS ); - } - - if( ( remap_start <= bus_addr ) && ( remap_end >= bus_addr + len ) ) - { - /* remapping window covers the whole address range, return address adjusted by offset */ - return( bus_addr + remap_offset - MFLASH_BASE_ADDRESS ); - } - - /* the bus address region partially collides with the remapping window, hence the range is not mapped to continuous - * block in the FLASH, fail */ - return UINT32_MAX; -} - -/* Temporary sector shadow buffer. Use uint32_t type to force 4B alignment and - * improve copy operation */ -static uint32_t g_flashm_sector[ MFLASH_SECTOR_SIZE / sizeof( uint32_t ) ]; - -/* Internal - write data of 'data_len' to single sector 'sector_addr', starting from 'sect_off' */ -static int32_t mflash_drv_sector_update( uint32_t sector_addr, - uint32_t sect_off, - const uint8_t * data, - uint32_t data_len ) -{ - int sector_erase_req = 0; - uint32_t page_program_map = 0; /* Current implementation is limited to 32 pages per sector */ - - /* Address not aligned to sector boundary */ - if( false == mflash_drv_is_sector_aligned( sector_addr ) ) - { - return -1; - } - - /* Offset + length exceeed sector size */ - if( sect_off + data_len > MFLASH_SECTOR_SIZE ) - { - return -1; - } - - if( 0 != mflash_drv_read( sector_addr, &g_flashm_sector[ 0 ], sizeof( g_flashm_sector ) ) ) - { - return -2; - } - - /* Diff the data to determine pages to be programed */ - for( uint32_t i = 0; i < data_len; i++ ) - { - uint8_t cur_value = ( ( uint8_t * ) ( g_flashm_sector ) )[ sect_off + i ]; - uint8_t new_value = data[ i ]; - - if( ( cur_value | new_value ) != cur_value ) - { - /* A bit needs to be flipped from 0 to 1, the whole sector has to be erased */ - sector_erase_req = 1; - break; - } - - if( cur_value != new_value ) - { - /* There is a change, the page has to be programmed for sure */ - page_program_map |= 1 << ( ( sect_off + i ) / MFLASH_PAGE_SIZE ); - } - } - -#if !defined( MFLASH_INC_WRITES ) || !MFLASH_INC_WRITES - /* Perform blank check page by page until decision for sector erase is made or we reach last page of the sector */ - for( int page_idx = 0; ( 0 == sector_erase_req ) && page_idx < MFLASH_SECTOR_SIZE / MFLASH_PAGE_SIZE; page_idx++ ) - { - /* Check only pages which need to be programed */ - if( page_program_map & ( 1 << page_idx ) ) - { - int page_word_start = page_idx * ( MFLASH_PAGE_SIZE / sizeof( g_flashm_sector[ 0 ] ) ); - int page_word_end = page_word_start + ( MFLASH_PAGE_SIZE / sizeof( g_flashm_sector[ 0 ] ) ); - - for( int i = page_word_start; i < page_word_end; i++ ) - { - if( g_flashm_sector[ i ] != 0xFFFFFFFF ) - { - /* Mark sector to be erased and quit */ - sector_erase_req = 1; - break; - } - } - } - } -#endif /* if !defined( MFLASH_INC_WRITES ) || !MFLASH_INC_WRITES */ - - /* Copy data to be programmed byte by byte to shadow buffer at proper position */ - for( uint32_t i = 0; i < data_len; i++ ) - { - ( ( uint8_t * ) g_flashm_sector )[ sect_off + i ] = data[ i ]; - } - - /* If sector is to be erased, update page program map according to non-blank areas in the shadow buffer */ - if( 0 != sector_erase_req ) - { - for( int page_idx = 0; page_idx < MFLASH_SECTOR_SIZE / MFLASH_PAGE_SIZE; page_idx++ ) - { - int page_word_start = page_idx * ( MFLASH_PAGE_SIZE / sizeof( g_flashm_sector[ 0 ] ) ); - int page_word_end = page_word_start + ( MFLASH_PAGE_SIZE / sizeof( g_flashm_sector[ 0 ] ) ); - - for( int i = page_word_start; i < page_word_end; i++ ) - { - if( g_flashm_sector[ i ] != 0xFFFFFFFF ) - { - /* Mark the page for programming and go for next one */ - page_program_map |= ( 1 << page_idx ); - break; - } - } - } - } - - /* Erase the sector if required */ - if( 0 != sector_erase_req ) - { - if( 0 != mflash_drv_sector_erase( sector_addr ) ) - { - return -2; - } - } - - /* Program the required pages */ - for( int page_idx = 0; page_idx < MFLASH_SECTOR_SIZE / MFLASH_PAGE_SIZE; page_idx++ ) - { - if( page_program_map & ( 1 << page_idx ) ) - { - if( 0 != - mflash_drv_page_program( sector_addr + page_idx * MFLASH_PAGE_SIZE, - g_flashm_sector + page_idx * ( MFLASH_PAGE_SIZE / sizeof( g_flashm_sector[ 0 ] ) ) ) ) - { - return -3; - } - } - } - - /* mflash_drv_read_mode(); */ - return 0; -} - -/* Write data to flash, cannot be invoked directly, requires calling wrapper in non XIP memory */ -int32_t mflash_drv_write_internal( uint32_t addr, - const uint8_t * data, - uint32_t data_len ) -{ - /* Interval <0, sector_size) */ - uint32_t to_write = 0; - /* Interval (data_len, 0> */ - uint32_t to_remain = data_len; - /* Physical address in external FLASH device */ - - int32_t result = 0; - - for( - /* Calculate address of first sector */ - uint32_t sect_a = ( addr / MFLASH_SECTOR_SIZE ) * MFLASH_SECTOR_SIZE, - /* and first sector offset */ - sect_of = addr % MFLASH_SECTOR_SIZE, - /* and set first data offset to 0*/ - data_of = 0; - /* Continue until sector address exceed target address + data_length */ - sect_a < addr + data_len; - /* Move to next sector */ - sect_a += MFLASH_SECTOR_SIZE, - /* and move pointer to data */ - data_of += to_write ) - { - /* If remaining data is exceed 'sector_size', write 'sector_size' length */ - if( to_remain > MFLASH_SECTOR_SIZE - sect_of ) - { - to_write = MFLASH_SECTOR_SIZE - sect_of; - to_remain = to_remain - to_write; - } - /* else write remaining data length */ - else - { - to_write = to_remain; - to_remain = 0; - } - - /* Write at 'sect_a' sector, starting at 'sect_of' using '&data[data_of]' of length 'to_write' */ - result = mflash_drv_sector_update( sect_a, sect_of, data + data_of, to_write ); - - if( 0 != result ) - { - return -1; - } - - /* Only first sector is allowed to have an offset */ - sect_of = 0; - } - - return 0; -} - -/* Calling wrapper for 'mflash_drv_write_internal'. - * Write 'data' of 'data_len' to 'any_addr' - which doesn't have to be sector aligned. - * NOTE: Don't try to store constant data that are located in XIP !! - */ -int32_t mflash_drv_write( uint32_t addr, - const uint8_t * data, - uint32_t data_len ) -{ - volatile int32_t result; - - result = mflash_drv_write_internal( addr, data, data_len ); - return result; -} diff --git a/examples/evkbmimxrt1060/test/board/mflash_drv.h b/examples/evkbmimxrt1060/test/board/mflash_drv.h deleted file mode 100644 index 668b083..0000000 --- a/examples/evkbmimxrt1060/test/board/mflash_drv.h +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright 2018-2021 NXP - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#ifndef __MFLASH_DRV_H__ -#define __MFLASH_DRV_H__ - -#include "mflash_common.h" - -/* Flash constants */ -#ifndef MFLASH_SECTOR_SIZE -#define MFLASH_SECTOR_SIZE ( 0x1000 ) -#endif - -#ifndef MFLASH_PAGE_SIZE -#define MFLASH_PAGE_SIZE ( 256 ) -#endif - -#ifndef MFLASH_FLEXSPI -#define MFLASH_FLEXSPI ( FLEXSPI ) -#endif - -#ifndef MFLASH_BASE_ADDRESS -#define MFLASH_BASE_ADDRESS ( FlexSPI_AMBA_BASE ) -#endif - -/* Allow incremental writes without erase (enabled by default). - * This method cannot be used in certain cases, e.g. when page checksums are used - */ -#ifndef MFLASH_INC_WRITE -#define MFLASH_INC_WRITE 1 -#endif - - -int32_t mflash_drv_write( uint32_t addr, - const uint8_t * data, - uint32_t data_len ); - -#endif /* ifndef __MFLASH_DRV_H__ */ diff --git a/examples/evkbmimxrt1060/test/board/pin_mux.c b/examples/evkbmimxrt1060/test/board/pin_mux.c deleted file mode 100644 index 36e9bab..0000000 --- a/examples/evkbmimxrt1060/test/board/pin_mux.c +++ /dev/null @@ -1,360 +0,0 @@ -/* Copyright 2018-2020 NXP - * - * This software is owned or controlled by NXP and may only be used - * strictly in accordance with the applicable license terms. By expressly - * accepting such terms or by downloading, installing, activating and/or - * otherwise using the software, you are agreeing that you have read, and - * that you agree to comply with and are bound by, such license terms. If - * you do not agree to be bound by the applicable license terms, then you - * may not retain, install, activate or otherwise use the software. - */ - -/*********************************************************************************************************************** - * This file was generated by the MCUXpresso Config Tools. Any manual edits made to this file - * will be overwritten if the respective MCUXpresso Config Tools is used to update this file. - **********************************************************************************************************************/ - -/* - * TEXT BELOW IS USED AS SETTING FOR TOOLS ************************************* - * !!GlobalInfo - * product: Pins v4.1 - * processor: MIMXRT1062xxxxA - * package_id: MIMXRT1062DVL6A - * mcu_data: ksdk2_0 - * processor_version: 0.0.11 - * BE CAREFUL MODIFYING THIS COMMENT - IT IS YAML SETTINGS FOR TOOLS *********** - */ - -#include "fsl_common.h" -#include "fsl_iomuxc.h" -#include "pin_mux.h" - - - -/* FUNCTION ************************************************************************************************************ - * - * Function Name : BOARD_InitBootPins - * Description : Calls initialization functions. - * - * END ****************************************************************************************************************/ -void BOARD_InitBootPins( void ) -{ - EnetPins(); - I2CPins(); - spiPins(); -} - -/* - * TEXT BELOW IS USED AS SETTING FOR TOOLS ************************************* - * I2CPins: - * - options: {callFromInitBoot: 'true', coreID: core0, enableClock: 'true'} - * - pin_list: - * - {pin_num: J11, peripheral: LPI2C1, signal: SCL, pin_signal: GPIO_AD_B1_00, slew_rate: Fast, software_input_on: Enable, open_drain: Enable, drive_strength: R0_7, - * pull_up_down_config: Pull_Up_22K_Ohm} - * - {pin_num: K11, peripheral: LPI2C1, signal: SDA, pin_signal: GPIO_AD_B1_01, slew_rate: Fast, software_input_on: Enable, open_drain: Enable, drive_strength: R0_7, - * pull_keeper_select: Keeper, pull_up_down_config: Pull_Up_22K_Ohm} - * BE CAREFUL MODIFYING THIS COMMENT - IT IS YAML SETTINGS FOR TOOLS *********** - */ - -/* FUNCTION ************************************************************************************************************ - * - * Function Name : I2CPins - * Description : Configures pin routing and optionally pin electrical features for I2C - * - * END ****************************************************************************************************************/ -void I2CPins( void ) -{ - CLOCK_EnableClock( kCLOCK_Iomuxc ); /* iomuxc clock (iomuxc_clk_enable): 0x03u */ - - IOMUXC_SetPinMux( - IOMUXC_GPIO_AD_B1_00_LPI2C1_SCL, /* GPIO_AD_B1_00 is configured as LPI2C1_SCL */ - 1U ); /* Software Input On Field: Force input path of pad GPIO_AD_B1_00 */ - IOMUXC_SetPinMux( - IOMUXC_GPIO_AD_B1_01_LPI2C1_SDA, /* GPIO_AD_B1_01 is configured as LPI2C1_SDA */ - 1U ); /* Software Input On Field: Force input path of pad GPIO_AD_B1_01 */ - IOMUXC_SetPinConfig( - IOMUXC_GPIO_AD_B1_00_LPI2C1_SCL, /* GPIO_AD_B1_00 PAD functional properties : */ - 0xD8B0u ); /* Slew Rate Field: Fast Slew Rate - * Drive Strength Field: R0/7 - * Speed Field: medium(100MHz) - * Open Drain Enable Field: Open Drain Enabled - * Pull / Keep Enable Field: Pull/Keeper Enabled - * Pull / Keep Select Field: Keeper - * Pull Up / Down Config. Field: 22K Ohm Pull Up - * Hyst. Enable Field: Hysteresis Disabled */ - IOMUXC_SetPinConfig( - IOMUXC_GPIO_AD_B1_01_LPI2C1_SDA, /* GPIO_AD_B1_01 PAD functional properties : */ - 0xD8B0u ); /* Slew Rate Field: Fast Slew Rate - * Drive Strength Field: R0/7 - * Speed Field: medium(100MHz) - * Open Drain Enable Field: Open Drain Enabled - * Pull / Keep Enable Field: Pull/Keeper Enabled - * Pull / Keep Select Field: Keeper - * Pull Up / Down Config. Field: 22K Ohm Pull Up - * Hyst. Enable Field: Hysteresis Disabled */ -} - - -void EnetPins( void ) -{ - CLOCK_EnableClock( kCLOCK_Iomuxc ); /* iomuxc clock (iomuxc_clk_enable): 0x03u */ - - IOMUXC_SetPinMux( - IOMUXC_GPIO_AD_B0_12_LPUART1_TX, /* GPIO_AD_B0_12 is configured as LPUART1_TX */ - 0U ); /* Software Input On Field: Input Path is determined by functionality */ - IOMUXC_SetPinMux( - IOMUXC_GPIO_AD_B0_13_LPUART1_RX, /* GPIO_AD_B0_13 is configured as LPUART1_RX */ - 0U ); /* Software Input On Field: Input Path is determined by functionality */ - IOMUXC_SetPinMux( - IOMUXC_GPIO_B1_04_ENET_RX_DATA00, /* GPIO_B1_04 is configured as ENET_RX_DATA00 */ - 0U ); /* Software Input On Field: Input Path is determined by functionality */ - IOMUXC_SetPinMux( - IOMUXC_GPIO_B1_05_ENET_RX_DATA01, /* GPIO_B1_05 is configured as ENET_RX_DATA01 */ - 0U ); /* Software Input On Field: Input Path is determined by functionality */ - IOMUXC_SetPinMux( - IOMUXC_GPIO_B1_06_ENET_RX_EN, /* GPIO_B1_06 is configured as ENET_RX_EN */ - 0U ); /* Software Input On Field: Input Path is determined by functionality */ - IOMUXC_SetPinMux( - IOMUXC_GPIO_B1_07_ENET_TX_DATA00, /* GPIO_B1_07 is configured as ENET_TX_DATA00 */ - 0U ); /* Software Input On Field: Input Path is determined by functionality */ - IOMUXC_SetPinMux( - IOMUXC_GPIO_B1_08_ENET_TX_DATA01, /* GPIO_B1_08 is configured as ENET_TX_DATA01 */ - 0U ); /* Software Input On Field: Input Path is determined by functionality */ - IOMUXC_SetPinMux( - IOMUXC_GPIO_B1_09_ENET_TX_EN, /* GPIO_B1_09 is configured as ENET_TX_EN */ - 0U ); /* Software Input On Field: Input Path is determined by functionality */ - IOMUXC_SetPinMux( - IOMUXC_GPIO_B1_10_ENET_REF_CLK, /* GPIO_B1_10 is configured as ENET_REF_CLK */ - 1U ); /* Software Input On Field: Force input path of pad GPIO_B1_10 */ - IOMUXC_SetPinMux( - IOMUXC_GPIO_B1_11_ENET_RX_ER, /* GPIO_B1_11 is configured as ENET_RX_ER */ - 0U ); /* Software Input On Field: Input Path is determined by functionality */ - IOMUXC_SetPinMux( - IOMUXC_GPIO_EMC_40_ENET_MDC, /* GPIO_EMC_40 is configured as ENET_MDC */ - 0U ); /* Software Input On Field: Input Path is determined by functionality */ - IOMUXC_SetPinMux( - IOMUXC_GPIO_EMC_41_ENET_MDIO, /* GPIO_EMC_41 is configured as ENET_MDIO */ - 0U ); /* Software Input On Field: Input Path is determined by functionality */ - - IOMUXC_SetPinConfig( - IOMUXC_GPIO_AD_B0_12_LPUART1_TX, /* GPIO_AD_B0_12 PAD functional properties : */ - 0x10B0u ); /* Slew Rate Field: Slow Slew Rate - * Drive Strength Field: R0/6 - * Speed Field: medium(100MHz) - * Open Drain Enable Field: Open Drain Disabled - * Pull / Keep Enable Field: Pull/Keeper Enabled - * Pull / Keep Select Field: Keeper - * Pull Up / Down Config. Field: 100K Ohm Pull Down - * Hyst. Enable Field: Hysteresis Disabled */ - IOMUXC_SetPinConfig( - IOMUXC_GPIO_AD_B0_13_LPUART1_RX, /* GPIO_AD_B0_13 PAD functional properties : */ - 0x10B0u ); /* Slew Rate Field: Slow Slew Rate - * Drive Strength Field: R0/6 - * Speed Field: medium(100MHz) - * Open Drain Enable Field: Open Drain Disabled - * Pull / Keep Enable Field: Pull/Keeper Enabled - * Pull / Keep Select Field: Keeper - * Pull Up / Down Config. Field: 100K Ohm Pull Down - * Hyst. Enable Field: Hysteresis Disabled */ - IOMUXC_SetPinConfig( - IOMUXC_GPIO_B1_04_ENET_RX_DATA00, /* GPIO_B1_04 PAD functional properties : */ - 0xB0E9u ); /* Slew Rate Field: Fast Slew Rate - * Drive Strength Field: R0/5 - * Speed Field: max(200MHz) - * Open Drain Enable Field: Open Drain Disabled - * Pull / Keep Enable Field: Pull/Keeper Enabled - * Pull / Keep Select Field: Pull - * Pull Up / Down Config. Field: 100K Ohm Pull Up - * Hyst. Enable Field: Hysteresis Disabled */ - IOMUXC_SetPinConfig( - IOMUXC_GPIO_B1_05_ENET_RX_DATA01, /* GPIO_B1_05 PAD functional properties : */ - 0xB0E9u ); /* Slew Rate Field: Fast Slew Rate - * Drive Strength Field: R0/5 - * Speed Field: max(200MHz) - * Open Drain Enable Field: Open Drain Disabled - * Pull / Keep Enable Field: Pull/Keeper Enabled - * Pull / Keep Select Field: Pull - * Pull Up / Down Config. Field: 100K Ohm Pull Up - * Hyst. Enable Field: Hysteresis Disabled */ - IOMUXC_SetPinConfig( - IOMUXC_GPIO_B1_06_ENET_RX_EN, /* GPIO_B1_06 PAD functional properties : */ - 0xB0E9u ); /* Slew Rate Field: Fast Slew Rate - * Drive Strength Field: R0/5 - * Speed Field: max(200MHz) - * Open Drain Enable Field: Open Drain Disabled - * Pull / Keep Enable Field: Pull/Keeper Enabled - * Pull / Keep Select Field: Pull - * Pull Up / Down Config. Field: 100K Ohm Pull Up - * Hyst. Enable Field: Hysteresis Disabled */ - IOMUXC_SetPinConfig( - IOMUXC_GPIO_B1_07_ENET_TX_DATA00, /* GPIO_B1_07 PAD functional properties : */ - 0xB0E9u ); /* Slew Rate Field: Fast Slew Rate - * Drive Strength Field: R0/5 - * Speed Field: max(200MHz) - * Open Drain Enable Field: Open Drain Disabled - * Pull / Keep Enable Field: Pull/Keeper Enabled - * Pull / Keep Select Field: Pull - * Pull Up / Down Config. Field: 100K Ohm Pull Up - * Hyst. Enable Field: Hysteresis Disabled */ - IOMUXC_SetPinConfig( - IOMUXC_GPIO_B1_08_ENET_TX_DATA01, /* GPIO_B1_08 PAD functional properties : */ - 0xB0E9u ); /* Slew Rate Field: Fast Slew Rate - * Drive Strength Field: R0/5 - * Speed Field: max(200MHz) - * Open Drain Enable Field: Open Drain Disabled - * Pull / Keep Enable Field: Pull/Keeper Enabled - * Pull / Keep Select Field: Pull - * Pull Up / Down Config. Field: 100K Ohm Pull Up - * Hyst. Enable Field: Hysteresis Disabled */ - IOMUXC_SetPinConfig( - IOMUXC_GPIO_B1_09_ENET_TX_EN, /* GPIO_B1_09 PAD functional properties : */ - 0xB0E9u ); /* Slew Rate Field: Fast Slew Rate - * Drive Strength Field: R0/5 - * Speed Field: max(200MHz) - * Open Drain Enable Field: Open Drain Disabled - * Pull / Keep Enable Field: Pull/Keeper Enabled - * Pull / Keep Select Field: Pull - * Pull Up / Down Config. Field: 100K Ohm Pull Up - * Hyst. Enable Field: Hysteresis Disabled */ - IOMUXC_SetPinConfig( - IOMUXC_GPIO_B1_10_ENET_REF_CLK, /* GPIO_B1_10 PAD functional properties : */ - 0x31u ); /* Slew Rate Field: Fast Slew Rate - * Drive Strength Field: R0/6 - * Speed Field: low(50MHz) - * Open Drain Enable Field: Open Drain Disabled - * Pull / Keep Enable Field: Pull/Keeper Disabled - * Pull / Keep Select Field: Keeper - * Pull Up / Down Config. Field: 100K Ohm Pull Down - * Hyst. Enable Field: Hysteresis Disabled */ - IOMUXC_SetPinConfig( - IOMUXC_GPIO_B1_11_ENET_RX_ER, /* GPIO_B1_11 PAD functional properties : */ - 0xB0E9u ); /* Slew Rate Field: Fast Slew Rate - * Drive Strength Field: R0/5 - * Speed Field: max(200MHz) - * Open Drain Enable Field: Open Drain Disabled - * Pull / Keep Enable Field: Pull/Keeper Enabled - * Pull / Keep Select Field: Pull - * Pull Up / Down Config. Field: 100K Ohm Pull Up - * Hyst. Enable Field: Hysteresis Disabled */ - IOMUXC_SetPinConfig( - IOMUXC_GPIO_EMC_40_ENET_MDC, /* GPIO_EMC_40 PAD functional properties : */ - 0xB0E9u ); /* Slew Rate Field: Fast Slew Rate - * Drive Strength Field: R0/5 - * Speed Field: max(200MHz) - * Open Drain Enable Field: Open Drain Disabled - * Pull / Keep Enable Field: Pull/Keeper Enabled - * Pull / Keep Select Field: Pull - * Pull Up / Down Config. Field: 100K Ohm Pull Up - * Hyst. Enable Field: Hysteresis Disabled */ - IOMUXC_SetPinConfig( - IOMUXC_GPIO_EMC_41_ENET_MDIO, /* GPIO_EMC_41 PAD functional properties : */ - 0xB829u ); /* Slew Rate Field: Fast Slew Rate - * Drive Strength Field: R0/5 - * Speed Field: low(50MHz) - * Open Drain Enable Field: Open Drain Enabled - * Pull / Keep Enable Field: Pull/Keeper Enabled - * Pull / Keep Select Field: Pull - * Pull Up / Down Config. Field: 100K Ohm Pull Up - * Hyst. Enable Field: Hysteresis Disabled */ -} - -void spiPins( void ) -{ - CLOCK_EnableClock( kCLOCK_Iomuxc ); /* iomuxc clock (iomuxc_clk_enable): 0x03u */ - IOMUXC_SetPinMux( - IOMUXC_GPIO_SD_B1_05_FLEXSPIA_DQS, /* GPIO_SD_B1_05 is configured as FLEXSPIA_DQS */ - 1U ); /* Software Input On Field: Force input path of pad GPIO_SD_B1_05 */ - IOMUXC_SetPinMux( - IOMUXC_GPIO_SD_B1_06_FLEXSPIA_SS0_B, /* GPIO_SD_B1_06 is configured as FLEXSPIA_SS0_B */ - 1U ); /* Software Input On Field: Force input path of pad GPIO_SD_B1_06 */ - IOMUXC_SetPinMux( - IOMUXC_GPIO_SD_B1_07_FLEXSPIA_SCLK, /* GPIO_SD_B1_07 is configured as FLEXSPIA_SCLK */ - 1U ); /* Software Input On Field: Force input path of pad GPIO_SD_B1_07 */ - IOMUXC_SetPinMux( - IOMUXC_GPIO_SD_B1_08_FLEXSPIA_DATA00, /* GPIO_SD_B1_08 is configured as FLEXSPIA_DATA00 */ - 1U ); /* Software Input On Field: Force input path of pad GPIO_SD_B1_08 */ - IOMUXC_SetPinMux( - IOMUXC_GPIO_SD_B1_09_FLEXSPIA_DATA01, /* GPIO_SD_B1_09 is configured as FLEXSPIA_DATA01 */ - 1U ); /* Software Input On Field: Force input path of pad GPIO_SD_B1_09 */ - IOMUXC_SetPinMux( - IOMUXC_GPIO_SD_B1_10_FLEXSPIA_DATA02, /* GPIO_SD_B1_10 is configured as FLEXSPIA_DATA02 */ - 1U ); /* Software Input On Field: Force input path of pad GPIO_SD_B1_10 */ - IOMUXC_SetPinMux( - IOMUXC_GPIO_SD_B1_11_FLEXSPIA_DATA03, /* GPIO_SD_B1_11 is configured as FLEXSPIA_DATA03 */ - 1U ); /* Software Input On Field: Force input path of pad GPIO_SD_B1_11 */ - - IOMUXC_SetPinConfig( - IOMUXC_GPIO_SD_B1_05_FLEXSPIA_DQS, /* GPIO_SD_B1_05 PAD functional properties : */ - 0x10F1u ); /* Slew Rate Field: Fast Slew Rate - * Drive Strength Field: R0/6 - * Speed Field: max(200MHz) - * Open Drain Enable Field: Open Drain Disabled - * Pull / Keep Enable Field: Pull/Keeper Enabled - * Pull / Keep Select Field: Keeper - * Pull Up / Down Config. Field: 100K Ohm Pull Down - * Hyst. Enable Field: Hysteresis Disabled */ - IOMUXC_SetPinConfig( - IOMUXC_GPIO_SD_B1_06_FLEXSPIA_SS0_B, /* GPIO_SD_B1_06 PAD functional properties : */ - 0x10F1u ); /* Slew Rate Field: Fast Slew Rate - * Drive Strength Field: R0/6 - * Speed Field: max(200MHz) - * Open Drain Enable Field: Open Drain Disabled - * Pull / Keep Enable Field: Pull/Keeper Enabled - * Pull / Keep Select Field: Keeper - * Pull Up / Down Config. Field: 100K Ohm Pull Down - * Hyst. Enable Field: Hysteresis Disabled */ - IOMUXC_SetPinConfig( - IOMUXC_GPIO_SD_B1_07_FLEXSPIA_SCLK, /* GPIO_SD_B1_07 PAD functional properties : */ - 0x10F1u ); /* Slew Rate Field: Fast Slew Rate - * Drive Strength Field: R0/6 - * Speed Field: max(200MHz) - * Open Drain Enable Field: Open Drain Disabled - * Pull / Keep Enable Field: Pull/Keeper Enabled - * Pull / Keep Select Field: Keeper - * Pull Up / Down Config. Field: 100K Ohm Pull Down - * Hyst. Enable Field: Hysteresis Disabled */ - IOMUXC_SetPinConfig( - IOMUXC_GPIO_SD_B1_08_FLEXSPIA_DATA00, /* GPIO_SD_B1_08 PAD functional properties : */ - 0x10F1u ); /* Slew Rate Field: Fast Slew Rate - * Drive Strength Field: R0/6 - * Speed Field: max(200MHz) - * Open Drain Enable Field: Open Drain Disabled - * Pull / Keep Enable Field: Pull/Keeper Enabled - * Pull / Keep Select Field: Keeper - * Pull Up / Down Config. Field: 100K Ohm Pull Down - * Hyst. Enable Field: Hysteresis Disabled */ - IOMUXC_SetPinConfig( - IOMUXC_GPIO_SD_B1_09_FLEXSPIA_DATA01, /* GPIO_SD_B1_09 PAD functional properties : */ - 0x10F1u ); /* Slew Rate Field: Fast Slew Rate - * Drive Strength Field: R0/6 - * Speed Field: max(200MHz) - * Open Drain Enable Field: Open Drain Disabled - * Pull / Keep Enable Field: Pull/Keeper Enabled - * Pull / Keep Select Field: Keeper - * Pull Up / Down Config. Field: 100K Ohm Pull Down - * Hyst. Enable Field: Hysteresis Disabled */ - IOMUXC_SetPinConfig( - IOMUXC_GPIO_SD_B1_10_FLEXSPIA_DATA02, /* GPIO_SD_B1_10 PAD functional properties : */ - 0x10F1u ); /* Slew Rate Field: Fast Slew Rate - * Drive Strength Field: R0/6 - * Speed Field: max(200MHz) - * Open Drain Enable Field: Open Drain Disabled - * Pull / Keep Enable Field: Pull/Keeper Enabled - * Pull / Keep Select Field: Keeper - * Pull Up / Down Config. Field: 100K Ohm Pull Down - * Hyst. Enable Field: Hysteresis Disabled */ - IOMUXC_SetPinConfig( - IOMUXC_GPIO_SD_B1_11_FLEXSPIA_DATA03, /* GPIO_SD_B1_11 PAD functional properties : */ - 0x10F1u ); /* Slew Rate Field: Fast Slew Rate - * Drive Strength Field: R0/6 - * Speed Field: max(200MHz) - * Open Drain Enable Field: Open Drain Disabled - * Pull / Keep Enable Field: Pull/Keeper Enabled - * Pull / Keep Select Field: Keeper - * Pull Up / Down Config. Field: 100K Ohm Pull Down - * Hyst. Enable Field: Hysteresis Disabled */ -} - -/*********************************************************************************************************************** - * EOF - **********************************************************************************************************************/ diff --git a/examples/evkbmimxrt1060/test/board/pin_mux.h b/examples/evkbmimxrt1060/test/board/pin_mux.h deleted file mode 100644 index c3f0c5b..0000000 --- a/examples/evkbmimxrt1060/test/board/pin_mux.h +++ /dev/null @@ -1,75 +0,0 @@ -/* Copyright 2018-2019 NXP - * - * This software is owned or controlled by NXP and may only be used - * strictly in accordance with the applicable license terms. By expressly - * accepting such terms or by downloading, installing, activating and/or - * otherwise using the software, you are agreeing that you have read, and - * that you agree to comply with and are bound by, such license terms. If - * you do not agree to be bound by the applicable license terms, then you - * may not retain, install, activate or otherwise use the software. - */ - -/*********************************************************************************************************************** - * This file was generated by the MCUXpresso Config Tools. Any manual edits made to this file - * will be overwritten if the respective MCUXpresso Config Tools is used to update this file. - **********************************************************************************************************************/ - -#ifndef _PIN_MUX_H_ -#define _PIN_MUX_H_ - -/*********************************************************************************************************************** - * Definitions - **********************************************************************************************************************/ - -/*! @brief Direction type */ -typedef enum _pin_mux_direction -{ - kPIN_MUX_DirectionInput = 0U, /* Input direction */ - kPIN_MUX_DirectionOutput = 1U, /* Output direction */ - kPIN_MUX_DirectionInputOrOutput = 2U /* Input or output direction */ -} pin_mux_direction_t; - -/*! - * @addtogroup pin_mux - * @{ - */ - -/*********************************************************************************************************************** - * API - **********************************************************************************************************************/ - -/* *INDENT-OFF* */ -#if defined( __cplusplus ) -extern "C" { -#endif -/* *INDENT-ON* */ - -/*! - * @brief Calls initialization functions. - * - */ -void BOARD_InitBootPins( void ); - - -/*! - * @brief Configures pin routing and optionally pin electrical features for I2C - * - */ -void I2CPins( void ); -void EnetPins( void ); -void spiPins( void ); - -/* *INDENT-OFF* */ -#if defined( __cplusplus ) -} -#endif -/* *INDENT-ON* */ - -/*! - * @} - */ -#endif /* _PIN_MUX_H_ */ - -/*********************************************************************************************************************** - * EOF - **********************************************************************************************************************/ diff --git a/examples/evkbmimxrt1060/test/include/FreeRTOSConfig.h b/examples/evkbmimxrt1060/test/include/FreeRTOSConfig.h deleted file mode 100644 index 2629dd3..0000000 --- a/examples/evkbmimxrt1060/test/include/FreeRTOSConfig.h +++ /dev/null @@ -1,221 +0,0 @@ -/* - * FreeRTOS Kernel V10.4.3 - * Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - * https://www.FreeRTOS.org - * https://github.com/FreeRTOS - * - */ - - -#ifndef FREERTOS_CONFIG_H -#define FREERTOS_CONFIG_H - -/*----------------------------------------------------------- -* Application specific definitions. -* -* These definitions should be adjusted for your particular hardware and -* application requirements. -* -* THESE PARAMETERS ARE DESCRIBED WITHIN THE 'CONFIGURATION' SECTION OF THE -* FreeRTOS API DOCUMENTATION AVAILABLE ON THE FreeRTOS.org WEB SITE. -* -* See http://www.freertos.org/a00110.html. -*----------------------------------------------------------*/ - -/* Ensure stdint is only used by the compiler, and not the assembler. */ -#if defined( __ICCARM__ ) || defined( __ARMCC_VERSION ) || defined( __GNUC__ ) -extern uint32_t SystemCoreClock; -extern void print_string( const char * string ); -extern void vLoggingPrintf( const char * pcFormat, - ... ); -#endif - - -#define configSUPPORT_STATIC_ALLOCATION 1 - -#define configUSE_PREEMPTION 1 -#define configUSE_IDLE_HOOK 0 -#define configUSE_TICK_HOOK 0 -#define configUSE_TICKLESS_IDLE 0 -#define configUSE_DAEMON_TASK_STARTUP_HOOK 1 -#define configCPU_CLOCK_HZ ( SystemCoreClock ) -#define configTICK_RATE_HZ ( ( TickType_t ) 1000 ) -#define configMAX_PRIORITIES ( 9 ) -#define configMINIMAL_STACK_SIZE ( ( uint16_t ) 90 ) -#define configTOTAL_HEAP_SIZE ( ( size_t ) ( 160 * 1024 ) ) /* 160 Kbytes. */ -#define configMAX_TASK_NAME_LEN ( 16 ) -#define configUSE_TRACE_FACILITY 1 -#define configUSE_16_BIT_TICKS 0 -#define configIDLE_SHOULD_YIELD 1 -#define configUSE_MUTEXES 1 -#define configQUEUE_REGISTRY_SIZE 8 -#define configCHECK_FOR_STACK_OVERFLOW 2 -#define configUSE_RECURSIVE_MUTEXES 1 -#define configUSE_MALLOC_FAILED_HOOK 1 -#define configUSE_APPLICATION_TASK_TAG 0 -#define configUSE_COUNTING_SEMAPHORES 1 -#define configGENERATE_RUN_TIME_STATS 0 -#define configOVERRIDE_DEFAULT_TICK_CONFIGURATION 0 -#define configRECORD_STACK_HIGH_ADDRESS 1 - -/* Co-routine definitions. */ -#define configUSE_CO_ROUTINES 0 -#define configMAX_CO_ROUTINE_PRIORITIES ( 2 ) - -/* Software timer definitions. */ -#define configUSE_TIMERS 1 -#define configTIMER_TASK_PRIORITY ( configMAX_PRIORITIES - 3 ) -#define configTIMER_QUEUE_LENGTH 10 -#define configTIMER_TASK_STACK_DEPTH ( 4096 ) - -#define configCOMMAND_INT_MAX_OUTPUT_SIZE ( 512 ) - -/* Set the following definitions to 1 to include the API function, or zero - * to exclude the API function. */ -#define INCLUDE_vTaskPrioritySet 1 -#define INCLUDE_uxTaskPriorityGet 1 -#define INCLUDE_vTaskDelete 1 -#define INCLUDE_vTaskCleanUpResources 0 -#define INCLUDE_vTaskSuspend 1 -#define INCLUDE_vTaskDelayUntil 1 -#define INCLUDE_vTaskDelay 1 -#define INCLUDE_xTaskGetSchedulerState 1 -#define INCLUDE_xTimerPendFunctionCall 1 -#define INCLUDE_xSemaphoreGetMutexHolder 1 -#define INCLUDE_uxTaskGetStackHighWaterMark 1 - - -/* Normal assert() semantics without relying on the provision of an assert.h - * header file. */ -#define configASSERT( x ) \ - if( ( x ) == 0 ) { taskDISABLE_INTERRUPTS(); for( ; ; ) {; } \ - } - -/* Map the FreeRTOS printf() to the logging task printf. */ -extern void vLoggingPrintf( const char * pcFormat, - ... ); -#define configPRINTF( x ) vLoggingPrintf x - -/* Non-format version thread-safe print. */ -extern void vLoggingPrint( const char * pcMessage ); -#define configPRINT( X ) vLoggingPrint( X ) - -/* Map the logging task's printf to the board specific output function. */ -extern int DbgConsole_Printf( const char * fmt_s, - ... ); -#define configPRINT_STRING DbgConsole_Printf - -/* Sets the length of the buffers into which logging messages are written - so - * also defines the maximum length of each log message. */ -#define configLOGGING_MAX_MESSAGE_LENGTH 512 - -/* Set to 1 to prepend each log message with a message number, the task name, - * and a time stamp. */ -#define configLOGGING_INCLUDE_TIME_AND_TASK_NAME 1 - -/* Demo specific macros that allow the application writer to insert code to be - * executed immediately before the MCU's STOP low power mode is entered and exited - * respectively. These macros are in addition to the standard - * configPRE_SLEEP_PROCESSING() and configPOST_SLEEP_PROCESSING() macros, which are - * called pre and post the low power SLEEP mode being entered and exited. These - * macros can be used to turn turn off and on IO, clocks, the Flash etc. to obtain - * the lowest power possible while the tick is off. */ -#if defined( __ICCARM__ ) || defined( __CC_ARM ) || defined( __ARMCC_VERSION ) || defined( __GNUC__ ) -void vMainPreStopProcessing( void ); -void vMainPostStopProcessing( void ); -#endif /* defined(__ICCARM__) || defined(__CC_ARM) || defined(__ARMCC_VERSION) || defined(__GNUC__) */ - -#define configPRE_STOP_PROCESSING vMainPreStopProcessing -#define configPOST_STOP_PROCESSING vMainPostStopProcessing - - -/* IMPORTANT: This define MUST be commented when used with STM32Cube firmware, - * to prevent overwriting SysTick_Handler defined within STM32Cube HAL. */ -/* #define xPortSysTickHandler SysTick_Handler */ - -/********************************************* - * FreeRTOS specific demos - ********************************************/ - -/* The address of an echo server that will be used by the two demo echo client - * tasks. - * http://www.freertos.org/FreeRTOS-Plus/FreeRTOS_Plus_TCP/TCP_Echo_Clients.html - * http://www.freertos.org/FreeRTOS-Plus/FreeRTOS_Plus_TCP/UDP_Echo_Clients.html */ -#define configECHO_SERVER_ADDR0 192 -#define configECHO_SERVER_ADDR1 168 -#define configECHO_SERVER_ADDR2 2 -#define configECHO_SERVER_ADDR3 6 -#define configTCP_ECHO_CLIENT_PORT 7 - -/* Prevent the assembler seeing code it doesn't understand. */ -#ifdef __ICCARM__ -/* Logging task definitions. */ -extern void vMainUARTPrintString( char * pcString ); - -extern int iMainRand32( void ); - -/* Pseudo random number generator, just used by demos so does not have to be - * secure. Do not use the standard C library rand() function as it can cause - * unexpected behaviour, such as calls to malloc(). */ -#define configRAND32() iMainRand32() -#endif - - - -#if defined( __ICCARM__ ) || defined( __CC_ARM ) || defined( __GNUC__ ) -/* Clock manager provides in this variable system core clock frequency */ -#include -extern uint32_t SystemCoreClock; -#endif - -/* Interrupt nesting behaviour configuration. Cortex-M specific. */ -#ifdef __NVIC_PRIO_BITS -/* __BVIC_PRIO_BITS will be specified when CMSIS is being used. */ -#define configPRIO_BITS __NVIC_PRIO_BITS -#else -#define configPRIO_BITS 4 /* 15 priority levels */ -#endif - -/* The lowest interrupt priority that can be used in a call to a "set priority" - * function. */ -#define configLIBRARY_LOWEST_INTERRUPT_PRIORITY ( ( 1U << ( configPRIO_BITS ) ) - 1 ) - -/* The highest interrupt priority that can be used by any interrupt service - * routine that makes calls to interrupt safe FreeRTOS API functions. DO NOT CALL - * INTERRUPT SAFE FREERTOS API FUNCTIONS FROM ANY INTERRUPT THAT HAS A HIGHER - * PRIORITY THAN THIS! (higher priorities are lower numeric values. */ -#define configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY 2 - -/* Interrupt priorities used by the kernel port layer itself. These are generic -* to all Cortex-M ports, and do not rely on any particular library functions. */ -#define configKERNEL_INTERRUPT_PRIORITY ( configLIBRARY_LOWEST_INTERRUPT_PRIORITY << ( 8 - configPRIO_BITS ) ) - -/* !!!! configMAX_SYSCALL_INTERRUPT_PRIORITY must not be set to zero !!!! - * See http://www.FreeRTOS.org/RTOS-Cortex-M3-M4.html. */ -#define configMAX_SYSCALL_INTERRUPT_PRIORITY ( configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY << ( 8 - configPRIO_BITS ) ) - -/* Definitions that map the FreeRTOS port interrupt handlers to their CMSIS - * standard names. */ -#define vPortSVCHandler SVC_Handler -#define xPortPendSVHandler PendSV_Handler -#define xPortSysTickHandler SysTick_Handler - -#endif /* FREERTOS_CONFIG_H */ diff --git a/examples/evkbmimxrt1060/test/include/aws_mbedtls_config.h b/examples/evkbmimxrt1060/test/include/aws_mbedtls_config.h deleted file mode 100644 index 070179c..0000000 --- a/examples/evkbmimxrt1060/test/include/aws_mbedtls_config.h +++ /dev/null @@ -1,3245 +0,0 @@ -/* Copyright 2019 NXP - * SPDX-License-Identifier: Apache-2.0 - */ - -#ifndef AWS_MBEDTLS_CONFIG_H -#define AWS_MBEDTLS_CONFIG_H - -/* clang-format off */ - -#if defined( _MSC_VER ) && !defined( _CRT_SECURE_NO_DEPRECATE ) -#define _CRT_SECURE_NO_DEPRECATE 1 -#endif - -/**************************** KSDK ********************************************/ - -#if defined( SSS_USE_FTR_FILE ) -#include "fsl_sss_ftr.h" -#else -#include "fsl_sss_ftr_default.h" -#endif - -#include "fsl_device_registers.h" -#include "fsl_debug_console.h" - -/* Enable LTC use in library if there is LTC on chip. */ -#if defined( FSL_FEATURE_SOC_LTC_COUNT ) && ( FSL_FEATURE_SOC_LTC_COUNT > 0 ) -#include "fsl_ltc.h" - -#define LTC_INSTANCE LTC0 /* LTC base register.*/ - -#if FSL_FEATURE_LTC_HAS_SHA -#define MBEDTLS_FREESCALE_LTC_SHA1 /* Enable use of LTC SHA.*/ -#define MBEDTLS_FREESCALE_LTC_SHA256 /* Enable use of LTC SHA256.*/ -#endif -#if defined( FSL_FEATURE_LTC_HAS_DES ) && FSL_FEATURE_LTC_HAS_DES -#define MBEDTLS_FREESCALE_LTC_DES /* Enable use of LTC DES.*/ -#endif -#define MBEDTLS_FREESCALE_LTC_AES /* Enable use of LTC AES.*/ -#if defined( FSL_FEATURE_LTC_HAS_GCM ) && FSL_FEATURE_LTC_HAS_GCM -#define MBEDTLS_FREESCALE_LTC_AES_GCM /* Enable use of LTC AES GCM.*/ -#endif -#if defined( FSL_FEATURE_LTC_HAS_PKHA ) && FSL_FEATURE_LTC_HAS_PKHA -#define MBEDTLS_FREESCALE_LTC_PKHA /* Enable use of LTC PKHA.*/ -#define FREESCALE_PKHA_INT_MAX_BYTES 256 -#endif -#endif /* if defined( FSL_FEATURE_SOC_LTC_COUNT ) && ( FSL_FEATURE_SOC_LTC_COUNT > 0 ) */ - -/* Enable MMCAU use in library if there is MMCAU on chip. */ -#if defined( FSL_FEATURE_SOC_MMCAU_COUNT ) && ( FSL_FEATURE_SOC_MMCAU_COUNT > 0 ) -#include "fsl_mmcau.h" - -#define MBEDTLS_FREESCALE_MMCAU_MD5 /* Enable use of MMCAU MD5.*/ -#define MBEDTLS_FREESCALE_MMCAU_SHA1 /* Enable use of MMCAU SHA1.*/ -#define MBEDTLS_FREESCALE_MMCAU_SHA256 /* Enable use of MMCAU SHA256.*/ -#define MBEDTLS_FREESCALE_MMCAU_DES /* Enable use of MMCAU DES, when LTC is disabled.*/ -#define MBEDTLS_FREESCALE_MMCAU_AES /* Enable use of MMCAU AES, when LTC is disabled.*/ -#endif - -/* Enable CAU3 use in library if there is CAU3 on chip. */ -#if defined( FSL_FEATURE_SOC_CAU3_COUNT ) && ( FSL_FEATURE_SOC_CAU3_COUNT > 0 ) -#include "fsl_cau3.h" - -#define MBEDTLS_CAU3_COMPLETION_SIGNAL kCAU3_TaskDonePoll - -#define MBEDTLS_FREESCALE_CAU3_AES /* Enable use of CAU3 AES.*/ -#define MBEDTLS_FREESCALE_CAU3_DES /* Enable use of CAU3 DES.*/ -#define MBEDTLS_FREESCALE_CAU3_SHA1 /* Enable use of CAU3 SHA1.*/ -#define MBEDTLS_FREESCALE_CAU3_SHA256 /* Enable use of CAU3 SHA256.*/ -#define MBEDTLS_FREESCALE_CAU3_PKHA /* Enable use of CAU3 PKHA.*/ -#define FREESCALE_PKHA_INT_MAX_BYTES 512 - -#define MBEDTLS_FREESCALE_CAU3_CIPHER_CMAC -#endif /* if defined( FSL_FEATURE_SOC_CAU3_COUNT ) && ( FSL_FEATURE_SOC_CAU3_COUNT > 0 ) */ - -/* Enable CAAM use in library if there is CAAM on chip. */ -#if defined( FSL_FEATURE_SOC_CAAM_COUNT ) && ( FSL_FEATURE_SOC_CAAM_COUNT > 0 ) && defined( CRYPTO_USE_DRIVER_CAAM ) -#include "fsl_caam.h" - -#define CAAM_INSTANCE CAAM - -#define MBEDTLS_FREESCALE_CAAM_AES /* Enable use of CAAM AES.*/ -#define MBEDTLS_FREESCALE_CAAM_AES_GCM /* Enable use of CAAM AES GCM.*/ - -#define MBEDTLS_FREESCALE_CAAM_DES /* Enable use of CAAM DES.*/ - -#define MBEDTLS_FREESCALE_CAAM_SHA1 /* Enable use of CAAM SHA1.*/ -#define MBEDTLS_FREESCALE_CAAM_SHA256 /* Enable use of CAAM SHA256.*/ - -#define MBEDTLS_FREESCALE_CAAM_PKHA /* Enable use of CAAM PKHA.*/ -#define FREESCALE_PKHA_INT_MAX_BYTES 512 -#endif /* if defined( FSL_FEATURE_SOC_CAAM_COUNT ) && ( FSL_FEATURE_SOC_CAAM_COUNT > 0 ) && defined( CRYPTO_USE_DRIVER_CAAM ) */ - -/* Enable DCP use in library if there is DCP on chip. */ -#if defined( FSL_FEATURE_SOC_DCP_COUNT ) && ( FSL_FEATURE_SOC_DCP_COUNT > 0 ) -#include "fsl_dcp.h" - -#define MBEDTLS_FREESCALE_DCP_AES /* Enable use of DCP AES.*/ -#define MBEDTLS_FREESCALE_DCP_SHA1 /* Enable use of DCP SHA1.*/ -#define MBEDTLS_FREESCALE_DCP_SHA256 /* Enable use of DCP SHA256.*/ - -#endif - -/* Enable HASHCRYPT use in library if there is HASHCRYPT on chip. */ -#if defined( FSL_FEATURE_SOC_HASH_COUNT ) && ( FSL_FEATURE_SOC_HASH_COUNT > 0 ) -#include "fsl_hashcrypt.h" - -#define MBEDTLS_FREESCALE_HASHCRYPT_AES /* Enable use of HASHCRYPT AES.*/ - -/* Hashcrypt without context switch is not able to calculate SHA in parallel with AES. - * HW acceleration of SHA is disabled by default in MbedTLS integration. - * HW acceleration of SHA is enabled on chip with context switch. - */ -#if defined( FSL_FEATURE_HASHCRYPT_HAS_RELOAD_FEATURE ) -#define MBEDTLS_FREESCALE_HASHCRYPT_SHA1 /* Enable use of HASHCRYPT SHA1.*/ -#define MBEDTLS_FREESCALE_HASHCRYPT_SHA256 /* Enable use of HASHCRYPT SHA256.*/ -#endif -#endif - -#if defined( MBEDTLS_FREESCALE_LTC_PKHA ) || defined( MBEDTLS_FREESCALE_CAU3_PKHA ) || defined( MBEDTLS_FREESCALE_CAAM_PKHA ) - -/* - * This FREESCALE_PKHA_LONG_OPERANDS_ENABLE macro can be defined. - * In such a case both software and hardware algorithm for TFM is linked in. - * The decision for which algorithm is used is determined at runtime - * from size of inputs. If inputs and result can fit into FREESCALE_PKHA_INT_MAX_BYTES - * then we call hardware algorithm, otherwise we call software algorithm. - * - * Note that mbedTLS algorithms break modular operations inefficiently into two steps. - * First is normal operation, for example non-modular multiply, which can produce number - * with greater size than operands. Second is modular reduction. - * The implication of this is that if for example FREESCALE_PKHA_INT_MAX_BYTES is 256 (2048 bits), - * RSA-2048 still requires the FREESCALE_PKHA_LONG_OPERANDS_ENABLE macro to be defined, - * otherwise it fails at runtime. - */ -/*#define FREESCALE_PKHA_LONG_OPERANDS_ENABLE */ -#endif - -/* Enable AES use in library if there is AES on chip. */ -#if defined( FSL_FEATURE_SOC_AES_COUNT ) && ( FSL_FEATURE_SOC_AES_COUNT > 0 ) -#include "fsl_aes.h" - -#define AES_INSTANCE AES0 /* AES base register.*/ -#define MBEDTLS_FREESCALE_LPC_AES /* Enable use of LPC AES.*/ -#define MBEDTLS_FREESCALE_LPC_AES_GCM /* Enable use of LPC AES GCM.*/ - -#endif - -/* Enable SHA use in library if there is SHA on chip. */ -#if defined( FSL_FEATURE_SOC_SHA_COUNT ) && ( FSL_FEATURE_SOC_SHA_COUNT > 0 ) -#include "fsl_sha.h" - -/* SHA HW accelerator does not support to compute multiple interleaved hashes, - * it doesn't support context switch. - * HW acceleration of SHA is disabled by default in MbedTLS integration. - */ -/*#define SHA_INSTANCE SHA0 / * SHA base register.* / */ -/*#define MBEDTLS_FREESCALE_LPC_SHA1 / * Enable use of LPC SHA.* / */ -/*#define MBEDTLS_FREESCALE_LPC_SHA256 / * Enable use of LPC SHA256.* / */ -/*#define MANUAL_LOAD_SHA_INPUT 1 / * 0 - use MEMADDR, MEMCRL (pseudo-DMA), 1 - manual load * / */ -#endif - -/* Enable CASPER use in library if there is CASPER on chip. */ -#if defined( FSL_FEATURE_SOC_CASPER_COUNT ) && ( FSL_FEATURE_SOC_CASPER_COUNT > 0 ) -#include "fsl_casper.h" - -#define CASPER_INSTANCE CASPER /* CASPER base register.*/ -#define MBEDTLS_FREESCALE_CASPER_PKHA /* Enable use of CASPER PKHA.*/ -#define FREESCALE_PKHA_INT_MAX_BYTES ( 512 ) - -/* Note: While using CASPER for ECC, please enable appropriate ECC curve in fls_casper.h */ -/* (CASPER_ECC_P256 or CASPER_ECC_P384) and MbedTLS define */ -/* (MBEDTLS_ECP_DP_SECP256R1_ENABLED or MBEDTLS_ECP_DP_SECP384R1_ENABLED) */ -/*#define MBEDTLS_ECP_MUL_COMB_ALT / * Alternate implementation of ecp_mul_comb() * / */ -/*#define MBEDTLS_ECP_MULADD_ALT / * Alternate implementation of mbedtls_ecp_muladd() * / */ -/*#define MBEDTLS_MCUX_CASPER_ECC / * CASPER implementation * / */ - -#endif /* if defined( FSL_FEATURE_SOC_CASPER_COUNT ) && ( FSL_FEATURE_SOC_CASPER_COUNT > 0 ) */ - -/** - * \def MBEDTLS_FREESCALE_FREERTOS_CALLOC_ALT - * - * Enable implementation for FreeRTOS's pvPortCalloc() in ksdk_mbedtls.c module. - * You can comment this macro if you provide your own alternate implementation. - * - */ -#if USE_RTOS && defined( FSL_RTOS_FREE_RTOS ) -#define MBEDTLS_FREESCALE_FREERTOS_CALLOC_ALT -#endif - - -/* Define ALT functions. */ - -#if defined( MBEDTLS_FREESCALE_MMCAU_DES ) || defined( MBEDTLS_FREESCALE_LTC_DES ) || defined( MBEDTLS_FREESCALE_CAAM_DES ) || defined( MBEDTLS_FREESCALE_CAU3_DES ) -#define MBEDTLS_DES_ALT -#define MBEDTLS_DES3_SETKEY_ENC_ALT -#define MBEDTLS_DES3_SETKEY_DEC_ALT -#define MBEDTLS_DES3_CRYPT_ECB_ALT -#if defined( MBEDTLS_FREESCALE_LTC_DES ) || defined( MBEDTLS_FREESCALE_MMCAU_DES ) || defined( MBEDTLS_FREESCALE_CAAM_DES ) -#define MBEDTLS_DES_SETKEY_ENC_ALT -#define MBEDTLS_DES_SETKEY_DEC_ALT -#define MBEDTLS_DES_CRYPT_ECB_ALT -#endif -#endif -#if defined( MBEDTLS_FREESCALE_LTC_DES ) || defined( MBEDTLS_FREESCALE_CAAM_DES ) -#define MBEDTLS_DES_CRYPT_CBC_ALT -#define MBEDTLS_DES3_CRYPT_CBC_ALT -#endif -#if defined( MBEDTLS_FREESCALE_CAU3_AES ) || defined( MBEDTLS_FREESCALE_DCP_AES ) -#define MBEDTLS_AES_ALT -#define MBEDTLS_AES_SETKEY_ENC_ALT -#define MBEDTLS_AES_SETKEY_DEC_ALT -#define MBEDTLS_AES_ENCRYPT_ALT -#define MBEDTLS_AES_DECRYPT_ALT -#define MBEDTLS_AES_ALT_NO_192 -#endif -#if defined( MBEDTLS_FREESCALE_DCP_AES ) -#define MBEDTLS_AES_CRYPT_CBC_ALT -#define MBEDTLS_AES_ALT_NO_256 -#endif -#if defined( MBEDTLS_FREESCALE_LTC_AES ) || defined( MBEDTLS_FREESCALE_MMCAU_AES ) || \ - defined( MBEDTLS_FREESCALE_LPC_AES ) || defined( MBEDTLS_FREESCALE_CAAM_AES ) || \ - defined( MBEDTLS_FREESCALE_HASHCRYPT_AES ) -#define MBEDTLS_AES_ALT -#define MBEDTLS_AES_SETKEY_ENC_ALT -#define MBEDTLS_AES_SETKEY_DEC_ALT -#define MBEDTLS_AES_ENCRYPT_ALT -#define MBEDTLS_AES_DECRYPT_ALT -#endif -#if defined( MBEDTLS_FREESCALE_LTC_AES ) || defined( MBEDTLS_FREESCALE_CAAM_AES ) -#define MBEDTLS_AES_CRYPT_CBC_ALT -#define MBEDTLS_AES_CRYPT_CTR_ALT -#define MBEDTLS_CCM_CRYPT_ALT -#endif -#if defined( MBEDTLS_FREESCALE_HASHCRYPT_AES ) -#define MBEDTLS_AES_CRYPT_CBC_ALT -#define MBEDTLS_AES_CRYPT_CTR_ALT -#endif -#if defined( MBEDTLS_FREESCALE_LTC_AES_GCM ) || defined( MBEDTLS_FREESCALE_LPC_AES_GCM ) || \ - defined( MBEDTLS_FREESCALE_CAAM_AES_GCM ) -#define MBEDTLS_GCM_CRYPT_ALT -#endif -#if defined( MBEDTLS_FREESCALE_LTC_PKHA ) || defined( MBEDTLS_FREESCALE_CAU3_PKHA ) || defined( MBEDTLS_FREESCALE_CAAM_PKHA ) -#define MBEDTLS_MPI_ADD_ABS_ALT -#define MBEDTLS_MPI_SUB_ABS_ALT -#define MBEDTLS_MPI_MUL_MPI_ALT -#define MBEDTLS_MPI_MOD_MPI_ALT -#define MBEDTLS_MPI_EXP_MOD_ALT -#define MBEDTLS_MPI_GCD_ALT -#define MBEDTLS_MPI_INV_MOD_ALT -#define MBEDTLS_MPI_IS_PRIME_ALT -#define MBEDTLS_ECP_MUL_COMB_ALT -#define MBEDTLS_ECP_ADD_ALT -#endif /* if defined( MBEDTLS_FREESCALE_LTC_PKHA ) || defined( MBEDTLS_FREESCALE_CAU3_PKHA ) || defined( MBEDTLS_FREESCALE_CAAM_PKHA ) */ -#if defined( MBEDTLS_FREESCALE_CAU3_PKHA ) -#define MBEDTLS_ECP_MUL_MXZ_ALT -#endif -#if defined( MBEDTLS_FREESCALE_CASPER_PKHA ) -#define MBEDTLS_RSA_PUBLIC_ALT -#endif -#if defined( MBEDTLS_FREESCALE_LTC_SHA1 ) || defined( MBEDTLS_FREESCALE_LPC_SHA1 ) || \ - defined( MBEDTLS_FREESCALE_CAAM_SHA1 ) || defined( MBEDTLS_FREESCALE_CAU3_SHA1 ) || defined( MBEDTLS_FREESCALE_DCP_SHA1 ) || \ - defined( MBEDTLS_FREESCALE_HASHCRYPT_SHA1 ) -#define MBEDTLS_SHA1_ALT -#endif -#if defined( MBEDTLS_FREESCALE_LTC_SHA256 ) || defined( MBEDTLS_FREESCALE_LPC_SHA256 ) || \ - defined( MBEDTLS_FREESCALE_CAAM_SHA256 ) || defined( MBEDTLS_FREESCALE_CAU3_SHA256 ) || defined( MBEDTLS_FREESCALE_DCP_SHA256 ) || \ - defined( MBEDTLS_FREESCALE_HASHCRYPT_SHA256 ) -#define MBEDTLS_SHA256_ALT - -/* - * LPC SHA module does not support SHA-224. - * - * Since mbed TLS does not provide separate APIs for SHA-224 and SHA-256 - * and SHA-224 is not widely used, this implementation provides HW accelerated SHA-256 only - * and SHA-224 is not available at all (calls will fail). - * - * To use SHA-224 on LPC, do not define MBEDTLS_SHA256_ALT and both SHA-224 and SHA-256 will use - * original mbed TLS software implementation. - */ -#if defined( MBEDTLS_FREESCALE_LPC_SHA256 ) || defined( MBEDTLS_FREESCALE_DCP_SHA256 ) || defined( MBEDTLS_FREESCALE_HASHCRYPT_SHA256 ) -#define MBEDTLS_SHA256_ALT_NO_224 -#endif -#endif -#if defined( MBEDTLS_FREESCALE_MMCAU_MD5 ) -#define MBEDTLS_MD5_PROCESS_ALT -#endif -#if defined( MBEDTLS_FREESCALE_MMCAU_SHA1 ) -#define MBEDTLS_SHA1_PROCESS_ALT -#endif -#if defined( MBEDTLS_FREESCALE_MMCAU_SHA256 ) -#define MBEDTLS_SHA256_PROCESS_ALT -#endif -#if defined( MBEDTLS_FREESCALE_CAU3_SHA1 ) -#define MBEDTLS_SHA1_PROCESS_ALT -#endif -#if defined( MBEDTLS_FREESCALE_CAU3_SHA256 ) -#define MBEDTLS_SHA256_ALT_NO_224 -#define MBEDTLS_SHA256_PROCESS_ALT -#endif -#if defined( MBEDTLS_FREESCALE_CAU3_CIPHER_CMAC ) -#define MBEDTLS_CIPHER_CMAC_ALT - -/* this macros can be used to enable or disable AES-CMAC-256 and/or TDES-CMAC with CMAC_ALT hw acceleration */ -#define MBEDTLS_CIPHER_CMAC_AES_256_ENABLED -#define MBEDTLS_CIPHER_CMAC_TDES_ENABLED -#endif -#if defined( MBEDTLS_FREESCALE_LTC_AES ) -#if !defined( FSL_FEATURE_LTC_HAS_AES192 ) || !FSL_FEATURE_LTC_HAS_AES192 -#define MBEDTLS_AES_ALT_NO_192 -#endif -#if !defined( FSL_FEATURE_LTC_HAS_AES256 ) || !FSL_FEATURE_LTC_HAS_AES256 -#define MBEDTLS_AES_ALT_NO_256 -#endif -#endif -#if defined( MBEDTLS_FREESCALE_LPC_AES ) -#define MBEDTLS_AES_CRYPT_CBC_ALT -#define MBEDTLS_AES_CRYPT_CFB_ALT -#define MBEDTLS_AES_CRYPT_CTR_ALT -#endif -#if defined( MBEDTLS_FREESCALE_LPC_SHA1 ) -#define MBEDTLS_SHA1_PROCESS_ALT -#endif -#if defined( MBEDTLS_FREESCALE_LPC_SHA256 ) -#define MBEDTLS_SHA256_PROCESS_ALT -#endif - -#include - -extern void * mbedtls_platform_calloc( size_t nmemb, - size_t size ); -extern void mbedtls_platform_free( void * ptr ); -#define MBEDTLS_PLATFORM_MEMORY -#define MBEDTLS_PLATFORM_STD_CALLOC mbedtls_platform_calloc -#define MBEDTLS_PLATFORM_STD_FREE mbedtls_platform_free - -/* Reduce RAM usage.*/ -#define MBEDTLS_ECP_FIXED_POINT_OPTIM 0 /* To reduce peak memory usage */ -#define MBEDTLS_AES_ROM_TABLES -#define MBEDTLS_SSL_MAX_CONTENT_LEN ( 1024 * 10 ) /* Reduce SSL frame buffer. */ -#define MBEDTLS_MPI_WINDOW_SIZE 1 -#define MBEDTLS_ECP_WINDOW_SIZE 2 -#define MBEDTLS_MPI_MAX_SIZE 512 /* Maximum number of bytes for usable MPIs. */ -#define MBEDTLS_ECP_MAX_BITS 521 /* Maximum bit size of groups */ - -/**************************** KSDK end ****************************************/ - -/** - * \name SECTION: System support - * - * This section sets system specific settings. - * \{ - */ - -/** - * \def MBEDTLS_HAVE_ASM - * - * The compiler has support for asm(). - * - * Requires support for asm() in compiler. - * - * Used in: - * library/timing.c - * library/padlock.c - * include/mbedtls/bn_mul.h - * - * Comment to disable the use of assembly code. - */ -#define MBEDTLS_HAVE_ASM - -/** - * \def MBEDTLS_NO_UDBL_DIVISION - * - * The platform lacks support for double-width integer division (64-bit - * division on a 32-bit platform, 128-bit division on a 64-bit platform). - * - * Used in: - * include/mbedtls/bignum.h - * library/bignum.c - * - * The bignum code uses double-width division to speed up some operations. - * Double-width division is often implemented in software that needs to - * be linked with the program. The presence of a double-width integer - * type is usually detected automatically through preprocessor macros, - * but the automatic detection cannot know whether the code needs to - * and can be linked with an implementation of division for that type. - * By default division is assumed to be usable if the type is present. - * Uncomment this option to prevent the use of double-width division. - * - * Note that division for the native integer type is always required. - * Furthermore, a 64-bit type is always required even on a 32-bit - * platform, but it need not support multiplication or division. In some - * cases it is also desirable to disable some double-width operations. For - * example, if double-width division is implemented in software, disabling - * it can reduce code size in some embedded targets. - */ -/*#define MBEDTLS_NO_UDBL_DIVISION */ - -/** - * \def MBEDTLS_HAVE_SSE2 - * - * CPU supports SSE2 instruction set. - * - * Uncomment if the CPU supports SSE2 (IA-32 specific). - */ -/*#define MBEDTLS_HAVE_SSE2 */ - -/** - * \def MBEDTLS_HAVE_TIME - * - * System has time.h and time(). - * The time does not need to be correct, only time differences are used, - * by contrast with MBEDTLS_HAVE_TIME_DATE - * - * Defining MBEDTLS_HAVE_TIME allows you to specify MBEDTLS_PLATFORM_TIME_ALT, - * MBEDTLS_PLATFORM_TIME_MACRO, MBEDTLS_PLATFORM_TIME_TYPE_MACRO and - * MBEDTLS_PLATFORM_STD_TIME. - * - * Comment if your system does not support time functions - */ -/*#define MBEDTLS_HAVE_TIME */ - -/** - * \def MBEDTLS_HAVE_TIME_DATE - * - * System has time.h and time(), gmtime() and the clock is correct. - * The time needs to be correct (not necesarily very accurate, but at least - * the date should be correct). This is used to verify the validity period of - * X.509 certificates. - * - * Comment if your system does not have a correct clock. - */ -/*#define MBEDTLS_HAVE_TIME_DATE */ - -/** - * \def MBEDTLS_PLATFORM_MEMORY - * - * Enable the memory allocation layer. - * - * By default mbed TLS uses the system-provided calloc() and free(). - * This allows different allocators (self-implemented or provided) to be - * provided to the platform abstraction layer. - * - * Enabling MBEDTLS_PLATFORM_MEMORY without the - * MBEDTLS_PLATFORM_{FREE,CALLOC}_MACROs will provide - * "mbedtls_platform_set_calloc_free()" allowing you to set an alternative calloc() and - * free() function pointer at runtime. - * - * Enabling MBEDTLS_PLATFORM_MEMORY and specifying - * MBEDTLS_PLATFORM_{CALLOC,FREE}_MACROs will allow you to specify the - * alternate function at compile time. - * - * Requires: MBEDTLS_PLATFORM_C - * - * Enable this layer to allow use of alternative memory allocators. - */ -/*#define MBEDTLS_PLATFORM_MEMORY */ - -/** - * \def MBEDTLS_PLATFORM_NO_STD_FUNCTIONS - * - * Do not assign standard functions in the platform layer (e.g. calloc() to - * MBEDTLS_PLATFORM_STD_CALLOC and printf() to MBEDTLS_PLATFORM_STD_PRINTF) - * - * This makes sure there are no linking errors on platforms that do not support - * these functions. You will HAVE to provide alternatives, either at runtime - * via the platform_set_xxx() functions or at compile time by setting - * the MBEDTLS_PLATFORM_STD_XXX defines, or enabling a - * MBEDTLS_PLATFORM_XXX_MACRO. - * - * Requires: MBEDTLS_PLATFORM_C - * - * Uncomment to prevent default assignment of standard functions in the - * platform layer. - */ -/*#define MBEDTLS_PLATFORM_NO_STD_FUNCTIONS */ - -/** - * \def MBEDTLS_PLATFORM_EXIT_ALT - * - * MBEDTLS_PLATFORM_XXX_ALT: Uncomment a macro to let mbed TLS support the - * function in the platform abstraction layer. - * - * Example: In case you uncomment MBEDTLS_PLATFORM_PRINTF_ALT, mbed TLS will - * provide a function "mbedtls_platform_set_printf()" that allows you to set an - * alternative printf function pointer. - * - * All these define require MBEDTLS_PLATFORM_C to be defined! - * - * \note MBEDTLS_PLATFORM_SNPRINTF_ALT is required on Windows; - * it will be enabled automatically by check_config.h - * - * \warning MBEDTLS_PLATFORM_XXX_ALT cannot be defined at the same time as - * MBEDTLS_PLATFORM_XXX_MACRO! - * - * Requires: MBEDTLS_PLATFORM_TIME_ALT requires MBEDTLS_HAVE_TIME - * - * Uncomment a macro to enable alternate implementation of specific base - * platform function - */ -/*#define MBEDTLS_PLATFORM_EXIT_ALT */ -/*#define MBEDTLS_PLATFORM_TIME_ALT */ -/*#define MBEDTLS_PLATFORM_FPRINTF_ALT */ -/*#define MBEDTLS_PLATFORM_PRINTF_ALT */ -/*#define MBEDTLS_PLATFORM_SNPRINTF_ALT */ -/*#define MBEDTLS_PLATFORM_NV_SEED_ALT */ -/*#define MBEDTLS_PLATFORM_SETUP_TEARDOWN_ALT */ - -/** - * \def MBEDTLS_DEPRECATED_WARNING - * - * Mark deprecated functions so that they generate a warning if used. - * Functions deprecated in one version will usually be removed in the next - * version. You can enable this to help you prepare the transition to a new - * major version by making sure your code is not using these functions. - * - * This only works with GCC and Clang. With other compilers, you may want to - * use MBEDTLS_DEPRECATED_REMOVED - * - * Uncomment to get warnings on using deprecated functions. - */ -/*#define MBEDTLS_DEPRECATED_WARNING */ - -/** - * \def MBEDTLS_DEPRECATED_REMOVED - * - * Remove deprecated functions so that they generate an error if used. - * Functions deprecated in one version will usually be removed in the next - * version. You can enable this to help you prepare the transition to a new - * major version by making sure your code is not using these functions. - * - * Uncomment to get errors on using deprecated functions. - */ -/*#define MBEDTLS_DEPRECATED_REMOVED */ - -/* \} name SECTION: System support */ - -/** - * \name SECTION: mbed TLS feature support - * - * This section sets support for features that are or are not needed - * within the modules that are enabled. - * \{ - */ - -/** - * \def MBEDTLS_TIMING_ALT - * - * Uncomment to provide your own alternate implementation for mbedtls_timing_hardclock(), - * mbedtls_timing_get_timer(), mbedtls_set_alarm(), mbedtls_set/get_delay() - * - * Only works if you have MBEDTLS_TIMING_C enabled. - * - * You will need to provide a header "timing_alt.h" and an implementation at - * compile time. - */ -/*#define MBEDTLS_TIMING_ALT */ - -/** - * \def MBEDTLS_AES_ALT - * - * MBEDTLS__MODULE_NAME__ALT: Uncomment a macro to let mbed TLS use your - * alternate core implementation of a symmetric crypto, an arithmetic or hash - * module (e.g. platform specific assembly optimized implementations). Keep - * in mind that the function prototypes should remain the same. - * - * This replaces the whole module. If you only want to replace one of the - * functions, use one of the MBEDTLS__FUNCTION_NAME__ALT flags. - * - * Example: In case you uncomment MBEDTLS_AES_ALT, mbed TLS will no longer - * provide the "struct mbedtls_aes_context" definition and omit the base - * function declarations and implementations. "aes_alt.h" will be included from - * "aes.h" to include the new function definitions. - * - * Uncomment a macro to enable alternate implementation of the corresponding - * module. - * - * \warning MD2, MD4, MD5, ARC4, DES and SHA-1 are considered weak and their - * use constitutes a security risk. If possible, we recommend - * avoiding dependencies on them, and considering stronger message - * digests and ciphers instead. - * - */ -/*#define MBEDTLS_AES_ALT */ -/*#define MBEDTLS_ARC4_ALT */ -/*#define MBEDTLS_BLOWFISH_ALT */ -/*#define MBEDTLS_CAMELLIA_ALT */ -/*#define MBEDTLS_CCM_ALT */ -/*#define MBEDTLS_CMAC_ALT */ -/*#define MBEDTLS_DES_ALT */ -/*#define MBEDTLS_DHM_ALT */ -/*#define MBEDTLS_ECJPAKE_ALT */ -/*#define MBEDTLS_GCM_ALT */ -/*#define MBEDTLS_MD2_ALT */ -/*#define MBEDTLS_MD4_ALT */ -/*#define MBEDTLS_MD5_ALT */ -/*#define MBEDTLS_RIPEMD160_ALT */ -/*#define MBEDTLS_RSA_ALT */ -/*#define MBEDTLS_SHA1_ALT */ -/*#define MBEDTLS_SHA256_ALT */ -/*#define MBEDTLS_SHA512_ALT */ -/*#define MBEDTLS_XTEA_ALT */ - -/* - * When replacing the elliptic curve module, pleace consider, that it is - * implemented with two .c files: - * - ecp.c - * - ecp_curves.c - * You can replace them very much like all the other MBEDTLS__MODULE_NAME__ALT - * macros as described above. The only difference is that you have to make sure - * that you provide functionality for both .c files. - */ - -#if SSS_HAVE_ALT -#if ( SSS_HAVE_ECC ) -#define MBEDTLS_ECP_ALT -#define MBEDTLS_ECDH_LEGACY_CONTEXT -#endif /* TGT_A71CH */ - -#if ( SSS_HAVE_RSA ) -#define MBEDTLS_RSA_ALT -#endif - -#endif /* SSS_HAVE_ALT */ - -/*#define MBEDTLS_ECDH_ALT */ - -/** - * \def MBEDTLS_MD2_PROCESS_ALT - * - * MBEDTLS__FUNCTION_NAME__ALT: Uncomment a macro to let mbed TLS use you - * alternate core implementation of symmetric crypto or hash function. Keep in - * mind that function prototypes should remain the same. - * - * This replaces only one function. The header file from mbed TLS is still - * used, in contrast to the MBEDTLS__MODULE_NAME__ALT flags. - * - * Example: In case you uncomment MBEDTLS_SHA256_PROCESS_ALT, mbed TLS will - * no longer provide the mbedtls_sha1_process() function, but it will still provide - * the other function (using your mbedtls_sha1_process() function) and the definition - * of mbedtls_sha1_context, so your implementation of mbedtls_sha1_process must be compatible - * with this definition. - * - * \note Because of a signature change, the core AES encryption and decryption routines are - * currently named mbedtls_aes_internal_encrypt and mbedtls_aes_internal_decrypt, - * respectively. When setting up alternative implementations, these functions should - * be overriden, but the wrapper functions mbedtls_aes_decrypt and mbedtls_aes_encrypt - * must stay untouched. - * - * \note If you use the AES_xxx_ALT macros, then is is recommended to also set - * MBEDTLS_AES_ROM_TABLES in order to help the linker garbage-collect the AES - * tables. - * - * Uncomment a macro to enable alternate implementation of the corresponding - * function. - * - * \warning MD2, MD4, MD5, DES and SHA-1 are considered weak and their use - * constitutes a security risk. If possible, we recommend avoiding - * dependencies on them, and considering stronger message digests - * and ciphers instead. - * - */ -/*#define MBEDTLS_MD2_PROCESS_ALT */ -/*#define MBEDTLS_MD4_PROCESS_ALT */ -/*#define MBEDTLS_MD5_PROCESS_ALT */ -/*#define MBEDTLS_RIPEMD160_PROCESS_ALT */ -/*#define MBEDTLS_SHA1_PROCESS_ALT */ -/*#define MBEDTLS_SHA256_PROCESS_ALT */ -/*#define MBEDTLS_SHA512_PROCESS_ALT */ -/*#define MBEDTLS_DES_SETKEY_ALT */ -/*#define MBEDTLS_DES_CRYPT_ECB_ALT */ -/*#define MBEDTLS_DES3_CRYPT_ECB_ALT */ -/*#define MBEDTLS_AES_SETKEY_ENC_ALT */ -/*#define MBEDTLS_AES_SETKEY_DEC_ALT */ -/*#define MBEDTLS_AES_ENCRYPT_ALT */ -/*#define MBEDTLS_AES_DECRYPT_ALT */ -/*#define MBEDTLS_ECDH_GEN_PUBLIC_ALT */ -/*#define MBEDTLS_ECDH_COMPUTE_SHARED_ALT */ -/*#define MBEDTLS_ECDSA_VERIFY_ALT */ -/*#define MBEDTLS_ECDSA_SIGN_ALT */ -/*#define MBEDTLS_ECDSA_GENKEY_ALT */ - -/** - * \def MBEDTLS_ECP_INTERNAL_ALT - * - * Expose a part of the internal interface of the Elliptic Curve Point module. - * - * MBEDTLS_ECP__FUNCTION_NAME__ALT: Uncomment a macro to let mbed TLS use your - * alternative core implementation of elliptic curve arithmetic. Keep in mind - * that function prototypes should remain the same. - * - * This partially replaces one function. The header file from mbed TLS is still - * used, in contrast to the MBEDTLS_ECP_ALT flag. The original implementation - * is still present and it is used for group structures not supported by the - * alternative. - * - * Any of these options become available by defining MBEDTLS_ECP_INTERNAL_ALT - * and implementing the following functions: - * unsigned char mbedtls_internal_ecp_grp_capable( - * const mbedtls_ecp_group *grp ) - * int mbedtls_internal_ecp_init( const mbedtls_ecp_group *grp ) - * void mbedtls_internal_ecp_deinit( const mbedtls_ecp_group *grp ) - * The mbedtls_internal_ecp_grp_capable function should return 1 if the - * replacement functions implement arithmetic for the given group and 0 - * otherwise. - * The functions mbedtls_internal_ecp_init and mbedtls_internal_ecp_deinit are - * called before and after each point operation and provide an opportunity to - * implement optimized set up and tear down instructions. - * - * Example: In case you uncomment MBEDTLS_ECP_INTERNAL_ALT and - * MBEDTLS_ECP_DOUBLE_JAC_ALT, mbed TLS will still provide the ecp_double_jac - * function, but will use your mbedtls_internal_ecp_double_jac if the group is - * supported (your mbedtls_internal_ecp_grp_capable function returns 1 when - * receives it as an argument). If the group is not supported then the original - * implementation is used. The other functions and the definition of - * mbedtls_ecp_group and mbedtls_ecp_point will not change, so your - * implementation of mbedtls_internal_ecp_double_jac and - * mbedtls_internal_ecp_grp_capable must be compatible with this definition. - * - * Uncomment a macro to enable alternate implementation of the corresponding - * function. - */ -/* Required for all the functions in this section */ -/*#define MBEDTLS_ECP_INTERNAL_ALT */ -/* Support for Weierstrass curves with Jacobi representation */ -/*#define MBEDTLS_ECP_RANDOMIZE_JAC_ALT */ -/*#define MBEDTLS_ECP_ADD_MIXED_ALT */ -/*#define MBEDTLS_ECP_DOUBLE_JAC_ALT */ -/*#define MBEDTLS_ECP_NORMALIZE_JAC_MANY_ALT */ -/*#define MBEDTLS_ECP_NORMALIZE_JAC_ALT */ -/* Support for curves with Montgomery arithmetic */ -/*#define MBEDTLS_ECP_DOUBLE_ADD_MXZ_ALT */ -/*#define MBEDTLS_ECP_RANDOMIZE_MXZ_ALT */ -/*#define MBEDTLS_ECP_NORMALIZE_MXZ_ALT */ - -/** - * \def MBEDTLS_TEST_NULL_ENTROPY - * - * Enables testing and use of mbed TLS without any configured entropy sources. - * This permits use of the library on platforms before an entropy source has - * been integrated (see for example the MBEDTLS_ENTROPY_HARDWARE_ALT or the - * MBEDTLS_ENTROPY_NV_SEED switches). - * - * WARNING! This switch MUST be disabled in production builds, and is suitable - * only for development. - * Enabling the switch negates any security provided by the library. - * - * Requires MBEDTLS_ENTROPY_C, MBEDTLS_NO_DEFAULT_ENTROPY_SOURCES - * - */ -/*#define MBEDTLS_TEST_NULL_ENTROPY */ - -/** - * \def MBEDTLS_ENTROPY_HARDWARE_ALT - * - * Uncomment this macro to let mbed TLS use your own implementation of a - * hardware entropy collector. - * - * Your function must be called \c mbedtls_hardware_poll(), have the same - * prototype as declared in entropy_poll.h, and accept NULL as first argument. - * - * Uncomment to use your own hardware entropy collector. - */ -#define MBEDTLS_ENTROPY_HARDWARE_ALT - -/** - * \def MBEDTLS_AES_ROM_TABLES - * - * Use precomputed AES tables stored in ROM. - * - * Uncomment this macro to use precomputed AES tables stored in ROM. - * Comment this macro to generate AES tables in RAM at runtime. - * - * Tradeoff: Using precomputed ROM tables reduces RAM usage by ~8kb - * (or ~2kb if \c MBEDTLS_AES_FEWER_TABLES is used) and reduces the - * initialization time before the first AES operation can be performed. - * It comes at the cost of additional ~8kb ROM use (resp. ~2kb if \c - * MBEDTLS_AES_FEWER_TABLES below is used), and potentially degraded - * performance if ROM access is slower than RAM access. - * - * This option is independent of \c MBEDTLS_AES_FEWER_TABLES. - * - */ -/*#define MBEDTLS_AES_ROM_TABLES */ - -/** - * \def MBEDTLS_AES_FEWER_TABLES - * - * Use less ROM/RAM for AES tables. - * - * Uncommenting this macro omits 75% of the AES tables from - * ROM / RAM (depending on the value of \c MBEDTLS_AES_ROM_TABLES) - * by computing their values on the fly during operations - * (the tables are entry-wise rotations of one another). - * - * Tradeoff: Uncommenting this reduces the RAM / ROM footprint - * by ~6kb but at the cost of more arithmetic operations during - * runtime. Specifically, one has to compare 4 accesses within - * different tables to 4 accesses with additional arithmetic - * operations within the same table. The performance gain/loss - * depends on the system and memory details. - * - * This option is independent of \c MBEDTLS_AES_ROM_TABLES. - * - */ -/*#define MBEDTLS_AES_FEWER_TABLES */ - -/** - * \def MBEDTLS_CAMELLIA_SMALL_MEMORY - * - * Use less ROM for the Camellia implementation (saves about 768 bytes). - * - * Uncomment this macro to use less memory for Camellia. - */ -/*#define MBEDTLS_CAMELLIA_SMALL_MEMORY */ - -/** - * \def MBEDTLS_CIPHER_MODE_CBC - * - * Enable Cipher Block Chaining mode (CBC) for symmetric ciphers. - */ -#define MBEDTLS_CIPHER_MODE_CBC - -/** - * \def MBEDTLS_CIPHER_MODE_CFB - * - * Enable Cipher Feedback mode (CFB) for symmetric ciphers. - */ -#define MBEDTLS_CIPHER_MODE_CFB - -/** - * \def MBEDTLS_CIPHER_MODE_CTR - * - * Enable Counter Block Cipher mode (CTR) for symmetric ciphers. - */ -#define MBEDTLS_CIPHER_MODE_CTR - -/** - * \def MBEDTLS_CIPHER_NULL_CIPHER - * - * Enable NULL cipher. - * Warning: Only do so when you know what you are doing. This allows for - * encryption or channels without any security! - * - * Requires MBEDTLS_ENABLE_WEAK_CIPHERSUITES as well to enable - * the following ciphersuites: - * MBEDTLS_TLS_ECDH_ECDSA_WITH_NULL_SHA - * MBEDTLS_TLS_ECDH_RSA_WITH_NULL_SHA - * MBEDTLS_TLS_ECDHE_ECDSA_WITH_NULL_SHA - * MBEDTLS_TLS_ECDHE_RSA_WITH_NULL_SHA - * MBEDTLS_TLS_ECDHE_PSK_WITH_NULL_SHA384 - * MBEDTLS_TLS_ECDHE_PSK_WITH_NULL_SHA256 - * MBEDTLS_TLS_ECDHE_PSK_WITH_NULL_SHA - * MBEDTLS_TLS_DHE_PSK_WITH_NULL_SHA384 - * MBEDTLS_TLS_DHE_PSK_WITH_NULL_SHA256 - * MBEDTLS_TLS_DHE_PSK_WITH_NULL_SHA - * MBEDTLS_TLS_RSA_WITH_NULL_SHA256 - * MBEDTLS_TLS_RSA_WITH_NULL_SHA - * MBEDTLS_TLS_RSA_WITH_NULL_MD5 - * MBEDTLS_TLS_RSA_PSK_WITH_NULL_SHA384 - * MBEDTLS_TLS_RSA_PSK_WITH_NULL_SHA256 - * MBEDTLS_TLS_RSA_PSK_WITH_NULL_SHA - * MBEDTLS_TLS_PSK_WITH_NULL_SHA384 - * MBEDTLS_TLS_PSK_WITH_NULL_SHA256 - * MBEDTLS_TLS_PSK_WITH_NULL_SHA - * - * Uncomment this macro to enable the NULL cipher and ciphersuites - */ -/*#define MBEDTLS_CIPHER_NULL_CIPHER */ - -/** - * \def MBEDTLS_CIPHER_PADDING_PKCS7 - * - * MBEDTLS_CIPHER_PADDING_XXX: Uncomment or comment macros to add support for - * specific padding modes in the cipher layer with cipher modes that support - * padding (e.g. CBC) - * - * If you disable all padding modes, only full blocks can be used with CBC. - * - * Enable padding modes in the cipher layer. - */ -#define MBEDTLS_CIPHER_PADDING_PKCS7 -#define MBEDTLS_CIPHER_PADDING_ONE_AND_ZEROS -#define MBEDTLS_CIPHER_PADDING_ZEROS_AND_LEN -#define MBEDTLS_CIPHER_PADDING_ZEROS - -/** - * \def MBEDTLS_ENABLE_WEAK_CIPHERSUITES - * - * Enable weak ciphersuites in SSL / TLS. - * Warning: Only do so when you know what you are doing. This allows for - * channels with virtually no security at all! - * - * This enables the following ciphersuites: - * MBEDTLS_TLS_RSA_WITH_DES_CBC_SHA - * MBEDTLS_TLS_DHE_RSA_WITH_DES_CBC_SHA - * - * Uncomment this macro to enable weak ciphersuites - * - * \warning DES is considered a weak cipher and its use constitutes a - * security risk. We recommend considering stronger ciphers instead. - */ -/*#define MBEDTLS_ENABLE_WEAK_CIPHERSUITES */ - -/** - * \def MBEDTLS_REMOVE_ARC4_CIPHERSUITES - * - * Remove RC4 ciphersuites by default in SSL / TLS. - * This flag removes the ciphersuites based on RC4 from the default list as - * returned by mbedtls_ssl_list_ciphersuites(). However, it is still possible to - * enable (some of) them with mbedtls_ssl_conf_ciphersuites() by including them - * explicitly. - * - * Uncomment this macro to remove RC4 ciphersuites by default. - */ -#define MBEDTLS_REMOVE_ARC4_CIPHERSUITES - -/** - * \def MBEDTLS_ECP_DP_SECP192R1_ENABLED - * - * MBEDTLS_ECP_XXXX_ENABLED: Enables specific curves within the Elliptic Curve - * module. By default all supported curves are enabled. - * - * Comment macros to disable the curve and functions for it - */ -#define MBEDTLS_ECP_DP_SECP192R1_ENABLED -#define MBEDTLS_ECP_DP_SECP224R1_ENABLED -#define MBEDTLS_ECP_DP_SECP256R1_ENABLED -#define MBEDTLS_ECP_DP_SECP384R1_ENABLED -#ifndef MBEDTLS_FREESCALE_LTC_PKHA /* PKHA supports only <=512 */ -#define MBEDTLS_ECP_DP_SECP521R1_ENABLED -#endif -#define MBEDTLS_ECP_DP_SECP192K1_ENABLED -#define MBEDTLS_ECP_DP_SECP224K1_ENABLED -#define MBEDTLS_ECP_DP_SECP256K1_ENABLED -#define MBEDTLS_ECP_DP_BP256R1_ENABLED -#define MBEDTLS_ECP_DP_BP384R1_ENABLED -#define MBEDTLS_ECP_DP_BP512R1_ENABLED -#define MBEDTLS_ECP_DP_CURVE25519_ENABLED -#define MBEDTLS_ECP_DP_CURVE448_ENABLED - -#ifdef TGT_A71CH -#undef MBEDTLS_ECP_DP_SECP192R1_ENABLED -#undef MBEDTLS_ECP_DP_SECP224R1_ENABLED -#undef MBEDTLS_ECP_DP_SECP384R1_ENABLED -#undef MBEDTLS_ECP_DP_SECP521R1_ENABLED -#undef MBEDTLS_ECP_DP_SECP192K1_ENABLED -#undef MBEDTLS_ECP_DP_SECP224K1_ENABLED -#undef MBEDTLS_ECP_DP_SECP256K1_ENABLED -#undef MBEDTLS_ECP_DP_BP256R1_ENABLED -#undef MBEDTLS_ECP_DP_BP384R1_ENABLED -#undef MBEDTLS_ECP_DP_BP512R1_ENABLED -#undef MBEDTLS_ECP_DP_CURVE25519_ENABLED -#undef MBEDTLS_ECP_DP_CURVE448_ENABLED -#endif /* ifdef TGT_A71CH */ - -/** - * \def MBEDTLS_ECP_NIST_OPTIM - * - * Enable specific 'modulo p' routines for each NIST prime. - * Depending on the prime and architecture, makes operations 4 to 8 times - * faster on the corresponding curve. - * - * Comment this macro to disable NIST curves optimisation. - */ -#define MBEDTLS_ECP_NIST_OPTIM - -/** - * \def MBEDTLS_ECDSA_DETERMINISTIC - * - * Enable deterministic ECDSA (RFC 6979). - * Standard ECDSA is "fragile" in the sense that lack of entropy when signing - * may result in a compromise of the long-term signing key. This is avoided by - * the deterministic variant. - * - * Requires: MBEDTLS_HMAC_DRBG_C - * - * Comment this macro to disable deterministic ECDSA. - */ -#define MBEDTLS_ECDSA_DETERMINISTIC - -/** - * \def MBEDTLS_KEY_EXCHANGE_PSK_ENABLED - * - * Enable the PSK based ciphersuite modes in SSL / TLS. - * - * This enables the following ciphersuites (if other requisites are - * enabled as well): - * MBEDTLS_TLS_PSK_WITH_AES_256_GCM_SHA384 - * MBEDTLS_TLS_PSK_WITH_AES_256_CBC_SHA384 - * MBEDTLS_TLS_PSK_WITH_AES_256_CBC_SHA - * MBEDTLS_TLS_PSK_WITH_CAMELLIA_256_GCM_SHA384 - * MBEDTLS_TLS_PSK_WITH_CAMELLIA_256_CBC_SHA384 - * MBEDTLS_TLS_PSK_WITH_AES_128_GCM_SHA256 - * MBEDTLS_TLS_PSK_WITH_AES_128_CBC_SHA256 - * MBEDTLS_TLS_PSK_WITH_AES_128_CBC_SHA - * MBEDTLS_TLS_PSK_WITH_CAMELLIA_128_GCM_SHA256 - * MBEDTLS_TLS_PSK_WITH_CAMELLIA_128_CBC_SHA256 - * MBEDTLS_TLS_PSK_WITH_3DES_EDE_CBC_SHA - * MBEDTLS_TLS_PSK_WITH_RC4_128_SHA - */ -#define MBEDTLS_KEY_EXCHANGE_PSK_ENABLED - -/** - * \def MBEDTLS_KEY_EXCHANGE_DHE_PSK_ENABLED - * - * Enable the DHE-PSK based ciphersuite modes in SSL / TLS. - * - * Requires: MBEDTLS_DHM_C - * - * This enables the following ciphersuites (if other requisites are - * enabled as well): - * MBEDTLS_TLS_DHE_PSK_WITH_AES_256_GCM_SHA384 - * MBEDTLS_TLS_DHE_PSK_WITH_AES_256_CBC_SHA384 - * MBEDTLS_TLS_DHE_PSK_WITH_AES_256_CBC_SHA - * MBEDTLS_TLS_DHE_PSK_WITH_CAMELLIA_256_GCM_SHA384 - * MBEDTLS_TLS_DHE_PSK_WITH_CAMELLIA_256_CBC_SHA384 - * MBEDTLS_TLS_DHE_PSK_WITH_AES_128_GCM_SHA256 - * MBEDTLS_TLS_DHE_PSK_WITH_AES_128_CBC_SHA256 - * MBEDTLS_TLS_DHE_PSK_WITH_AES_128_CBC_SHA - * MBEDTLS_TLS_DHE_PSK_WITH_CAMELLIA_128_GCM_SHA256 - * MBEDTLS_TLS_DHE_PSK_WITH_CAMELLIA_128_CBC_SHA256 - * MBEDTLS_TLS_DHE_PSK_WITH_3DES_EDE_CBC_SHA - * MBEDTLS_TLS_DHE_PSK_WITH_RC4_128_SHA - * - * \warning Using DHE constitutes a security risk as it - * is not possible to validate custom DH parameters. - * If possible, it is recommended users should consider - * preferring other methods of key exchange. - * See dhm.h for more details. - * - */ -#define MBEDTLS_KEY_EXCHANGE_DHE_PSK_ENABLED - -/** - * \def MBEDTLS_KEY_EXCHANGE_ECDHE_PSK_ENABLED - * - * Enable the ECDHE-PSK based ciphersuite modes in SSL / TLS. - * - * Requires: MBEDTLS_ECDH_C - * - * This enables the following ciphersuites (if other requisites are - * enabled as well): - * MBEDTLS_TLS_ECDHE_PSK_WITH_AES_256_CBC_SHA384 - * MBEDTLS_TLS_ECDHE_PSK_WITH_AES_256_CBC_SHA - * MBEDTLS_TLS_ECDHE_PSK_WITH_CAMELLIA_256_CBC_SHA384 - * MBEDTLS_TLS_ECDHE_PSK_WITH_AES_128_CBC_SHA256 - * MBEDTLS_TLS_ECDHE_PSK_WITH_AES_128_CBC_SHA - * MBEDTLS_TLS_ECDHE_PSK_WITH_CAMELLIA_128_CBC_SHA256 - * MBEDTLS_TLS_ECDHE_PSK_WITH_3DES_EDE_CBC_SHA - * MBEDTLS_TLS_ECDHE_PSK_WITH_RC4_128_SHA - */ -#define MBEDTLS_KEY_EXCHANGE_ECDHE_PSK_ENABLED - -/** - * \def MBEDTLS_KEY_EXCHANGE_RSA_PSK_ENABLED - * - * Enable the RSA-PSK based ciphersuite modes in SSL / TLS. - * - * Requires: MBEDTLS_RSA_C, MBEDTLS_PKCS1_V15, - * MBEDTLS_X509_CRT_PARSE_C - * - * This enables the following ciphersuites (if other requisites are - * enabled as well): - * MBEDTLS_TLS_RSA_PSK_WITH_AES_256_GCM_SHA384 - * MBEDTLS_TLS_RSA_PSK_WITH_AES_256_CBC_SHA384 - * MBEDTLS_TLS_RSA_PSK_WITH_AES_256_CBC_SHA - * MBEDTLS_TLS_RSA_PSK_WITH_CAMELLIA_256_GCM_SHA384 - * MBEDTLS_TLS_RSA_PSK_WITH_CAMELLIA_256_CBC_SHA384 - * MBEDTLS_TLS_RSA_PSK_WITH_AES_128_GCM_SHA256 - * MBEDTLS_TLS_RSA_PSK_WITH_AES_128_CBC_SHA256 - * MBEDTLS_TLS_RSA_PSK_WITH_AES_128_CBC_SHA - * MBEDTLS_TLS_RSA_PSK_WITH_CAMELLIA_128_GCM_SHA256 - * MBEDTLS_TLS_RSA_PSK_WITH_CAMELLIA_128_CBC_SHA256 - * MBEDTLS_TLS_RSA_PSK_WITH_3DES_EDE_CBC_SHA - * MBEDTLS_TLS_RSA_PSK_WITH_RC4_128_SHA - */ -#define MBEDTLS_KEY_EXCHANGE_RSA_PSK_ENABLED - -/** - * \def MBEDTLS_KEY_EXCHANGE_RSA_ENABLED - * - * Enable the RSA-only based ciphersuite modes in SSL / TLS. - * - * Requires: MBEDTLS_RSA_C, MBEDTLS_PKCS1_V15, - * MBEDTLS_X509_CRT_PARSE_C - * - * This enables the following ciphersuites (if other requisites are - * enabled as well): - * MBEDTLS_TLS_RSA_WITH_AES_256_GCM_SHA384 - * MBEDTLS_TLS_RSA_WITH_AES_256_CBC_SHA256 - * MBEDTLS_TLS_RSA_WITH_AES_256_CBC_SHA - * MBEDTLS_TLS_RSA_WITH_CAMELLIA_256_GCM_SHA384 - * MBEDTLS_TLS_RSA_WITH_CAMELLIA_256_CBC_SHA256 - * MBEDTLS_TLS_RSA_WITH_CAMELLIA_256_CBC_SHA - * MBEDTLS_TLS_RSA_WITH_AES_128_GCM_SHA256 - * MBEDTLS_TLS_RSA_WITH_AES_128_CBC_SHA256 - * MBEDTLS_TLS_RSA_WITH_AES_128_CBC_SHA - * MBEDTLS_TLS_RSA_WITH_CAMELLIA_128_GCM_SHA256 - * MBEDTLS_TLS_RSA_WITH_CAMELLIA_128_CBC_SHA256 - * MBEDTLS_TLS_RSA_WITH_CAMELLIA_128_CBC_SHA - * MBEDTLS_TLS_RSA_WITH_3DES_EDE_CBC_SHA - * MBEDTLS_TLS_RSA_WITH_RC4_128_SHA - * MBEDTLS_TLS_RSA_WITH_RC4_128_MD5 - */ -#define MBEDTLS_KEY_EXCHANGE_RSA_ENABLED - -/** - * \def MBEDTLS_KEY_EXCHANGE_DHE_RSA_ENABLED - * - * Enable the DHE-RSA based ciphersuite modes in SSL / TLS. - * - * Requires: MBEDTLS_DHM_C, MBEDTLS_RSA_C, MBEDTLS_PKCS1_V15, - * MBEDTLS_X509_CRT_PARSE_C - * - * This enables the following ciphersuites (if other requisites are - * enabled as well): - * MBEDTLS_TLS_DHE_RSA_WITH_AES_256_GCM_SHA384 - * MBEDTLS_TLS_DHE_RSA_WITH_AES_256_CBC_SHA256 - * MBEDTLS_TLS_DHE_RSA_WITH_AES_256_CBC_SHA - * MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_256_GCM_SHA384 - * MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA256 - * MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA - * MBEDTLS_TLS_DHE_RSA_WITH_AES_128_GCM_SHA256 - * MBEDTLS_TLS_DHE_RSA_WITH_AES_128_CBC_SHA256 - * MBEDTLS_TLS_DHE_RSA_WITH_AES_128_CBC_SHA - * MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_128_GCM_SHA256 - * MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA256 - * MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA - * MBEDTLS_TLS_DHE_RSA_WITH_3DES_EDE_CBC_SHA - * - * \warning Using DHE constitutes a security risk as it - * is not possible to validate custom DH parameters. - * If possible, it is recommended users should consider - * preferring other methods of key exchange. - * See dhm.h for more details. - * - */ -#define MBEDTLS_KEY_EXCHANGE_DHE_RSA_ENABLED - -/** - * \def MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED - * - * Enable the ECDHE-RSA based ciphersuite modes in SSL / TLS. - * - * Requires: MBEDTLS_ECDH_C, MBEDTLS_RSA_C, MBEDTLS_PKCS1_V15, - * MBEDTLS_X509_CRT_PARSE_C - * - * This enables the following ciphersuites (if other requisites are - * enabled as well): - * MBEDTLS_TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 - * MBEDTLS_TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384 - * MBEDTLS_TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA - * MBEDTLS_TLS_ECDHE_RSA_WITH_CAMELLIA_256_GCM_SHA384 - * MBEDTLS_TLS_ECDHE_RSA_WITH_CAMELLIA_256_CBC_SHA384 - * MBEDTLS_TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 - * MBEDTLS_TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256 - * MBEDTLS_TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA - * MBEDTLS_TLS_ECDHE_RSA_WITH_CAMELLIA_128_GCM_SHA256 - * MBEDTLS_TLS_ECDHE_RSA_WITH_CAMELLIA_128_CBC_SHA256 - * MBEDTLS_TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA - * MBEDTLS_TLS_ECDHE_RSA_WITH_RC4_128_SHA - */ -#define MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED - -/** - * \def MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED - * - * Enable the ECDHE-ECDSA based ciphersuite modes in SSL / TLS. - * - * Requires: MBEDTLS_ECDH_C, MBEDTLS_ECDSA_C, MBEDTLS_X509_CRT_PARSE_C, - * - * This enables the following ciphersuites (if other requisites are - * enabled as well): - * MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384 - * MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384 - * MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA - * MBEDTLS_TLS_ECDHE_ECDSA_WITH_CAMELLIA_256_GCM_SHA384 - * MBEDTLS_TLS_ECDHE_ECDSA_WITH_CAMELLIA_256_CBC_SHA384 - * MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256 - * MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256 - * MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA - * MBEDTLS_TLS_ECDHE_ECDSA_WITH_CAMELLIA_128_GCM_SHA256 - * MBEDTLS_TLS_ECDHE_ECDSA_WITH_CAMELLIA_128_CBC_SHA256 - * MBEDTLS_TLS_ECDHE_ECDSA_WITH_3DES_EDE_CBC_SHA - * MBEDTLS_TLS_ECDHE_ECDSA_WITH_RC4_128_SHA - */ -#define MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED - -/** - * \def MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA_ENABLED - * - * Enable the ECDH-ECDSA based ciphersuite modes in SSL / TLS. - * - * Requires: MBEDTLS_ECDH_C, MBEDTLS_X509_CRT_PARSE_C - * - * This enables the following ciphersuites (if other requisites are - * enabled as well): - * MBEDTLS_TLS_ECDH_ECDSA_WITH_RC4_128_SHA - * MBEDTLS_TLS_ECDH_ECDSA_WITH_3DES_EDE_CBC_SHA - * MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA - * MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA - * MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA256 - * MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA384 - * MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_128_GCM_SHA256 - * MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_256_GCM_SHA384 - * MBEDTLS_TLS_ECDH_ECDSA_WITH_CAMELLIA_128_CBC_SHA256 - * MBEDTLS_TLS_ECDH_ECDSA_WITH_CAMELLIA_256_CBC_SHA384 - * MBEDTLS_TLS_ECDH_ECDSA_WITH_CAMELLIA_128_GCM_SHA256 - * MBEDTLS_TLS_ECDH_ECDSA_WITH_CAMELLIA_256_GCM_SHA384 - */ -#define MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA_ENABLED - -/** - * \def MBEDTLS_KEY_EXCHANGE_ECDH_RSA_ENABLED - * - * Enable the ECDH-RSA based ciphersuite modes in SSL / TLS. - * - * Requires: MBEDTLS_ECDH_C, MBEDTLS_X509_CRT_PARSE_C - * - * This enables the following ciphersuites (if other requisites are - * enabled as well): - * MBEDTLS_TLS_ECDH_RSA_WITH_RC4_128_SHA - * MBEDTLS_TLS_ECDH_RSA_WITH_3DES_EDE_CBC_SHA - * MBEDTLS_TLS_ECDH_RSA_WITH_AES_128_CBC_SHA - * MBEDTLS_TLS_ECDH_RSA_WITH_AES_256_CBC_SHA - * MBEDTLS_TLS_ECDH_RSA_WITH_AES_128_CBC_SHA256 - * MBEDTLS_TLS_ECDH_RSA_WITH_AES_256_CBC_SHA384 - * MBEDTLS_TLS_ECDH_RSA_WITH_AES_128_GCM_SHA256 - * MBEDTLS_TLS_ECDH_RSA_WITH_AES_256_GCM_SHA384 - * MBEDTLS_TLS_ECDH_RSA_WITH_CAMELLIA_128_CBC_SHA256 - * MBEDTLS_TLS_ECDH_RSA_WITH_CAMELLIA_256_CBC_SHA384 - * MBEDTLS_TLS_ECDH_RSA_WITH_CAMELLIA_128_GCM_SHA256 - * MBEDTLS_TLS_ECDH_RSA_WITH_CAMELLIA_256_GCM_SHA384 - */ -#define MBEDTLS_KEY_EXCHANGE_ECDH_RSA_ENABLED - -/** - * \def MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED - * - * Enable the ECJPAKE based ciphersuite modes in SSL / TLS. - * - * \warning This is currently experimental. EC J-PAKE support is based on the - * Thread v1.0.0 specification; incompatible changes to the specification - * might still happen. For this reason, this is disabled by default. - * - * Requires: MBEDTLS_ECJPAKE_C - * MBEDTLS_SHA256_C - * MBEDTLS_ECP_DP_SECP256R1_ENABLED - * - * This enables the following ciphersuites (if other requisites are - * enabled as well): - * MBEDTLS_TLS_ECJPAKE_WITH_AES_128_CCM_8 - */ -/*#define MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED */ - -/** - * \def MBEDTLS_PK_PARSE_EC_EXTENDED - * - * Enhance support for reading EC keys using variants of SEC1 not allowed by - * RFC 5915 and RFC 5480. - * - * Currently this means parsing the SpecifiedECDomain choice of EC - * parameters (only known groups are supported, not arbitrary domains, to - * avoid validation issues). - * - * Disable if you only need to support RFC 5915 + 5480 key formats. - */ -#define MBEDTLS_PK_PARSE_EC_EXTENDED - -/** - * \def MBEDTLS_ERROR_STRERROR_DUMMY - * - * Enable a dummy error function to make use of mbedtls_strerror() in - * third party libraries easier when MBEDTLS_ERROR_C is disabled - * (no effect when MBEDTLS_ERROR_C is enabled). - * - * You can safely disable this if MBEDTLS_ERROR_C is enabled, or if you're - * not using mbedtls_strerror() or error_strerror() in your application. - * - * Disable if you run into name conflicts and want to really remove the - * mbedtls_strerror() - */ -#define MBEDTLS_ERROR_STRERROR_DUMMY - -/** - * \def MBEDTLS_GENPRIME - * - * Enable the prime-number generation code. - * - * Requires: MBEDTLS_BIGNUM_C - */ -#define MBEDTLS_GENPRIME - -/** - * \def MBEDTLS_FS_IO - * - * Enable functions that use the filesystem. - */ -/*#define MBEDTLS_FS_IO */ - -/** - * \def MBEDTLS_NO_DEFAULT_ENTROPY_SOURCES - * - * Do not add default entropy sources. These are the platform specific, - * mbedtls_timing_hardclock and HAVEGE based poll functions. - * - * This is useful to have more control over the added entropy sources in an - * application. - * - * Uncomment this macro to prevent loading of default entropy functions. - */ -/*#define MBEDTLS_NO_DEFAULT_ENTROPY_SOURCES */ - -/** - * \def MBEDTLS_NO_PLATFORM_ENTROPY - * - * Do not use built-in platform entropy functions. - * This is useful if your platform does not support - * standards like the /dev/urandom or Windows CryptoAPI. - * - * Uncomment this macro to disable the built-in platform entropy functions. - */ -#define MBEDTLS_NO_PLATFORM_ENTROPY - -/** - * \def MBEDTLS_ENTROPY_FORCE_SHA256 - * - * Force the entropy accumulator to use a SHA-256 accumulator instead of the - * default SHA-512 based one (if both are available). - * - * Requires: MBEDTLS_SHA256_C - * - * On 32-bit systems SHA-256 can be much faster than SHA-512. Use this option - * if you have performance concerns. - * - * This option is only useful if both MBEDTLS_SHA256_C and - * MBEDTLS_SHA512_C are defined. Otherwise the available hash module is used. - */ -/*#define MBEDTLS_ENTROPY_FORCE_SHA256 */ - -/** - * \def MBEDTLS_ENTROPY_NV_SEED - * - * Enable the non-volatile (NV) seed file-based entropy source. - * (Also enables the NV seed read/write functions in the platform layer) - * - * This is crucial (if not required) on systems that do not have a - * cryptographic entropy source (in hardware or kernel) available. - * - * Requires: MBEDTLS_ENTROPY_C, MBEDTLS_PLATFORM_C - * - * \note The read/write functions that are used by the entropy source are - * determined in the platform layer, and can be modified at runtime and/or - * compile-time depending on the flags (MBEDTLS_PLATFORM_NV_SEED_*) used. - * - * \note If you use the default implementation functions that read a seedfile - * with regular fopen(), please make sure you make a seedfile with the - * proper name (defined in MBEDTLS_PLATFORM_STD_NV_SEED_FILE) and at - * least MBEDTLS_ENTROPY_BLOCK_SIZE bytes in size that can be read from - * and written to or you will get an entropy source error! The default - * implementation will only use the first MBEDTLS_ENTROPY_BLOCK_SIZE - * bytes from the file. - * - * \note The entropy collector will write to the seed file before entropy is - * given to an external source, to update it. - */ -/*#define MBEDTLS_ENTROPY_NV_SEED */ - -/** - * \def MBEDTLS_MEMORY_DEBUG - * - * Enable debugging of buffer allocator memory issues. Automatically prints - * (to stderr) all (fatal) messages on memory allocation issues. Enables - * function for 'debug output' of allocated memory. - * - * Requires: MBEDTLS_MEMORY_BUFFER_ALLOC_C - * - * Uncomment this macro to let the buffer allocator print out error messages. - */ -/*#define MBEDTLS_MEMORY_DEBUG */ - -/** - * \def MBEDTLS_MEMORY_BACKTRACE - * - * Include backtrace information with each allocated block. - * - * Requires: MBEDTLS_MEMORY_BUFFER_ALLOC_C - * GLIBC-compatible backtrace() an backtrace_symbols() support - * - * Uncomment this macro to include backtrace information - */ -/*#define MBEDTLS_MEMORY_BACKTRACE */ - -/** - * \def MBEDTLS_PK_RSA_ALT_SUPPORT - * - * Support external private RSA keys (eg from a HSM) in the PK layer. - * - * Comment this macro to disable support for external private RSA keys. - */ -#define MBEDTLS_PK_RSA_ALT_SUPPORT - -/** - * \def MBEDTLS_PKCS1_V15 - * - * Enable support for PKCS#1 v1.5 encoding. - * - * Requires: MBEDTLS_RSA_C - * - * This enables support for PKCS#1 v1.5 operations. - */ -#define MBEDTLS_PKCS1_V15 - -/** - * \def MBEDTLS_PKCS1_V21 - * - * Enable support for PKCS#1 v2.1 encoding. - * - * Requires: MBEDTLS_MD_C, MBEDTLS_RSA_C - * - * This enables support for RSAES-OAEP and RSASSA-PSS operations. - */ -#define MBEDTLS_PKCS1_V21 - -/** - * \def MBEDTLS_RSA_NO_CRT - * - * Do not use the Chinese Remainder Theorem for the RSA private operation. - * - * Uncomment this macro to disable the use of CRT in RSA. - * - */ -/*#define MBEDTLS_RSA_NO_CRT */ - -/** - * \def MBEDTLS_SELF_TEST - * - * Enable the checkup functions (*_self_test). - */ -/* #define MBEDTLS_SELF_TEST */ - -/** - * \def MBEDTLS_SHA256_SMALLER - * - * Enable an implementation of SHA-256 that has lower ROM footprint but also - * lower performance. - * - * The default implementation is meant to be a reasonnable compromise between - * performance and size. This version optimizes more aggressively for size at - * the expense of performance. Eg on Cortex-M4 it reduces the size of - * mbedtls_sha256_process() from ~2KB to ~0.5KB for a performance hit of about - * 30%. - * - * Uncomment to enable the smaller implementation of SHA256. - */ -/*#define MBEDTLS_SHA256_SMALLER */ - -/** - * \def MBEDTLS_SSL_ALL_ALERT_MESSAGES - * - * Enable sending of alert messages in case of encountered errors as per RFC. - * If you choose not to send the alert messages, mbed TLS can still communicate - * with other servers, only debugging of failures is harder. - * - * The advantage of not sending alert messages, is that no information is given - * about reasons for failures thus preventing adversaries of gaining intel. - * - * Enable sending of all alert messages - */ -#define MBEDTLS_SSL_ALL_ALERT_MESSAGES - -/** - * \def MBEDTLS_SSL_DEBUG_ALL - * - * Enable the debug messages in SSL module for all issues. - * Debug messages have been disabled in some places to prevent timing - * attacks due to (unbalanced) debugging function calls. - * - * If you need all error reporting you should enable this during debugging, - * but remove this for production servers that should log as well. - * - * Uncomment this macro to report all debug messages on errors introducing - * a timing side-channel. - * - */ -/*#define MBEDTLS_SSL_DEBUG_ALL */ - -/** \def MBEDTLS_SSL_ENCRYPT_THEN_MAC - * - * Enable support for Encrypt-then-MAC, RFC 7366. - * - * This allows peers that both support it to use a more robust protection for - * ciphersuites using CBC, providing deep resistance against timing attacks - * on the padding or underlying cipher. - * - * This only affects CBC ciphersuites, and is useless if none is defined. - * - * Requires: MBEDTLS_SSL_PROTO_TLS1 or - * MBEDTLS_SSL_PROTO_TLS1_1 or - * MBEDTLS_SSL_PROTO_TLS1_2 - * - * Comment this macro to disable support for Encrypt-then-MAC - */ -#define MBEDTLS_SSL_ENCRYPT_THEN_MAC - -/** \def MBEDTLS_SSL_EXTENDED_MASTER_SECRET - * - * Enable support for Extended Master Secret, aka Session Hash - * (draft-ietf-tls-session-hash-02). - * - * This was introduced as "the proper fix" to the Triple Handshake family of - * attacks, but it is recommended to always use it (even if you disable - * renegotiation), since it actually fixes a more fundamental issue in the - * original SSL/TLS design, and has implications beyond Triple Handshake. - * - * Requires: MBEDTLS_SSL_PROTO_TLS1 or - * MBEDTLS_SSL_PROTO_TLS1_1 or - * MBEDTLS_SSL_PROTO_TLS1_2 - * - * Comment this macro to disable support for Extended Master Secret. - */ -#define MBEDTLS_SSL_EXTENDED_MASTER_SECRET - -/** - * \def MBEDTLS_SSL_FALLBACK_SCSV - * - * Enable support for FALLBACK_SCSV (draft-ietf-tls-downgrade-scsv-00). - * - * For servers, it is recommended to always enable this, unless you support - * only one version of TLS, or know for sure that none of your clients - * implements a fallback strategy. - * - * For clients, you only need this if you're using a fallback strategy, which - * is not recommended in the first place, unless you absolutely need it to - * interoperate with buggy (version-intolerant) servers. - * - * Comment this macro to disable support for FALLBACK_SCSV - */ -#define MBEDTLS_SSL_FALLBACK_SCSV - -/** - * \def MBEDTLS_SSL_HW_RECORD_ACCEL - * - * Enable hooking functions in SSL module for hardware acceleration of - * individual records. - * - * Uncomment this macro to enable hooking functions. - */ -/*#define MBEDTLS_SSL_HW_RECORD_ACCEL */ - -/** - * \def MBEDTLS_SSL_CBC_RECORD_SPLITTING - * - * Enable 1/n-1 record splitting for CBC mode in SSLv3 and TLS 1.0. - * - * This is a countermeasure to the BEAST attack, which also minimizes the risk - * of interoperability issues compared to sending 0-length records. - * - * Comment this macro to disable 1/n-1 record splitting. - */ -#define MBEDTLS_SSL_CBC_RECORD_SPLITTING - -/** - * \def MBEDTLS_SSL_RENEGOTIATION - * - * Disable support for TLS renegotiation. - * - * The two main uses of renegotiation are (1) refresh keys on long-lived - * connections and (2) client authentication after the initial handshake. - * If you don't need renegotiation, it's probably better to disable it, since - * it has been associated with security issues in the past and is easy to - * misuse/misunderstand. - * - * Comment this to disable support for renegotiation. - * - * \note Even if this option is disabled, both client and server are aware - * of the Renegotiation Indication Extension (RFC 5746) used to - * prevent the SSL renegotiation attack (see RFC 5746 Sect. 1). - * (See \c mbedtls_ssl_conf_legacy_renegotiation for the - * configuration of this extension). - * - */ -#define MBEDTLS_SSL_RENEGOTIATION - -/** - * \def MBEDTLS_SSL_SRV_SUPPORT_SSLV2_CLIENT_HELLO - * - * Enable support for receiving and parsing SSLv2 Client Hello messages for the - * SSL Server module (MBEDTLS_SSL_SRV_C). - * - * Uncomment this macro to enable support for SSLv2 Client Hello messages. - */ -/*#define MBEDTLS_SSL_SRV_SUPPORT_SSLV2_CLIENT_HELLO */ - -/** - * \def MBEDTLS_SSL_SRV_RESPECT_CLIENT_PREFERENCE - * - * Pick the ciphersuite according to the client's preferences rather than ours - * in the SSL Server module (MBEDTLS_SSL_SRV_C). - * - * Uncomment this macro to respect client's ciphersuite order - */ -/*#define MBEDTLS_SSL_SRV_RESPECT_CLIENT_PREFERENCE */ - -/** - * \def MBEDTLS_SSL_MAX_FRAGMENT_LENGTH - * - * Enable support for RFC 6066 max_fragment_length extension in SSL. - * - * Comment this macro to disable support for the max_fragment_length extension - */ -#define MBEDTLS_SSL_MAX_FRAGMENT_LENGTH - -/** - * \def MBEDTLS_SSL_PROTO_SSL3 - * - * Enable support for SSL 3.0. - * - * Requires: MBEDTLS_MD5_C - * MBEDTLS_SHA1_C - * - * Comment this macro to disable support for SSL 3.0 - */ -/*#define MBEDTLS_SSL_PROTO_SSL3 */ - -/** - * \def MBEDTLS_SSL_PROTO_TLS1 - * - * Enable support for TLS 1.0. - * - * Requires: MBEDTLS_MD5_C - * MBEDTLS_SHA1_C - * - * Comment this macro to disable support for TLS 1.0 - */ -#define MBEDTLS_SSL_PROTO_TLS1 - -/** - * \def MBEDTLS_SSL_PROTO_TLS1_1 - * - * Enable support for TLS 1.1 (and DTLS 1.0 if DTLS is enabled). - * - * Requires: MBEDTLS_MD5_C - * MBEDTLS_SHA1_C - * - * Comment this macro to disable support for TLS 1.1 / DTLS 1.0 - */ -#define MBEDTLS_SSL_PROTO_TLS1_1 - -/** - * \def MBEDTLS_SSL_PROTO_TLS1_2 - * - * Enable support for TLS 1.2 (and DTLS 1.2 if DTLS is enabled). - * - * Requires: MBEDTLS_SHA1_C or MBEDTLS_SHA256_C or MBEDTLS_SHA512_C - * (Depends on ciphersuites) - * - * Comment this macro to disable support for TLS 1.2 / DTLS 1.2 - */ -#define MBEDTLS_SSL_PROTO_TLS1_2 - -/** - * \def MBEDTLS_SSL_PROTO_DTLS - * - * Enable support for DTLS (all available versions). - * - * Enable this and MBEDTLS_SSL_PROTO_TLS1_1 to enable DTLS 1.0, - * and/or this and MBEDTLS_SSL_PROTO_TLS1_2 to enable DTLS 1.2. - * - * Requires: MBEDTLS_SSL_PROTO_TLS1_1 - * or MBEDTLS_SSL_PROTO_TLS1_2 - * - * Comment this macro to disable support for DTLS - */ -/*#define MBEDTLS_SSL_PROTO_DTLS */ - -/** - * \def MBEDTLS_SSL_ALPN - * - * Enable support for RFC 7301 Application Layer Protocol Negotiation. - * - * Comment this macro to disable support for ALPN. - */ -#define MBEDTLS_SSL_ALPN - -/** - * \def MBEDTLS_SSL_DTLS_ANTI_REPLAY - * - * Enable support for the anti-replay mechanism in DTLS. - * - * Requires: MBEDTLS_SSL_TLS_C - * MBEDTLS_SSL_PROTO_DTLS - * - * \warning Disabling this is often a security risk! - * See mbedtls_ssl_conf_dtls_anti_replay() for details. - * - * Comment this to disable anti-replay in DTLS. - */ -/*#define MBEDTLS_SSL_DTLS_ANTI_REPLAY */ - -/** - * \def MBEDTLS_SSL_DTLS_HELLO_VERIFY - * - * Enable support for HelloVerifyRequest on DTLS servers. - * - * This feature is highly recommended to prevent DTLS servers being used as - * amplifiers in DoS attacks against other hosts. It should always be enabled - * unless you know for sure amplification cannot be a problem in the - * environment in which your server operates. - * - * \warning Disabling this can ba a security risk! (see above) - * - * Requires: MBEDTLS_SSL_PROTO_DTLS - * - * Comment this to disable support for HelloVerifyRequest. - */ -/*#define MBEDTLS_SSL_DTLS_HELLO_VERIFY */ - -/** - * \def MBEDTLS_SSL_DTLS_CLIENT_PORT_REUSE - * - * Enable server-side support for clients that reconnect from the same port. - * - * Some clients unexpectedly close the connection and try to reconnect using the - * same source port. This needs special support from the server to handle the - * new connection securely, as described in section 4.2.8 of RFC 6347. This - * flag enables that support. - * - * Requires: MBEDTLS_SSL_DTLS_HELLO_VERIFY - * - * Comment this to disable support for clients reusing the source port. - */ -/*#define MBEDTLS_SSL_DTLS_CLIENT_PORT_REUSE */ - -/** - * \def MBEDTLS_SSL_DTLS_BADMAC_LIMIT - * - * Enable support for a limit of records with bad MAC. - * - * See mbedtls_ssl_conf_dtls_badmac_limit(). - * - * Requires: MBEDTLS_SSL_PROTO_DTLS - */ -/*#define MBEDTLS_SSL_DTLS_BADMAC_LIMIT */ - -/** - * \def MBEDTLS_SSL_SESSION_TICKETS - * - * Enable support for RFC 5077 session tickets in SSL. - * Client-side, provides full support for session tickets (maintenance of a - * session store remains the responsibility of the application, though). - * Server-side, you also need to provide callbacks for writing and parsing - * tickets, including authenticated encryption and key management. Example - * callbacks are provided by MBEDTLS_SSL_TICKET_C. - * - * Comment this macro to disable support for SSL session tickets - */ -#define MBEDTLS_SSL_SESSION_TICKETS - -/** - * \def MBEDTLS_SSL_EXPORT_KEYS - * - * Enable support for exporting key block and master secret. - * This is required for certain users of TLS, e.g. EAP-TLS. - * - * Comment this macro to disable support for key export - */ -#define MBEDTLS_SSL_EXPORT_KEYS - -/** - * \def MBEDTLS_SSL_SERVER_NAME_INDICATION - * - * Enable support for RFC 6066 server name indication (SNI) in SSL. - * - * Requires: MBEDTLS_X509_CRT_PARSE_C - * - * Comment this macro to disable support for server name indication in SSL - */ -#define MBEDTLS_SSL_SERVER_NAME_INDICATION - -/** - * \def MBEDTLS_SSL_TRUNCATED_HMAC - * - * Enable support for RFC 6066 truncated HMAC in SSL. - * - * Comment this macro to disable support for truncated HMAC in SSL - */ -#define MBEDTLS_SSL_TRUNCATED_HMAC - -/** - * \def MBEDTLS_SSL_TRUNCATED_HMAC_COMPAT - * - * Fallback to old (pre-2.7), non-conforming implementation of the truncated - * HMAC extension which also truncates the HMAC key. Note that this option is - * only meant for a transitory upgrade period and is likely to be removed in - * a future version of the library. - * - * \warning The old implementation is non-compliant and has a security weakness - * (2^80 brute force attack on the HMAC key used for a single, - * uninterrupted connection). This should only be enabled temporarily - * when (1) the use of truncated HMAC is essential in order to save - * bandwidth, and (2) the peer is an Mbed TLS stack that doesn't use - * the fixed implementation yet (pre-2.7). - * - * \deprecated This option is deprecated and will likely be removed in a - * future version of Mbed TLS. - * - * Uncomment to fallback to old, non-compliant truncated HMAC implementation. - * - * Requires: MBEDTLS_SSL_TRUNCATED_HMAC - */ -/*#define MBEDTLS_SSL_TRUNCATED_HMAC_COMPAT */ - -/** - * \def MBEDTLS_THREADING_ALT - * - * Provide your own alternate threading implementation. - * - * Requires: MBEDTLS_THREADING_C - * - * Uncomment this to allow your own alternate threading implementation. - */ -/*#define MBEDTLS_THREADING_ALT */ - -/** - * \def MBEDTLS_THREADING_PTHREAD - * - * Enable the pthread wrapper layer for the threading layer. - * - * Requires: MBEDTLS_THREADING_C - * - * Uncomment this to enable pthread mutexes. - */ -/*#define MBEDTLS_THREADING_PTHREAD */ - -/** - * \def MBEDTLS_VERSION_FEATURES - * - * Allow run-time checking of compile-time enabled features. Thus allowing users - * to check at run-time if the library is for instance compiled with threading - * support via mbedtls_version_check_feature(). - * - * Requires: MBEDTLS_VERSION_C - * - * Comment this to disable run-time checking and save ROM space - */ -/*#define MBEDTLS_VERSION_FEATURES */ - -/** - * \def MBEDTLS_X509_ALLOW_EXTENSIONS_NON_V3 - * - * If set, the X509 parser will not break-off when parsing an X509 certificate - * and encountering an extension in a v1 or v2 certificate. - * - * Uncomment to prevent an error. - */ -/*#define MBEDTLS_X509_ALLOW_EXTENSIONS_NON_V3 */ - -/** - * \def MBEDTLS_X509_ALLOW_UNSUPPORTED_CRITICAL_EXTENSION - * - * If set, the X509 parser will not break-off when parsing an X509 certificate - * and encountering an unknown critical extension. - * - * \warning Depending on your PKI use, enabling this can be a security risk! - * - * Uncomment to prevent an error. - */ -/*#define MBEDTLS_X509_ALLOW_UNSUPPORTED_CRITICAL_EXTENSION */ - -/** - * \def MBEDTLS_X509_CHECK_KEY_USAGE - * - * Enable verification of the keyUsage extension (CA and leaf certificates). - * - * Disabling this avoids problems with mis-issued and/or misused - * (intermediate) CA and leaf certificates. - * - * \warning Depending on your PKI use, disabling this can be a security risk! - * - * Comment to skip keyUsage checking for both CA and leaf certificates. - */ -#define MBEDTLS_X509_CHECK_KEY_USAGE - -/** - * \def MBEDTLS_X509_CHECK_EXTENDED_KEY_USAGE - * - * Enable verification of the extendedKeyUsage extension (leaf certificates). - * - * Disabling this avoids problems with mis-issued and/or misused certificates. - * - * \warning Depending on your PKI use, disabling this can be a security risk! - * - * Comment to skip extendedKeyUsage checking for certificates. - */ -#define MBEDTLS_X509_CHECK_EXTENDED_KEY_USAGE - -/** - * \def MBEDTLS_X509_RSASSA_PSS_SUPPORT - * - * Enable parsing and verification of X.509 certificates, CRLs and CSRS - * signed with RSASSA-PSS (aka PKCS#1 v2.1). - * - * Comment this macro to disallow using RSASSA-PSS in certificates. - */ -#define MBEDTLS_X509_RSASSA_PSS_SUPPORT - -/** - * \def MBEDTLS_ZLIB_SUPPORT - * - * If set, the SSL/TLS module uses ZLIB to support compression and - * decompression of packet data. - * - * \warning TLS-level compression MAY REDUCE SECURITY! See for example the - * CRIME attack. Before enabling this option, you should examine with care if - * CRIME or similar exploits may be a applicable to your use case. - * - * \note Currently compression can't be used with DTLS. - * - * \deprecated This feature is deprecated and will be removed - * in the next major revision of the library. - * - * Used in: library/ssl_tls.c - * library/ssl_cli.c - * library/ssl_srv.c - * - * This feature requires zlib library and headers to be present. - * - * Uncomment to enable use of ZLIB - */ -/*#define MBEDTLS_ZLIB_SUPPORT */ -/* \} name SECTION: mbed TLS feature support */ - -/** - * \name SECTION: mbed TLS modules - * - * This section enables or disables entire modules in mbed TLS - * \{ - */ - -/** - * \def MBEDTLS_AESNI_C - * - * Enable AES-NI support on x86-64. - * - * Module: library/aesni.c - * Caller: library/aes.c - * - * Requires: MBEDTLS_HAVE_ASM - * - * This modules adds support for the AES-NI instructions on x86-64 - */ -#define MBEDTLS_AESNI_C - -/** - * \def MBEDTLS_AES_C - * - * Enable the AES block cipher. - * - * Module: library/aes.c - * Caller: library/ssl_tls.c - * library/pem.c - * library/ctr_drbg.c - * - * This module enables the following ciphersuites (if other requisites are - * enabled as well): - * MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA - * MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA - * MBEDTLS_TLS_ECDH_RSA_WITH_AES_128_CBC_SHA - * MBEDTLS_TLS_ECDH_RSA_WITH_AES_256_CBC_SHA - * MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA256 - * MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA384 - * MBEDTLS_TLS_ECDH_RSA_WITH_AES_128_CBC_SHA256 - * MBEDTLS_TLS_ECDH_RSA_WITH_AES_256_CBC_SHA384 - * MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_128_GCM_SHA256 - * MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_256_GCM_SHA384 - * MBEDTLS_TLS_ECDH_RSA_WITH_AES_128_GCM_SHA256 - * MBEDTLS_TLS_ECDH_RSA_WITH_AES_256_GCM_SHA384 - * MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384 - * MBEDTLS_TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 - * MBEDTLS_TLS_DHE_RSA_WITH_AES_256_GCM_SHA384 - * MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384 - * MBEDTLS_TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384 - * MBEDTLS_TLS_DHE_RSA_WITH_AES_256_CBC_SHA256 - * MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA - * MBEDTLS_TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA - * MBEDTLS_TLS_DHE_RSA_WITH_AES_256_CBC_SHA - * MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256 - * MBEDTLS_TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 - * MBEDTLS_TLS_DHE_RSA_WITH_AES_128_GCM_SHA256 - * MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256 - * MBEDTLS_TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256 - * MBEDTLS_TLS_DHE_RSA_WITH_AES_128_CBC_SHA256 - * MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA - * MBEDTLS_TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA - * MBEDTLS_TLS_DHE_RSA_WITH_AES_128_CBC_SHA - * MBEDTLS_TLS_DHE_PSK_WITH_AES_256_GCM_SHA384 - * MBEDTLS_TLS_ECDHE_PSK_WITH_AES_256_CBC_SHA384 - * MBEDTLS_TLS_DHE_PSK_WITH_AES_256_CBC_SHA384 - * MBEDTLS_TLS_ECDHE_PSK_WITH_AES_256_CBC_SHA - * MBEDTLS_TLS_DHE_PSK_WITH_AES_256_CBC_SHA - * MBEDTLS_TLS_DHE_PSK_WITH_AES_128_GCM_SHA256 - * MBEDTLS_TLS_ECDHE_PSK_WITH_AES_128_CBC_SHA256 - * MBEDTLS_TLS_DHE_PSK_WITH_AES_128_CBC_SHA256 - * MBEDTLS_TLS_ECDHE_PSK_WITH_AES_128_CBC_SHA - * MBEDTLS_TLS_DHE_PSK_WITH_AES_128_CBC_SHA - * MBEDTLS_TLS_RSA_WITH_AES_256_GCM_SHA384 - * MBEDTLS_TLS_RSA_WITH_AES_256_CBC_SHA256 - * MBEDTLS_TLS_RSA_WITH_AES_256_CBC_SHA - * MBEDTLS_TLS_RSA_WITH_AES_128_GCM_SHA256 - * MBEDTLS_TLS_RSA_WITH_AES_128_CBC_SHA256 - * MBEDTLS_TLS_RSA_WITH_AES_128_CBC_SHA - * MBEDTLS_TLS_RSA_PSK_WITH_AES_256_GCM_SHA384 - * MBEDTLS_TLS_RSA_PSK_WITH_AES_256_CBC_SHA384 - * MBEDTLS_TLS_RSA_PSK_WITH_AES_256_CBC_SHA - * MBEDTLS_TLS_RSA_PSK_WITH_AES_128_GCM_SHA256 - * MBEDTLS_TLS_RSA_PSK_WITH_AES_128_CBC_SHA256 - * MBEDTLS_TLS_RSA_PSK_WITH_AES_128_CBC_SHA - * MBEDTLS_TLS_PSK_WITH_AES_256_GCM_SHA384 - * MBEDTLS_TLS_PSK_WITH_AES_256_CBC_SHA384 - * MBEDTLS_TLS_PSK_WITH_AES_256_CBC_SHA - * MBEDTLS_TLS_PSK_WITH_AES_128_GCM_SHA256 - * MBEDTLS_TLS_PSK_WITH_AES_128_CBC_SHA256 - * MBEDTLS_TLS_PSK_WITH_AES_128_CBC_SHA - * - * PEM_PARSE uses AES for decrypting encrypted keys. - */ -#define MBEDTLS_AES_C - -/** - * \def MBEDTLS_ARC4_C - * - * Enable the ARCFOUR stream cipher. - * - * Module: library/arc4.c - * Caller: library/ssl_tls.c - * - * This module enables the following ciphersuites (if other requisites are - * enabled as well): - * MBEDTLS_TLS_ECDH_ECDSA_WITH_RC4_128_SHA - * MBEDTLS_TLS_ECDH_RSA_WITH_RC4_128_SHA - * MBEDTLS_TLS_ECDHE_ECDSA_WITH_RC4_128_SHA - * MBEDTLS_TLS_ECDHE_RSA_WITH_RC4_128_SHA - * MBEDTLS_TLS_ECDHE_PSK_WITH_RC4_128_SHA - * MBEDTLS_TLS_DHE_PSK_WITH_RC4_128_SHA - * MBEDTLS_TLS_RSA_WITH_RC4_128_SHA - * MBEDTLS_TLS_RSA_WITH_RC4_128_MD5 - * MBEDTLS_TLS_RSA_PSK_WITH_RC4_128_SHA - * MBEDTLS_TLS_PSK_WITH_RC4_128_SHA - * - * \warning ARC4 is considered a weak cipher and its use constitutes a - * security risk. If possible, we recommend avoiding dependencies on - * it, and considering stronger ciphers instead. - * - */ -/*#define MBEDTLS_ARC4_C */ - -/** - * \def MBEDTLS_ASN1_PARSE_C - * - * Enable the generic ASN1 parser. - * - * Module: library/asn1.c - * Caller: library/x509.c - * library/dhm.c - * library/pkcs12.c - * library/pkcs5.c - * library/pkparse.c - */ -#define MBEDTLS_ASN1_PARSE_C - -/** - * \def MBEDTLS_ASN1_WRITE_C - * - * Enable the generic ASN1 writer. - * - * Module: library/asn1write.c - * Caller: library/ecdsa.c - * library/pkwrite.c - * library/x509_create.c - * library/x509write_crt.c - * library/x509write_csr.c - */ -#define MBEDTLS_ASN1_WRITE_C - -/** - * \def MBEDTLS_BASE64_C - * - * Enable the Base64 module. - * - * Module: library/base64.c - * Caller: library/pem.c - * - * This module is required for PEM support (required by X.509). - */ -#define MBEDTLS_BASE64_C - -/** - * \def MBEDTLS_BIGNUM_C - * - * Enable the multi-precision integer library. - * - * Module: library/bignum.c - * Caller: library/dhm.c - * library/ecp.c - * library/ecdsa.c - * library/rsa.c - * library/rsa_internal.c - * library/ssl_tls.c - * - * This module is required for RSA, DHM and ECC (ECDH, ECDSA) support. - */ -#define MBEDTLS_BIGNUM_C - -/** - * \def MBEDTLS_BLOWFISH_C - * - * Enable the Blowfish block cipher. - * - * Module: library/blowfish.c - */ -/*#define MBEDTLS_BLOWFISH_C */ - -/** - * \def MBEDTLS_CAMELLIA_C - * - * Enable the Camellia block cipher. - * - * Module: library/camellia.c - * Caller: library/ssl_tls.c - * - * This module enables the following ciphersuites (if other requisites are - * enabled as well): - * MBEDTLS_TLS_ECDH_ECDSA_WITH_CAMELLIA_128_CBC_SHA256 - * MBEDTLS_TLS_ECDH_ECDSA_WITH_CAMELLIA_256_CBC_SHA384 - * MBEDTLS_TLS_ECDH_RSA_WITH_CAMELLIA_128_CBC_SHA256 - * MBEDTLS_TLS_ECDH_RSA_WITH_CAMELLIA_256_CBC_SHA384 - * MBEDTLS_TLS_ECDH_ECDSA_WITH_CAMELLIA_128_GCM_SHA256 - * MBEDTLS_TLS_ECDH_ECDSA_WITH_CAMELLIA_256_GCM_SHA384 - * MBEDTLS_TLS_ECDH_RSA_WITH_CAMELLIA_128_GCM_SHA256 - * MBEDTLS_TLS_ECDH_RSA_WITH_CAMELLIA_256_GCM_SHA384 - * MBEDTLS_TLS_ECDHE_ECDSA_WITH_CAMELLIA_256_GCM_SHA384 - * MBEDTLS_TLS_ECDHE_RSA_WITH_CAMELLIA_256_GCM_SHA384 - * MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_256_GCM_SHA384 - * MBEDTLS_TLS_ECDHE_ECDSA_WITH_CAMELLIA_256_CBC_SHA384 - * MBEDTLS_TLS_ECDHE_RSA_WITH_CAMELLIA_256_CBC_SHA384 - * MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA256 - * MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA - * MBEDTLS_TLS_ECDHE_ECDSA_WITH_CAMELLIA_128_GCM_SHA256 - * MBEDTLS_TLS_ECDHE_RSA_WITH_CAMELLIA_128_GCM_SHA256 - * MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_128_GCM_SHA256 - * MBEDTLS_TLS_ECDHE_ECDSA_WITH_CAMELLIA_128_CBC_SHA256 - * MBEDTLS_TLS_ECDHE_RSA_WITH_CAMELLIA_128_CBC_SHA256 - * MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA256 - * MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA - * MBEDTLS_TLS_DHE_PSK_WITH_CAMELLIA_256_GCM_SHA384 - * MBEDTLS_TLS_ECDHE_PSK_WITH_CAMELLIA_256_CBC_SHA384 - * MBEDTLS_TLS_DHE_PSK_WITH_CAMELLIA_256_CBC_SHA384 - * MBEDTLS_TLS_DHE_PSK_WITH_CAMELLIA_128_GCM_SHA256 - * MBEDTLS_TLS_DHE_PSK_WITH_CAMELLIA_128_CBC_SHA256 - * MBEDTLS_TLS_ECDHE_PSK_WITH_CAMELLIA_128_CBC_SHA256 - * MBEDTLS_TLS_RSA_WITH_CAMELLIA_256_GCM_SHA384 - * MBEDTLS_TLS_RSA_WITH_CAMELLIA_256_CBC_SHA256 - * MBEDTLS_TLS_RSA_WITH_CAMELLIA_256_CBC_SHA - * MBEDTLS_TLS_RSA_WITH_CAMELLIA_128_GCM_SHA256 - * MBEDTLS_TLS_RSA_WITH_CAMELLIA_128_CBC_SHA256 - * MBEDTLS_TLS_RSA_WITH_CAMELLIA_128_CBC_SHA - * MBEDTLS_TLS_RSA_PSK_WITH_CAMELLIA_256_GCM_SHA384 - * MBEDTLS_TLS_RSA_PSK_WITH_CAMELLIA_256_CBC_SHA384 - * MBEDTLS_TLS_RSA_PSK_WITH_CAMELLIA_128_GCM_SHA256 - * MBEDTLS_TLS_RSA_PSK_WITH_CAMELLIA_128_CBC_SHA256 - * MBEDTLS_TLS_PSK_WITH_CAMELLIA_256_GCM_SHA384 - * MBEDTLS_TLS_PSK_WITH_CAMELLIA_256_CBC_SHA384 - * MBEDTLS_TLS_PSK_WITH_CAMELLIA_128_GCM_SHA256 - * MBEDTLS_TLS_PSK_WITH_CAMELLIA_128_CBC_SHA256 - */ -/*#define MBEDTLS_CAMELLIA_C */ - -/** - * \def MBEDTLS_CCM_C - * - * Enable the Counter with CBC-MAC (CCM) mode for 128-bit block cipher. - * - * Module: library/ccm.c - * - * Requires: MBEDTLS_AES_C or MBEDTLS_CAMELLIA_C - * - * This module enables the AES-CCM ciphersuites, if other requisites are - * enabled as well. - */ -#define MBEDTLS_CCM_C - -/** - * \def MBEDTLS_CERTS_C - * - * Enable the test certificates. - * - * Module: library/certs.c - * Caller: - * - * This module is used for testing (ssl_client/server). - */ -#define MBEDTLS_CERTS_C - -/** - * \def MBEDTLS_CIPHER_C - * - * Enable the generic cipher layer. - * - * Module: library/cipher.c - * Caller: library/ssl_tls.c - * - * Uncomment to enable generic cipher wrappers. - */ -#define MBEDTLS_CIPHER_C - -/** - * \def MBEDTLS_CMAC_C - * - * Enable the CMAC (Cipher-based Message Authentication Code) mode for block - * ciphers. - * - * Module: library/cmac.c - * - * Requires: MBEDTLS_AES_C or MBEDTLS_DES_C - * - */ -#define MBEDTLS_CMAC_C - -/** - * \def MBEDTLS_CTR_DRBG_C - * - * Enable the CTR_DRBG AES-256-based random generator. - * - * Module: library/ctr_drbg.c - * Caller: - * - * Requires: MBEDTLS_AES_C - * - * This module provides the CTR_DRBG AES-256 random number generator. - */ -/*#if !(defined(MBEDTLS_AES_ENCRYPT_ALT) && defined(MBEDTLS_AES_ALT_NO_256)) */ -#define MBEDTLS_CTR_DRBG_C -/*#endif */ - -/** - * \def MBEDTLS_DEBUG_C - * - * Enable the debug functions. - * - * Module: library/debug.c - * Caller: library/ssl_cli.c - * library/ssl_srv.c - * library/ssl_tls.c - * - * This module provides debugging functions. - */ -/*#define MBEDTLS_DEBUG_C */ - -/** - * \def MBEDTLS_DES_C - * - * Enable the DES block cipher. - * - * Module: library/des.c - * Caller: library/pem.c - * library/ssl_tls.c - * - * This module enables the following ciphersuites (if other requisites are - * enabled as well): - * MBEDTLS_TLS_ECDH_ECDSA_WITH_3DES_EDE_CBC_SHA - * MBEDTLS_TLS_ECDH_RSA_WITH_3DES_EDE_CBC_SHA - * MBEDTLS_TLS_ECDHE_ECDSA_WITH_3DES_EDE_CBC_SHA - * MBEDTLS_TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA - * MBEDTLS_TLS_DHE_RSA_WITH_3DES_EDE_CBC_SHA - * MBEDTLS_TLS_ECDHE_PSK_WITH_3DES_EDE_CBC_SHA - * MBEDTLS_TLS_DHE_PSK_WITH_3DES_EDE_CBC_SHA - * MBEDTLS_TLS_RSA_WITH_3DES_EDE_CBC_SHA - * MBEDTLS_TLS_RSA_PSK_WITH_3DES_EDE_CBC_SHA - * MBEDTLS_TLS_PSK_WITH_3DES_EDE_CBC_SHA - * - * PEM_PARSE uses DES/3DES for decrypting encrypted keys. - * - * \warning DES is considered a weak cipher and its use constitutes a - * security risk. We recommend considering stronger ciphers instead. - */ -#if SSSFTR_SW_TESTCOUNTERPART -#define MBEDTLS_DES_C -#endif - -/** - * \def MBEDTLS_DHM_C - * - * Enable the Diffie-Hellman-Merkle module. - * - * Module: library/dhm.c - * Caller: library/ssl_cli.c - * library/ssl_srv.c - * - * This module is used by the following key exchanges: - * DHE-RSA, DHE-PSK - * - * \warning Using DHE constitutes a security risk as it - * is not possible to validate custom DH parameters. - * If possible, it is recommended users should consider - * preferring other methods of key exchange. - * See dhm.h for more details. - * - */ -#define MBEDTLS_DHM_C - -/** - * \def MBEDTLS_ECDH_C - * - * Enable the elliptic curve Diffie-Hellman library. - * - * Module: library/ecdh.c - * Caller: library/ssl_cli.c - * library/ssl_srv.c - * - * This module is used by the following key exchanges: - * ECDHE-ECDSA, ECDHE-RSA, DHE-PSK - * - * Requires: MBEDTLS_ECP_C - */ -#define MBEDTLS_ECDH_C - -/** - * \def MBEDTLS_ECDSA_C - * - * Enable the elliptic curve DSA library. - * - * Module: library/ecdsa.c - * Caller: - * - * This module is used by the following key exchanges: - * ECDHE-ECDSA - * - * Requires: MBEDTLS_ECP_C, MBEDTLS_ASN1_WRITE_C, MBEDTLS_ASN1_PARSE_C - */ -#define MBEDTLS_ECDSA_C - -/** - * \def MBEDTLS_ECJPAKE_C - * - * Enable the elliptic curve J-PAKE library. - * - * \warning This is currently experimental. EC J-PAKE support is based on the - * Thread v1.0.0 specification; incompatible changes to the specification - * might still happen. For this reason, this is disabled by default. - * - * Module: library/ecjpake.c - * Caller: - * - * This module is used by the following key exchanges: - * ECJPAKE - * - * Requires: MBEDTLS_ECP_C, MBEDTLS_MD_C - */ -/*#define MBEDTLS_ECJPAKE_C */ - -/** - * \def MBEDTLS_ECP_C - * - * Enable the elliptic curve over GF(p) library. - * - * Module: library/ecp.c - * Caller: library/ecdh.c - * library/ecdsa.c - * library/ecjpake.c - * - * Requires: MBEDTLS_BIGNUM_C and at least one MBEDTLS_ECP_DP_XXX_ENABLED - */ -#define MBEDTLS_ECP_C - -/** - * \def MBEDTLS_ENTROPY_C - * - * Enable the platform-specific entropy code. - * - * Module: library/entropy.c - * Caller: - * - * Requires: MBEDTLS_SHA512_C or MBEDTLS_SHA256_C - * - * This module provides a generic entropy pool - */ -#define MBEDTLS_ENTROPY_C - -/** - * \def MBEDTLS_ERROR_C - * - * Enable error code to error string conversion. - * - * Module: library/error.c - * Caller: - * - * This module enables mbedtls_strerror(). - */ -#define MBEDTLS_ERROR_C - -/** - * \def MBEDTLS_GCM_C - * - * Enable the Galois/Counter Mode (GCM) for AES. - * - * Module: library/gcm.c - * - * Requires: MBEDTLS_AES_C or MBEDTLS_CAMELLIA_C - * - * This module enables the AES-GCM and CAMELLIA-GCM ciphersuites, if other - * requisites are enabled as well. - */ -#define MBEDTLS_GCM_C - -/** - * \def MBEDTLS_HAVEGE_C - * - * Enable the HAVEGE random generator. - * - * Warning: the HAVEGE random generator is not suitable for virtualized - * environments - * - * Warning: the HAVEGE random generator is dependent on timing and specific - * processor traits. It is therefore not advised to use HAVEGE as - * your applications primary random generator or primary entropy pool - * input. As a secondary input to your entropy pool, it IS able add - * the (limited) extra entropy it provides. - * - * Module: library/havege.c - * Caller: - * - * Requires: MBEDTLS_TIMING_C - * - * Uncomment to enable the HAVEGE random generator. - */ -/*#define MBEDTLS_HAVEGE_C */ - -/** - * \def MBEDTLS_HMAC_DRBG_C - * - * Enable the HMAC_DRBG random generator. - * - * Module: library/hmac_drbg.c - * Caller: - * - * Requires: MBEDTLS_MD_C - * - * Uncomment to enable the HMAC_DRBG random number geerator. - */ -#define MBEDTLS_HMAC_DRBG_C - -/** - * \def MBEDTLS_MD_C - * - * Enable the generic message digest layer. - * - * Module: library/md.c - * Caller: - * - * Uncomment to enable generic message digest wrappers. - */ -#define MBEDTLS_MD_C - -/** - * \def MBEDTLS_MD2_C - * - * Enable the MD2 hash algorithm. - * - * Module: library/md2.c - * Caller: - * - * Uncomment to enable support for (rare) MD2-signed X.509 certs. - * - * \warning MD2 is considered a weak message digest and its use constitutes a - * security risk. If possible, we recommend avoiding dependencies on - * it, and considering stronger message digests instead. - * - */ -/*#define MBEDTLS_MD2_C */ - -/** - * \def MBEDTLS_MD4_C - * - * Enable the MD4 hash algorithm. - * - * Module: library/md4.c - * Caller: - * - * Uncomment to enable support for (rare) MD4-signed X.509 certs. - * - * \warning MD4 is considered a weak message digest and its use constitutes a - * security risk. If possible, we recommend avoiding dependencies on - * it, and considering stronger message digests instead. - * - */ -/*#define MBEDTLS_MD4_C */ - -/** - * \def MBEDTLS_MD5_C - * - * Enable the MD5 hash algorithm. - * - * Module: library/md5.c - * Caller: library/md.c - * library/pem.c - * library/ssl_tls.c - * - * This module is required for SSL/TLS up to version 1.1, and for TLS 1.2 - * depending on the handshake parameters. Further, it is used for checking - * MD5-signed certificates, and for PBKDF1 when decrypting PEM-encoded - * encrypted keys. - * - * \warning MD5 is considered a weak message digest and its use constitutes a - * security risk. If possible, we recommend avoiding dependencies on - * it, and considering stronger message digests instead. - * - */ -#define MBEDTLS_MD5_C - -/** - * \def MBEDTLS_MEMORY_BUFFER_ALLOC_C - * - * Enable the buffer allocator implementation that makes use of a (stack) - * based buffer to 'allocate' dynamic memory. (replaces calloc() and free() - * calls) - * - * Module: library/memory_buffer_alloc.c - * - * Requires: MBEDTLS_PLATFORM_C - * MBEDTLS_PLATFORM_MEMORY (to use it within mbed TLS) - * - * Enable this module to enable the buffer memory allocator. - */ -/*#define MBEDTLS_MEMORY_BUFFER_ALLOC_C */ - -/** - * \def MBEDTLS_NET_C - * - * Enable the TCP and UDP over IPv6/IPv4 networking routines. - * - * \note This module only works on POSIX/Unix (including Linux, BSD and OS X) - * and Windows. For other platforms, you'll want to disable it, and write your - * own networking callbacks to be passed to \c mbedtls_ssl_set_bio(). - * - * Module: library/net_sockets.c - * - * This module provides networking routines. - */ -/*#define MBEDTLS_NET_C */ - -/** - * \def MBEDTLS_OID_C - * - * Enable the OID database. - * - * Module: library/oid.c - * Caller: library/asn1write.c - * library/pkcs5.c - * library/pkparse.c - * library/pkwrite.c - * library/rsa.c - * library/x509.c - * library/x509_create.c - * library/x509_crl.c - * library/x509_crt.c - * library/x509_csr.c - * library/x509write_crt.c - * library/x509write_csr.c - * - * This modules translates between OIDs and internal values. - */ -#define MBEDTLS_OID_C - -/** - * \def MBEDTLS_PADLOCK_C - * - * Enable VIA Padlock support on x86. - * - * Module: library/padlock.c - * Caller: library/aes.c - * - * Requires: MBEDTLS_HAVE_ASM - * - * This modules adds support for the VIA PadLock on x86. - */ -#define MBEDTLS_PADLOCK_C - -/** - * \def MBEDTLS_PEM_PARSE_C - * - * Enable PEM decoding / parsing. - * - * Module: library/pem.c - * Caller: library/dhm.c - * library/pkparse.c - * library/x509_crl.c - * library/x509_crt.c - * library/x509_csr.c - * - * Requires: MBEDTLS_BASE64_C - * - * This modules adds support for decoding / parsing PEM files. - */ -#define MBEDTLS_PEM_PARSE_C - -/** - * \def MBEDTLS_PEM_WRITE_C - * - * Enable PEM encoding / writing. - * - * Module: library/pem.c - * Caller: library/pkwrite.c - * library/x509write_crt.c - * library/x509write_csr.c - * - * Requires: MBEDTLS_BASE64_C - * - * This modules adds support for encoding / writing PEM files. - */ -#define MBEDTLS_PEM_WRITE_C - -/** - * \def MBEDTLS_PK_C - * - * Enable the generic public (asymmetric) key layer. - * - * Module: library/pk.c - * Caller: library/ssl_tls.c - * library/ssl_cli.c - * library/ssl_srv.c - * - * Requires: MBEDTLS_RSA_C or MBEDTLS_ECP_C - * - * Uncomment to enable generic public key wrappers. - */ -#define MBEDTLS_PK_C - -/** - * \def MBEDTLS_PK_PARSE_C - * - * Enable the generic public (asymmetric) key parser. - * - * Module: library/pkparse.c - * Caller: library/x509_crt.c - * library/x509_csr.c - * - * Requires: MBEDTLS_PK_C - * - * Uncomment to enable generic public key parse functions. - */ -#define MBEDTLS_PK_PARSE_C - -/** - * \def MBEDTLS_PK_WRITE_C - * - * Enable the generic public (asymmetric) key writer. - * - * Module: library/pkwrite.c - * Caller: library/x509write.c - * - * Requires: MBEDTLS_PK_C - * - * Uncomment to enable generic public key write functions. - */ -#define MBEDTLS_PK_WRITE_C - -/** - * \def MBEDTLS_PKCS5_C - * - * Enable PKCS#5 functions. - * - * Module: library/pkcs5.c - * - * Requires: MBEDTLS_MD_C - * - * This module adds support for the PKCS#5 functions. - */ -#define MBEDTLS_PKCS5_C - -/** - * \def MBEDTLS_PKCS11_C - * - * Enable wrapper for PKCS#11 smartcard support. - * - * Module: library/pkcs11.c - * Caller: library/pk.c - * - * Requires: MBEDTLS_PK_C - * - * This module enables SSL/TLS PKCS #11 smartcard support. - * Requires the presence of the PKCS#11 helper library (libpkcs11-helper) - */ -/*#define MBEDTLS_PKCS11_C */ - -/** - * \def MBEDTLS_PKCS12_C - * - * Enable PKCS#12 PBE functions. - * Adds algorithms for parsing PKCS#8 encrypted private keys - * - * Module: library/pkcs12.c - * Caller: library/pkparse.c - * - * Requires: MBEDTLS_ASN1_PARSE_C, MBEDTLS_CIPHER_C, MBEDTLS_MD_C - * Can use: MBEDTLS_ARC4_C - * - * This module enables PKCS#12 functions. - */ -#define MBEDTLS_PKCS12_C - -/** - * \def MBEDTLS_PLATFORM_C - * - * Enable the platform abstraction layer that allows you to re-assign - * functions like calloc(), free(), snprintf(), printf(), fprintf(), exit(). - * - * Enabling MBEDTLS_PLATFORM_C enables to use of MBEDTLS_PLATFORM_XXX_ALT - * or MBEDTLS_PLATFORM_XXX_MACRO directives, allowing the functions mentioned - * above to be specified at runtime or compile time respectively. - * - * \note This abstraction layer must be enabled on Windows (including MSYS2) - * as other module rely on it for a fixed snprintf implementation. - * - * Module: library/platform.c - * Caller: Most other .c files - * - * This module enables abstraction of common (libc) functions. - */ -#define MBEDTLS_PLATFORM_C - -/** - * \def MBEDTLS_RIPEMD160_C - * - * Enable the RIPEMD-160 hash algorithm. - * - * Module: library/ripemd160.c - * Caller: library/md.c - * - */ -/*#define MBEDTLS_RIPEMD160_C */ - -/** - * \def MBEDTLS_RSA_C - * - * Enable the RSA public-key cryptosystem. - * - * Module: library/rsa.c - * library/rsa_internal.c - * Caller: library/ssl_cli.c - * library/ssl_srv.c - * library/ssl_tls.c - * library/x509.c - * - * This module is used by the following key exchanges: - * RSA, DHE-RSA, ECDHE-RSA, RSA-PSK - * - * Requires: MBEDTLS_BIGNUM_C, MBEDTLS_OID_C - */ -#define MBEDTLS_RSA_C - -/** - * \def MBEDTLS_SHA1_C - * - * Enable the SHA1 cryptographic hash algorithm. - * - * Module: library/sha1.c - * Caller: library/md.c - * library/ssl_cli.c - * library/ssl_srv.c - * library/ssl_tls.c - * library/x509write_crt.c - * - * This module is required for SSL/TLS up to version 1.1, for TLS 1.2 - * depending on the handshake parameters, and for SHA1-signed certificates. - * - * \warning SHA-1 is considered a weak message digest and its use constitutes - * a security risk. If possible, we recommend avoiding dependencies - * on it, and considering stronger message digests instead. - * - */ -#define MBEDTLS_SHA1_C - -/** - * \def MBEDTLS_SHA256_C - * - * Enable the SHA-224 and SHA-256 cryptographic hash algorithms. - * - * Module: library/sha256.c - * Caller: library/entropy.c - * library/md.c - * library/ssl_cli.c - * library/ssl_srv.c - * library/ssl_tls.c - * - * This module adds support for SHA-224 and SHA-256. - * This module is required for the SSL/TLS 1.2 PRF function. - */ -#define MBEDTLS_SHA256_C - -/** - * \def MBEDTLS_SHA512_C - * - * Enable the SHA-384 and SHA-512 cryptographic hash algorithms. - * - * Module: library/sha512.c - * Caller: library/entropy.c - * library/md.c - * library/ssl_cli.c - * library/ssl_srv.c - * - * This module adds support for SHA-384 and SHA-512. - */ -#if SSSFTR_SW_TESTCOUNTERPART -#define MBEDTLS_SHA512_C -#endif - -#if ( SSS_HAVE_A71CH || SSS_HAVE_A71CH_SIM ) -#undef MBEDTLS_SHA512_C -#endif - -/** - * \def MBEDTLS_SSL_CACHE_C - * - * Enable simple SSL cache implementation. - * - * Module: library/ssl_cache.c - * Caller: - * - * Requires: MBEDTLS_SSL_CACHE_C - */ -#define MBEDTLS_SSL_CACHE_C - -/** - * \def MBEDTLS_SSL_COOKIE_C - * - * Enable basic implementation of DTLS cookies for hello verification. - * - * Module: library/ssl_cookie.c - * Caller: - */ -#define MBEDTLS_SSL_COOKIE_C - -/** - * \def MBEDTLS_SSL_TICKET_C - * - * Enable an implementation of TLS server-side callbacks for session tickets. - * - * Module: library/ssl_ticket.c - * Caller: - * - * Requires: MBEDTLS_CIPHER_C - */ -#define MBEDTLS_SSL_TICKET_C - -/** - * \def MBEDTLS_SSL_CLI_C - * - * Enable the SSL/TLS client code. - * - * Module: library/ssl_cli.c - * Caller: - * - * Requires: MBEDTLS_SSL_TLS_C - * - * This module is required for SSL/TLS client support. - */ -#define MBEDTLS_SSL_CLI_C - -/** - * \def MBEDTLS_SSL_SRV_C - * - * Enable the SSL/TLS server code. - * - * Module: library/ssl_srv.c - * Caller: - * - * Requires: MBEDTLS_SSL_TLS_C - * - * This module is required for SSL/TLS server support. - */ -#define MBEDTLS_SSL_SRV_C - -/** - * \def MBEDTLS_SSL_TLS_C - * - * Enable the generic SSL/TLS code. - * - * Module: library/ssl_tls.c - * Caller: library/ssl_cli.c - * library/ssl_srv.c - * - * Requires: MBEDTLS_CIPHER_C, MBEDTLS_MD_C - * and at least one of the MBEDTLS_SSL_PROTO_XXX defines - * - * This module is required for SSL/TLS. - */ -#define MBEDTLS_SSL_TLS_C - -/** - * \def MBEDTLS_THREADING_C - * - * Enable the threading abstraction layer. - * By default mbed TLS assumes it is used in a non-threaded environment or that - * contexts are not shared between threads. If you do intend to use contexts - * between threads, you will need to enable this layer to prevent race - * conditions. - * - * Module: library/threading.c - * - * This allows different threading implementations (self-implemented or - * provided). - * - * You will have to enable either MBEDTLS_THREADING_ALT or - * MBEDTLS_THREADING_PTHREAD. - * - * Enable this layer to allow use of mutexes within mbed TLS - */ -/*#define MBEDTLS_THREADING_C */ - -/** - * \def MBEDTLS_TIMING_C - * - * Enable the semi-portable timing interface. - * - * \note The provided implementation only works on POSIX/Unix (including Linux, - * BSD and OS X) and Windows. On other platforms, you can either disable that - * module and provide your own implementations of the callbacks needed by - * \c mbedtls_ssl_set_timer_cb() for DTLS, or leave it enabled and provide - * your own implementation of the whole module by setting - * \c MBEDTLS_TIMING_ALT in the current file. - * - * Module: library/timing.c - * Caller: library/havege.c - * - * This module is used by the HAVEGE random number generator. - */ -/*#define MBEDTLS_TIMING_C */ - -/** - * \def MBEDTLS_VERSION_C - * - * Enable run-time version information. - * - * Module: library/version.c - * - * This module provides run-time version information. - */ -#define MBEDTLS_VERSION_C - -/** - * \def MBEDTLS_X509_USE_C - * - * Enable X.509 core for using certificates. - * - * Module: library/x509.c - * Caller: library/x509_crl.c - * library/x509_crt.c - * library/x509_csr.c - * - * Requires: MBEDTLS_ASN1_PARSE_C, MBEDTLS_BIGNUM_C, MBEDTLS_OID_C, - * MBEDTLS_PK_PARSE_C - * - * This module is required for the X.509 parsing modules. - */ -#define MBEDTLS_X509_USE_C - -/** - * \def MBEDTLS_X509_CRT_PARSE_C - * - * Enable X.509 certificate parsing. - * - * Module: library/x509_crt.c - * Caller: library/ssl_cli.c - * library/ssl_srv.c - * library/ssl_tls.c - * - * Requires: MBEDTLS_X509_USE_C - * - * This module is required for X.509 certificate parsing. - */ -#define MBEDTLS_X509_CRT_PARSE_C - -/** - * \def MBEDTLS_X509_CRL_PARSE_C - * - * Enable X.509 CRL parsing. - * - * Module: library/x509_crl.c - * Caller: library/x509_crt.c - * - * Requires: MBEDTLS_X509_USE_C - * - * This module is required for X.509 CRL parsing. - */ -#define MBEDTLS_X509_CRL_PARSE_C - -/** - * \def MBEDTLS_X509_CSR_PARSE_C - * - * Enable X.509 Certificate Signing Request (CSR) parsing. - * - * Module: library/x509_csr.c - * Caller: library/x509_crt_write.c - * - * Requires: MBEDTLS_X509_USE_C - * - * This module is used for reading X.509 certificate request. - */ -#define MBEDTLS_X509_CSR_PARSE_C - -/** - * \def MBEDTLS_X509_CREATE_C - * - * Enable X.509 core for creating certificates. - * - * Module: library/x509_create.c - * - * Requires: MBEDTLS_BIGNUM_C, MBEDTLS_OID_C, MBEDTLS_PK_WRITE_C - * - * This module is the basis for creating X.509 certificates and CSRs. - */ -#define MBEDTLS_X509_CREATE_C - -/** - * \def MBEDTLS_X509_CRT_WRITE_C - * - * Enable creating X.509 certificates. - * - * Module: library/x509_crt_write.c - * - * Requires: MBEDTLS_X509_CREATE_C - * - * This module is required for X.509 certificate creation. - */ -#define MBEDTLS_X509_CRT_WRITE_C - -/** - * \def MBEDTLS_X509_CSR_WRITE_C - * - * Enable creating X.509 Certificate Signing Requests (CSR). - * - * Module: library/x509_csr_write.c - * - * Requires: MBEDTLS_X509_CREATE_C - * - * This module is required for X.509 certificate request writing. - */ -#define MBEDTLS_X509_CSR_WRITE_C - -/** - * \def MBEDTLS_XTEA_C - * - * Enable the XTEA block cipher. - * - * Module: library/xtea.c - * Caller: - */ -/*#define MBEDTLS_XTEA_C */ - -/* \} name SECTION: mbed TLS modules */ - -/** - * \name SECTION: Module configuration options - * - * This section allows for the setting of module specific sizes and - * configuration options. The default values are already present in the - * relevant header files and should suffice for the regular use cases. - * - * Our advice is to enable options and change their values here - * only if you have a good reason and know the consequences. - * - * Please check the respective header file for documentation on these - * parameters (to prevent duplicate documentation). - * \{ - */ - -/* MPI / BIGNUM options */ -/*#define MBEDTLS_MPI_WINDOW_SIZE 6 / **< Maximum windows size used. * / */ -/*#define MBEDTLS_MPI_MAX_SIZE 1024 / **< Maximum number of bytes for usable MPIs. * / */ - -/* CTR_DRBG options */ -/*#define MBEDTLS_CTR_DRBG_ENTROPY_LEN 48 / **< Amount of entropy used per seed by default (48 with SHA-512, 32 with SHA-256) * / */ -/*#define MBEDTLS_CTR_DRBG_RESEED_INTERVAL 10000 / **< Interval before reseed is performed by default * / */ -/*#define MBEDTLS_CTR_DRBG_MAX_INPUT 256 / **< Maximum number of additional input bytes * / */ -/*#define MBEDTLS_CTR_DRBG_MAX_REQUEST 1024 / **< Maximum number of requested bytes per call * / */ -/*#define MBEDTLS_CTR_DRBG_MAX_SEED_INPUT 384 / **< Maximum size of (re)seed buffer * / */ - -/* HMAC_DRBG options */ -/*#define MBEDTLS_HMAC_DRBG_RESEED_INTERVAL 10000 / **< Interval before reseed is performed by default * / */ -/*#define MBEDTLS_HMAC_DRBG_MAX_INPUT 256 / **< Maximum number of additional input bytes * / */ -/*#define MBEDTLS_HMAC_DRBG_MAX_REQUEST 1024 / **< Maximum number of requested bytes per call * / */ -/*#define MBEDTLS_HMAC_DRBG_MAX_SEED_INPUT 384 / **< Maximum size of (re)seed buffer * / */ - -/* ECP options */ -/*#define MBEDTLS_ECP_MAX_BITS 521 / **< Maximum bit size of groups * / */ -/*#define MBEDTLS_ECP_WINDOW_SIZE 6 / **< Maximum window size used * / */ -/*#define MBEDTLS_ECP_FIXED_POINT_OPTIM 1 / **< Enable fixed-point speed-up * / */ - -/* Entropy options */ -/*#define MBEDTLS_ENTROPY_MAX_SOURCES 20 / **< Maximum number of sources supported * / */ -/*#define MBEDTLS_ENTROPY_MAX_GATHER 128 / **< Maximum amount requested from entropy sources * / */ -/*#define MBEDTLS_ENTROPY_MIN_HARDWARE 32 / **< Default minimum number of bytes required for the hardware entropy source mbedtls_hardware_poll() before entropy is released * / */ - -/* Memory buffer allocator options */ -/*#define MBEDTLS_MEMORY_ALIGN_MULTIPLE 4 / **< Align on multiples of this value * / */ - -/* Platform options */ -/*#define MBEDTLS_PLATFORM_STD_MEM_HDR / **< Header to include if MBEDTLS_PLATFORM_NO_STD_FUNCTIONS is defined. Don't define if no header is needed. * / */ -/*#define MBEDTLS_PLATFORM_STD_CALLOC calloc / **< Default allocator to use, can be undefined * / */ -/*#define MBEDTLS_PLATFORM_STD_FREE free / **< Default free to use, can be undefined * / */ -/*#define MBEDTLS_PLATFORM_STD_EXIT exit / **< Default exit to use, can be undefined * / */ -/*#define MBEDTLS_PLATFORM_STD_TIME time / **< Default time to use, can be undefined. MBEDTLS_HAVE_TIME must be enabled * / */ -/*#define MBEDTLS_PLATFORM_STD_FPRINTF fprintf / **< Default fprintf to use, can be undefined * / */ -/*#define MBEDTLS_PLATFORM_STD_PRINTF printf / **< Default printf to use, can be undefined * / */ -/* Note: your snprintf must correctly zero-terminate the buffer! */ -/*#define MBEDTLS_PLATFORM_STD_SNPRINTF snprintf / **< Default snprintf to use, can be undefined * / */ -/*#define MBEDTLS_PLATFORM_STD_EXIT_SUCCESS 0 / **< Default exit value to use, can be undefined * / */ -/*#define MBEDTLS_PLATFORM_STD_EXIT_FAILURE 1 / **< Default exit value to use, can be undefined * / */ -/*#define MBEDTLS_PLATFORM_STD_NV_SEED_READ mbedtls_platform_std_nv_seed_read / **< Default nv_seed_read function to use, can be undefined * / */ -/*#define MBEDTLS_PLATFORM_STD_NV_SEED_WRITE mbedtls_platform_std_nv_seed_write / **< Default nv_seed_write function to use, can be undefined * / */ -/*#define MBEDTLS_PLATFORM_STD_NV_SEED_FILE "seedfile" / **< Seed file to read/write with default implementation * / */ - -/* To Use Function Macros MBEDTLS_PLATFORM_C must be enabled */ -/* MBEDTLS_PLATFORM_XXX_MACRO and MBEDTLS_PLATFORM_XXX_ALT cannot both be defined */ -/*#define MBEDTLS_PLATFORM_CALLOC_MACRO calloc / **< Default allocator macro to use, can be undefined * / */ -/*#define MBEDTLS_PLATFORM_FREE_MACRO free / **< Default free macro to use, can be undefined * / */ -/*#define MBEDTLS_PLATFORM_EXIT_MACRO exit / **< Default exit macro to use, can be undefined * / */ -/*#define MBEDTLS_PLATFORM_TIME_MACRO time / **< Default time macro to use, can be undefined. MBEDTLS_HAVE_TIME must be enabled * / */ -/*#define MBEDTLS_PLATFORM_TIME_TYPE_MACRO time_t / **< Default time macro to use, can be undefined. MBEDTLS_HAVE_TIME must be enabled * / */ -/*#define MBEDTLS_PLATFORM_FPRINTF_MACRO fprintf / **< Default fprintf macro to use, can be undefined * / */ -#define MBEDTLS_PLATFORM_PRINTF_MACRO PRINTF /**< Default printf macro to use, can be undefined */ -/* Note: your snprintf must correctly zero-terminate the buffer! */ -/*#define MBEDTLS_PLATFORM_SNPRINTF_MACRO snprintf / **< Default snprintf macro to use, can be undefined * / */ -/*#define MBEDTLS_PLATFORM_NV_SEED_READ_MACRO mbedtls_platform_std_nv_seed_read / **< Default nv_seed_read function to use, can be undefined * / */ -/*#define MBEDTLS_PLATFORM_NV_SEED_WRITE_MACRO mbedtls_platform_std_nv_seed_write / **< Default nv_seed_write function to use, can be undefined * / */ - -/* SSL Cache options */ -/*#define MBEDTLS_SSL_CACHE_DEFAULT_TIMEOUT 86400 / **< 1 day * / */ -/*#define MBEDTLS_SSL_CACHE_DEFAULT_MAX_ENTRIES 50 / **< Maximum entries in cache * / */ - -/* SSL options */ -/*#define MBEDTLS_SSL_MAX_CONTENT_LEN 16384 / **< Maxium fragment length in bytes, determines the size of each of the two internal I/O buffers * / */ -/*#define MBEDTLS_SSL_DEFAULT_TICKET_LIFETIME 86400 / **< Lifetime of session tickets (if enabled) * / */ -/*#define MBEDTLS_PSK_MAX_LEN 32 / **< Max size of TLS pre-shared keys, in bytes (default 256 bits) * / */ -/*#define MBEDTLS_SSL_COOKIE_TIMEOUT 60 / **< Default expiration delay of DTLS cookies, in seconds if HAVE_TIME, or in number of cookies issued * / */ - -/** - * Complete list of ciphersuites to use, in order of preference. - * - * \warning No dependency checking is done on that field! This option can only - * be used to restrict the set of available ciphersuites. It is your - * responsibility to make sure the needed modules are active. - * - * Use this to save a few hundred bytes of ROM (default ordering of all - * available ciphersuites) and a few to a few hundred bytes of RAM. - * - * The value below is only an example, not the default. - */ -/*#define MBEDTLS_SSL_CIPHERSUITES MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384,MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256 */ - -/* X509 options */ -/*#define MBEDTLS_X509_MAX_INTERMEDIATE_CA 8 / **< Maximum number of intermediate CAs in a verification chain. * / */ -/*#define MBEDTLS_X509_MAX_FILE_PATH_LEN 512 / **< Maximum length of a path/filename string in bytes including the null terminator character ('\0'). * / */ - -/** - * Allow SHA-1 in the default TLS configuration for certificate signing. - * Without this build-time option, SHA-1 support must be activated explicitly - * through mbedtls_ssl_conf_cert_profile. Turning on this option is not - * recommended because of it is possible to generate SHA-1 collisions, however - * this may be safe for legacy infrastructure where additional controls apply. - * - * \warning SHA-1 is considered a weak message digest and its use constitutes - * a security risk. If possible, we recommend avoiding dependencies - * on it, and considering stronger message digests instead. - * - */ -/* #define MBEDTLS_TLS_DEFAULT_ALLOW_SHA1_IN_CERTIFICATES */ - -/** - * Allow SHA-1 in the default TLS configuration for TLS 1.2 handshake - * signature and ciphersuite selection. Without this build-time option, SHA-1 - * support must be activated explicitly through mbedtls_ssl_conf_sig_hashes. - * The use of SHA-1 in TLS <= 1.1 and in HMAC-SHA-1 is always allowed by - * default. At the time of writing, there is no practical attack on the use - * of SHA-1 in handshake signatures, hence this option is turned on by default - * to preserve compatibility with existing peers, but the general - * warning applies nonetheless: - * - * \warning SHA-1 is considered a weak message digest and its use constitutes - * a security risk. If possible, we recommend avoiding dependencies - * on it, and considering stronger message digests instead. - * - */ -#define MBEDTLS_TLS_DEFAULT_ALLOW_SHA1_IN_KEY_EXCHANGE - -/* \} name SECTION: Customisation configuration options */ - -/* Target and application specific configurations */ -/*#define YOTTA_CFG_MBEDTLS_TARGET_CONFIG_FILE "mbedtls/target_config.h" */ - -#if defined( TARGET_LIKE_MBED ) && defined( YOTTA_CFG_MBEDTLS_TARGET_CONFIG_FILE ) -#include YOTTA_CFG_MBEDTLS_TARGET_CONFIG_FILE -#endif - -/* - * Allow user to override any previous default. - * - * Use two macro names for that, as: - * - with yotta the prefix YOTTA_CFG_ is forced - * - without yotta is looks weird to have a YOTTA prefix. - */ -#if defined( YOTTA_CFG_MBEDTLS_USER_CONFIG_FILE ) -#include YOTTA_CFG_MBEDTLS_USER_CONFIG_FILE -#elif defined( MBEDTLS_USER_CONFIG_FILE ) -#include MBEDTLS_USER_CONFIG_FILE -#endif - -#include "mbedtls/check_config.h" - -/* clang-format on */ -#ifndef MBEDTLS_CTR_DRBG_C -/* We need this for mbedTLS sw crypto counterpart */ -#define MBEDTLS_CTR_DRBG_C -#endif - -/* IF We use ALT from the EVKB, anything that is related to - * AES256 would get skipped and because of this TLS Handshake - * would not pass - * - * Disabling this altogether. May be there's a way to use AES256 - * on EVKB with mbedTLS but need to Check. - */ - -#undef MBEDTLS_AES_ALT -#undef MBEDTLS_AES_SETKEY_ENC_ALT -#undef MBEDTLS_AES_SETKEY_DEC_ALT -#undef MBEDTLS_AES_ENCRYPT_ALT -#undef MBEDTLS_AES_DECRYPT_ALT -#undef MBEDTLS_AES_ALT_NO_192 -#undef MBEDTLS_AES_CRYPT_CBC_ALT -#undef MBEDTLS_AES_ALT_NO_256 -#undef MBEDTLS_FREESCALE_DCP_AES - -#endif /* AWS_MBEDTLS_CONFIG_H */ diff --git a/examples/evkbmimxrt1060/test/include/core_mqtt_agent_config.h b/examples/evkbmimxrt1060/test/include/core_mqtt_agent_config.h deleted file mode 100644 index 01d6f84..0000000 --- a/examples/evkbmimxrt1060/test/include/core_mqtt_agent_config.h +++ /dev/null @@ -1,2 +0,0 @@ -/* An empty config file for the CBMC proofs to compile with the default - * definitions of configuration macros. */ diff --git a/examples/evkbmimxrt1060/test/include/core_mqtt_config.h b/examples/evkbmimxrt1060/test/include/core_mqtt_config.h deleted file mode 100644 index 53ddaa8..0000000 --- a/examples/evkbmimxrt1060/test/include/core_mqtt_config.h +++ /dev/null @@ -1,117 +0,0 @@ -/* - * FreeRTOS V202111.00 - * Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - * http://www.FreeRTOS.org - * http://aws.amazon.com/freertos - */ -#ifndef CORE_MQTT_CONFIG_H -#define CORE_MQTT_CONFIG_H - -/**************************************************/ -/******* DO NOT CHANGE the following order ********/ -/**************************************************/ - -/* Include logging header files and define logging macros in the following order: - * 1. Include the header file "logging_levels.h". - * 2. Define the LIBRARY_LOG_NAME and LIBRARY_LOG_LEVEL macros depending on - * the logging configuration for MQTT. - * 3. Include the header file "logging_stack.h", if logging is enabled for MQTT. - */ - -#include "logging_levels.h" - -/* Logging configuration for the MQTT library. */ -#ifndef LIBRARY_LOG_NAME -#define LIBRARY_LOG_NAME "MQTT" -#endif - -#ifndef LIBRARY_LOG_LEVEL -#define LIBRARY_LOG_LEVEL LOG_ERROR -#endif - -#include "logging.h" -/************ End of logging configuration ****************/ - -/** - * @brief The maximum number of MQTT PUBLISH messages that may be pending - * acknowledgement at any time. - * - * QoS 1 and 2 MQTT PUBLISHes require acknowledgment from the server before - * they can be completed. While they are awaiting the acknowledgment, the - * client must maintain information about their state. The value of this - * macro sets the limit on how many simultaneous PUBLISH states an MQTT - * context maintains. - */ -#define MQTT_STATE_ARRAY_MAX_COUNT 10U - -#define MQTT_AGENT_COMMAND_QUEUE_LENGTH ( 25 ) - -#define MQTT_COMMAND_CONTEXTS_POOL_SIZE ( 10 ) - -/** - * @brief The maximum number of subscriptions to track for a single connection. - * - * @note The MQTT agent keeps a record of all existing MQTT subscriptions. - * MQTT_AGENT_MAX_SIMULTANEOUS_SUBSCRIPTIONS sets the maximum number of - * subscriptions records that can be maintained at one time. The higher this - * number is the greater the agent's RAM consumption will be. - */ -#define MQTT_AGENT_MAX_SIMULTANEOUS_SUBSCRIPTIONS ( 10 ) - -/** - * @brief Size of statically allocated buffers for holding subscription filters. - * - * @note Subscription filters are strings such as "/my/topicname/#". These - * strings are limited to a maximum of MQTT_AGENT_MAX_SUBSCRIPTION_FILTER_LENGTH - * characters. The higher this number is the greater the agent's RAM consumption - * will be. - */ -#define MQTT_AGENT_MAX_SUBSCRIPTION_FILTER_LENGTH ( 100 ) - -/** - * @brief Dimensions the buffer used to serialize and deserialize MQTT packets. - * @note Specified in bytes. Must be large enough to hold the maximum - * anticipated MQTT payload. - */ -#define MQTT_AGENT_NETWORK_BUFFER_SIZE ( 5000 ) - -/** - * @brief This is the timeout for the duration on which no data is received - * from the transport interface, after at least a single byte of the MQTT packet has - * been read. - * - * Since the transport interface is set to non-blocking, this is set to a value large enough - * of a delay for a chunk of packet to be sent over the connection. - */ -#define MQTT_RECV_POLLING_TIMEOUT_MS ( 500 ) - -/** - * @brief Maximum wait time in milliseconds for MQTT agent on the input queue. - * If there is no events(commands) on the queue for the period, then MQTT agent - * switches to receive packet from network. - * - * Since the transport interface is non blocking, the queue wait time is set to - * a interval such that agent does not polls busy on the socket. - * - */ -#define MQTT_AGENT_MAX_EVENT_QUEUE_WAIT_TIME ( 50 ) - -#endif /* ifndef CORE_MQTT_CONFIG_H */ diff --git a/examples/evkbmimxrt1060/test/include/core_pkcs11_config.h b/examples/evkbmimxrt1060/test/include/core_pkcs11_config.h deleted file mode 100644 index 692c957..0000000 --- a/examples/evkbmimxrt1060/test/include/core_pkcs11_config.h +++ /dev/null @@ -1,150 +0,0 @@ -/* - * FreeRTOS V1.4.8 - * Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - * http://aws.amazon.com/freertos - * http://www.FreeRTOS.org - */ - -/** - * @file aws_pkcs11_config.h - * @brief PCKS#11 config options. - */ - -#ifndef _AWS_PKCS11_CONFIG_H_ -#define _AWS_PKCS11_CONFIG_H_ - -#include "FreeRTOS.h" - -/**************************************************/ -/******* DO NOT CHANGE the following order ********/ -/**************************************************/ - -/** - * @brief Malloc API used by core_pkcs11.h - */ -#define PKCS11_MALLOC pvPortMalloc - -/** - * @brief Free API used by core_pkcs11.h - */ -#define PKCS11_FREE vPortFree - -/** - * @brief PKCS #11 default user PIN. - * - * The PKCS #11 standard specifies the presence of a user PIN. That feature is - * sensible for applications that have an interactive user interface and memory - * protections. However, since typical microcontroller applications lack one or - * both of those, the user PIN is assumed to be used herein for interoperability - * purposes only, and not as a security feature. - * - * Note: Do not cast this to a pointer! The library calls sizeof to get the length - * of this string. - */ -#define configPKCS11_DEFAULT_USER_PIN "0000" - -/** - * @brief Maximum length (in characters) for a PKCS #11 CKA_LABEL - * attribute. - */ -#define pkcs11configMAX_LABEL_LENGTH 32 - -/** - * @brief Maximum number of token objects that can be stored - * by the PKCS #11 module. - */ -#define pkcs11configMAX_NUM_OBJECTS 6 - - -/** - * @brief Set to 1 if importing device private key via C_CreateObject is supported. 0 if not. - */ -#define pkcs11configIMPORT_PRIVATE_KEYS_SUPPORTED 0 - -/** - * @brief Set to 1 if OTA image verification via PKCS #11 module is supported. - * - * If set to 0, OTA code signing certificate is built in via - * aws_ota_codesigner_certificate.h. - */ -#define pkcs11configOTA_SUPPORTED 1 - -/** - * @brief Set to 1 if PAL supports storage for JITP certificate, - * code verify certificate, and trusted server root certificate. - * - * If set to 0, PAL does not support storage mechanism for these, and - * they are accessed via headers compiled into the code. - */ -#define pkcs11configJITP_CODEVERIFY_ROOT_CERT_SUPPORTED 1 - -/** - * @brief The PKCS #11 label for device private key. - * - * Private key for connection to AWS IoT endpoint. The corresponding - * public key should be registered with the AWS IoT endpoint. - */ -#define pkcs11configLABEL_DEVICE_PRIVATE_KEY_FOR_TLS "sss:F0000000" - -/** - * @brief The PKCS #11 label for device public key. - * - * The public key corresponding to pkcs11configLABEL_DEVICE_PRIVATE_KEY_FOR_TLS. - */ -#define pkcs11configLABEL_DEVICE_PUBLIC_KEY_FOR_TLS "sss:00223345" - -/** - * @brief The PKCS #11 label for the device certificate. - * - * Device certificate corresponding to pkcs11configLABEL_DEVICE_PRIVATE_KEY_FOR_TLS. - */ -#define pkcs11configLABEL_DEVICE_CERTIFICATE_FOR_TLS "sss:F0000001" - -/** - * @brief The PKCS #11 label for the object to be used for code verification. - * - * Used by over-the-air update code to verify an incoming signed image. - */ -#define pkcs11configLABEL_CODE_VERIFICATION_KEY "sss:00223344" - -/** - * @brief The PKCS #11 label for Just-In-Time-Provisioning. - * - * The certificate corresponding to the issuer of the device certificate - * (pkcs11configLABEL_DEVICE_CERTIFICATE_FOR_TLS) when using the JITR or - * JITP flow. - */ -#define pkcs11configLABEL_JITP_CERTIFICATE "sss:20181004" - -/** - * @brief The PKCS #11 label for the AWS Trusted Root Certificate. - * - * @see aws_default_root_certificates.h - */ -#define pkcs11configLABEL_ROOT_CERTIFICATE "sss:20181002" - -#endif /* _AWS_PKCS11_CONFIG_H_ include guard. */ diff --git a/examples/evkbmimxrt1060/test/include/demo_config.h b/examples/evkbmimxrt1060/test/include/demo_config.h deleted file mode 100644 index 6d3327e..0000000 --- a/examples/evkbmimxrt1060/test/include/demo_config.h +++ /dev/null @@ -1,226 +0,0 @@ -/* - * FreeRTOS V202111.00 - * Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - * https://www.FreeRTOS.org - * https://github.com/FreeRTOS - * - */ - -#ifndef DEMO_CONFIG_H -#define DEMO_CONFIG_H - -/* FreeRTOS include. */ -#include "FreeRTOS.h" - -/**************************************************/ -/******* DO NOT CHANGE the following order ********/ -/**************************************************/ - -/* Include logging header files and define logging macros in the following order: - * 1. Include the header file "logging_levels.h". - * 2. Define the LIBRARY_LOG_NAME and LIBRARY_LOG_LEVEL macros depending on - * the logging configuration for DEMO. - * 3. Include the header file "logging_stack.h", if logging is enabled for DEMO. - */ - -#include "logging_levels.h" - -/* Logging configuration for the Demo. */ -#ifndef LIBRARY_LOG_NAME -#define LIBRARY_LOG_NAME "MQTTDemo" -#endif - -#ifndef LIBRARY_LOG_LEVEL -#define LIBRARY_LOG_LEVEL LOG_INFO -#endif - -#include "logging.h" - - -/************ End of logging configuration ****************/ - - -/** - * @brief Server's root CA certificate. - * - * For AWS IoT MQTT broker, this certificate is used to identify the AWS IoT - * server and is publicly available. Refer to the AWS documentation available - * in the link below. - * https://docs.aws.amazon.com/iot/latest/developerguide/server-authentication.html#server-authentication-certs - * - * @note This certificate should be PEM-encoded. - * - * Must include the PEM header and footer: - * "-----BEGIN CERTIFICATE-----\n"\ - * "...base64 data...\n"\ - * "-----END CERTIFICATE-----\n" - * - * - */ -#define democonfigROOT_CA_PEM \ - "-----BEGIN CERTIFICATE-----\n" \ - "MIIDQTCCAimgAwIBAgITBmyfz5m/jAo54vB4ikPmljZbyjANBgkqhkiG9w0BAQsF\n" \ - "ADA5MQswCQYDVQQGEwJVUzEPMA0GA1UEChMGQW1hem9uMRkwFwYDVQQDExBBbWF6\n" \ - "b24gUm9vdCBDQSAxMB4XDTE1MDUyNjAwMDAwMFoXDTM4MDExNzAwMDAwMFowOTEL\n" \ - "MAkGA1UEBhMCVVMxDzANBgNVBAoTBkFtYXpvbjEZMBcGA1UEAxMQQW1hem9uIFJv\n" \ - "b3QgQ0EgMTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALJ4gHHKeNXj\n" \ - "ca9HgFB0fW7Y14h29Jlo91ghYPl0hAEvrAIthtOgQ3pOsqTQNroBvo3bSMgHFzZM\n" \ - "9O6II8c+6zf1tRn4SWiw3te5djgdYZ6k/oI2peVKVuRF4fn9tBb6dNqcmzU5L/qw\n" \ - "IFAGbHrQgLKm+a/sRxmPUDgH3KKHOVj4utWp+UhnMJbulHheb4mjUcAwhmahRWa6\n" \ - "VOujw5H5SNz/0egwLX0tdHA114gk957EWW67c4cX8jJGKLhD+rcdqsq08p8kDi1L\n" \ - "93FcXmn/6pUCyziKrlA4b9v7LWIbxcceVOF34GfID5yHI9Y/QCB/IIDEgEw+OyQm\n" \ - "jgSubJrIqg0CAwEAAaNCMEAwDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMC\n" \ - "AYYwHQYDVR0OBBYEFIQYzIU07LwMlJQuCFmcx7IQTgoIMA0GCSqGSIb3DQEBCwUA\n" \ - "A4IBAQCY8jdaQZChGsV2USggNiMOruYou6r4lK5IpDB/G/wkjUu0yKGX9rbxenDI\n" \ - "U5PMCCjjmCXPI6T53iHTfIUJrU6adTrCC2qJeHZERxhlbI1Bjjt/msv0tadQ1wUs\n" \ - "N+gDS63pYaACbvXy8MWy7Vu33PqUXHeeE6V/Uq2V8viTO96LXFvKWlJbYK8U90vv\n" \ - "o/ufQJVtMVT8QtPHRh8jrdkPSHCa2XV4cdFyQzR1bldZwgJcJmApzyMZFo6IQ6XU\n" \ - "5MsI+yMRQ+hDKXJioaldXgjUkK642M4UwtBV8ob2xJNDd2ZhwLnoQdeXeGADbkpy\n" \ - "rqXRfboQnoZsG4q5WTP468SQvvG5\n" \ - "-----END CERTIFICATE-----\n" \ - "-----BEGIN CERTIFICATE-----\n" \ - "MIIE0zCCA7ugAwIBAgIQGNrRniZ96LtKIVjNzGs7SjANBgkqhkiG9w0BAQUFADCB\n" \ - "yjELMAkGA1UEBhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMR8wHQYDVQQL\n" \ - "ExZWZXJpU2lnbiBUcnVzdCBOZXR3b3JrMTowOAYDVQQLEzEoYykgMjAwNiBWZXJp\n" \ - "U2lnbiwgSW5jLiAtIEZvciBhdXRob3JpemVkIHVzZSBvbmx5MUUwQwYDVQQDEzxW\n" \ - "ZXJpU2lnbiBDbGFzcyAzIFB1YmxpYyBQcmltYXJ5IENlcnRpZmljYXRpb24gQXV0\n" \ - "aG9yaXR5IC0gRzUwHhcNMDYxMTA4MDAwMDAwWhcNMzYwNzE2MjM1OTU5WjCByjEL\n" \ - "MAkGA1UEBhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMR8wHQYDVQQLExZW\n" \ - "ZXJpU2lnbiBUcnVzdCBOZXR3b3JrMTowOAYDVQQLEzEoYykgMjAwNiBWZXJpU2ln\n" \ - "biwgSW5jLiAtIEZvciBhdXRob3JpemVkIHVzZSBvbmx5MUUwQwYDVQQDEzxWZXJp\n" \ - "U2lnbiBDbGFzcyAzIFB1YmxpYyBQcmltYXJ5IENlcnRpZmljYXRpb24gQXV0aG9y\n" \ - "aXR5IC0gRzUwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCvJAgIKXo1\n" \ - "nmAMqudLO07cfLw8RRy7K+D+KQL5VwijZIUVJ/XxrcgxiV0i6CqqpkKzj/i5Vbex\n" \ - "t0uz/o9+B1fs70PbZmIVYc9gDaTY3vjgw2IIPVQT60nKWVSFJuUrjxuf6/WhkcIz\n" \ - "SdhDY2pSS9KP6HBRTdGJaXvHcPaz3BJ023tdS1bTlr8Vd6Gw9KIl8q8ckmcY5fQG\n" \ - "BO+QueQA5N06tRn/Arr0PO7gi+s3i+z016zy9vA9r911kTMZHRxAy3QkGSGT2RT+\n" \ - "rCpSx4/VBEnkjWNHiDxpg8v+R70rfk/Fla4OndTRQ8Bnc+MUCH7lP59zuDMKz10/\n" \ - "NIeWiu5T6CUVAgMBAAGjgbIwga8wDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8E\n" \ - "BAMCAQYwbQYIKwYBBQUHAQwEYTBfoV2gWzBZMFcwVRYJaW1hZ2UvZ2lmMCEwHzAH\n" \ - "BgUrDgMCGgQUj+XTGoasjY5rw8+AatRIGCx7GS4wJRYjaHR0cDovL2xvZ28udmVy\n" \ - "aXNpZ24uY29tL3ZzbG9nby5naWYwHQYDVR0OBBYEFH/TZafC3ey78DAJ80M5+gKv\n" \ - "MzEzMA0GCSqGSIb3DQEBBQUAA4IBAQCTJEowX2LP2BqYLz3q3JktvXf2pXkiOOzE\n" \ - "p6B4Eq1iDkVwZMXnl2YtmAl+X6/WzChl8gGqCBpH3vn5fJJaCGkgDdk+bW48DW7Y\n" \ - "5gaRQBi5+MHt39tBquCWIMnNZBU4gcmU7qKEKQsTb47bDN0lAtukixlE0kF6BWlK\n" \ - "WE9gyn6CagsCqiUXObXbf+eEZSqVir2G3l6BFoMtEMze/aiCKm0oHw0LxOXnGiYZ\n" \ - "4fQRbxC1lfznQgUy286dUV4otp6F01vvpX1FQHKOtw5rDgb7MzVIcbidJ4vEZV8N\n" \ - "hnacRHr2lVz2XTIIM6RUthg/aFzyQkqFOFSDX9HoLPKsEdao7WNq\n" \ - "-----END CERTIFICATE-----\n" - -/** - * @brief An option to disable Server Name Indication. - * - * @note When using a local Mosquitto server setup, SNI needs to be disabled - * for an MQTT broker that only has an IP address but no hostname. However, - * SNI should be enabled whenever possible. - */ -#define democonfigDISABLE_SNI ( pdFALSE ) - -/** - * @brief Configuration that indicates if the demo connection is made to the AWS IoT Core MQTT broker. - * - * If username/password based authentication is used, the demo will use appropriate TLS ALPN and - * SNI configurations as required for the Custom Authentication feature of AWS IoT. - * For more information, refer to the following documentation: - * https://docs.aws.amazon.com/iot/latest/developerguide/custom-auth.html#custom-auth-mqtt - * - * #define democonfigUSE_AWS_IOT_CORE_BROKER ( 1 ) - */ -#define democonfigUSE_AWS_IOT_CORE_BROKER ( 1 ) - -/** - * @brief The username value for authenticating client to the MQTT broker when - * username/password based client authentication is used. - * - * For AWS IoT MQTT broker, refer to the AWS IoT documentation below for - * details regarding client authentication with a username and password. - * https://docs.aws.amazon.com/iot/latest/developerguide/custom-authentication.html - * An authorizer setup needs to be done, as mentioned in the above link, to use - * username/password based client authentication. - * - * #define democonfigCLIENT_USERNAME "...insert here..." - */ - -/** - * @brief The password value for authenticating client to the MQTT broker when - * username/password based client authentication is used. - * - * For AWS IoT MQTT broker, refer to the AWS IoT documentation below for - * details regarding client authentication with a username and password. - * https://docs.aws.amazon.com/iot/latest/developerguide/custom-authentication.html - * An authorizer setup needs to be done, as mentioned in the above link, to use - * username/password based client authentication. - * - * #define democonfigCLIENT_PASSWORD "...insert here..." - */ - -/** - * @brief The name of the operating system that the application is running on. - * The current value is given as an example. Please update for your specific - * operating system. - */ -#define democonfigOS_NAME "FreeRTOS" - -/** - * @brief The version of the operating system that the application is running - * on. The current value is given as an example. Please update for your specific - * operating system version. - */ -#define democonfigOS_VERSION tskKERNEL_VERSION_NUMBER - -/** - * @brief The name of the hardware platform the application is running on. The - * current value is given as an example. Please update for your specific - * hardware platform. - */ -#define democonfigHARDWARE_PLATFORM_NAME "NXPRT1060" - -/** - * @brief The name of the MQTT library used and its version, following an "@" - * symbol. - */ -#include "core_mqtt.h" /* Include coreMQTT header for MQTT_LIBRARY_VERSION macro. */ -#define democonfigMQTT_LIB "core-mqtt@"MQTT_LIBRARY_VERSION - -/** - * @brief The MQTT metrics string expected by AWS IoT. - */ -#define AWS_IOT_METRICS_STRING \ - "?SDK=" democonfigOS_NAME "&Version=" democonfigOS_VERSION \ - "&Platform=" democonfigHARDWARE_PLATFORM_NAME "&MQTTLib=" democonfigMQTT_LIB - -/** - * @brief Set the stack size of the main demo task. - * - * In the Windows port, this stack only holds a structure. The actual - * stack is created by an operating system thread. - */ -#define democonfigDEMO_STACKSIZE configMINIMAL_STACK_SIZE - -/** - * @brief Set the stack size of the main demo task. - * - * In the Windows port, this stack only holds a structure. The actual - * stack is created by an operating system thread. - */ -#define democonfigDEMO_TASK_PRIORITY ( tskIDLE_PRIORITY + 1 ) - -#endif /* DEMO_CONFIG_H */ diff --git a/examples/evkbmimxrt1060/test/include/freertos_tasks_c_additions.h b/examples/evkbmimxrt1060/test/include/freertos_tasks_c_additions.h deleted file mode 100644 index 59f84da..0000000 --- a/examples/evkbmimxrt1060/test/include/freertos_tasks_c_additions.h +++ /dev/null @@ -1,126 +0,0 @@ -/* - * Copyright 2017-2019 NXP - * All rights reserved. - * - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -/* freertos_tasks_c_additions.h Rev. 1.3 */ -#ifndef FREERTOS_TASKS_C_ADDITIONS_H -#define FREERTOS_TASKS_C_ADDITIONS_H - -#include - -#if ( configUSE_TRACE_FACILITY == 0 ) -#error "configUSE_TRACE_FACILITY must be enabled" -#endif - -#define FREERTOS_DEBUG_CONFIG_MAJOR_VERSION 1 -#define FREERTOS_DEBUG_CONFIG_MINOR_VERSION 3 - -/* NOTE!! - * Default to a FreeRTOS version which didn't include these macros. FreeRTOS - * v7.5.3 is used here. - */ -#ifndef tskKERNEL_VERSION_BUILD -#define tskKERNEL_VERSION_BUILD 3 -#endif -#ifndef tskKERNEL_VERSION_MINOR -#define tskKERNEL_VERSION_MINOR 5 -#endif -#ifndef tskKERNEL_VERSION_MAJOR -#define tskKERNEL_VERSION_MAJOR 7 -#endif - -/* NOTE!! - * The configFRTOS_MEMORY_SCHEME macro describes the heap scheme using a value - * 1 - 5 which corresponds to the following schemes: - * - * heap_1 - the very simplest, does not permit memory to be freed - * heap_2 - permits memory to be freed, but not does coalescence adjacent free - * blocks. - * heap_3 - simply wraps the standard malloc() and free() for thread safety - * heap_4 - coalesces adjacent free blocks to avoid fragmentation. Includes - * absolute address placement option - * heap_5 - as per heap_4, with the ability to span the heap across - * multiple nonOadjacent memory areas - */ -#ifndef configFRTOS_MEMORY_SCHEME -#define configFRTOS_MEMORY_SCHEME 3 /* thread safe malloc */ -#endif - -#if ( ( configFRTOS_MEMORY_SCHEME > 5 ) || ( configFRTOS_MEMORY_SCHEME < 1 ) ) -#error "Invalid configFRTOS_MEMORY_SCHEME setting!" -#endif - -/* *INDENT-OFF* */ -#ifdef __cplusplus -extern "C" { -#endif -/* *INDENT-ON* */ - -extern const uint8_t FreeRTOSDebugConfig[]; - -/* NOTES!! - * IAR documentation is confusing. It suggests the data must be statically - * linked, and the #pragma placed immediately before the symbol definition. - * The IAR supplied examples violate both "rules", so this is a best guess. - */ - -#if ( tskKERNEL_VERSION_MAJOR >= 10 ) && ( tskKERNEL_VERSION_MINOR >= 2 ) -#if defined( __GNUC__ ) -char * const portArch_Name __attribute__( ( section( ".rodata" ) ) ) = portARCH_NAME; -#elif defined( __CC_ARM ) || defined( __ARMCC_VERSION ) -char * const portArch_Name __attribute__( ( used ) ) = portARCH_NAME; -#elif defined( __IAR_SYSTEMS_ICC__ ) -char * const portArch_Name = portARCH_NAME; -#pragma required=portArch_Name -#endif -#else -char * const portArch_Name = NULL; -#endif // tskKERNEL_VERSION_MAJOR - -#if defined( __GNUC__ ) -const uint8_t FreeRTOSDebugConfig[] __attribute__( ( section( ".rodata" ) ) ) = -#elif defined( __CC_ARM ) || defined( __ARMCC_VERSION ) -const uint8_t FreeRTOSDebugConfig[] __attribute__( ( used ) ) = -#elif defined( __IAR_SYSTEMS_ICC__ ) -#pragma required=FreeRTOSDebugConfig -const uint8_t FreeRTOSDebugConfig[] = -#endif -{ - FREERTOS_DEBUG_CONFIG_MAJOR_VERSION, - FREERTOS_DEBUG_CONFIG_MINOR_VERSION, - tskKERNEL_VERSION_MAJOR, - tskKERNEL_VERSION_MINOR, - tskKERNEL_VERSION_BUILD, - configFRTOS_MEMORY_SCHEME, - offsetof( struct tskTaskControlBlock, pxTopOfStack ), -#if ( tskKERNEL_VERSION_MAJOR > 8 ) - offsetof( struct tskTaskControlBlock, xStateListItem ), -#else - offsetof( struct tskTaskControlBlock, xGenericListItem ), -#endif - offsetof( struct tskTaskControlBlock, xEventListItem ), - offsetof( struct tskTaskControlBlock, pxStack ), - offsetof( struct tskTaskControlBlock, pcTaskName ), - offsetof( struct tskTaskControlBlock, uxTCBNumber ), - offsetof( struct tskTaskControlBlock, uxTaskNumber ), - configMAX_TASK_NAME_LEN, - configMAX_PRIORITIES, - configENABLE_MPU, - configENABLE_FPU, - configENABLE_TRUSTZONE, - configRUN_FREERTOS_SECURE_ONLY, - 0, /* 32-bit align */ - 0, 0, 0, 0 /* padding */ -} - -/* *INDENT-OFF* */ -#ifdef __cplusplus -} -#endif -/* *INDENT-ON* */ - -#endif // FREERTOS_TASKS_C_ADDITIONS_H diff --git a/examples/evkbmimxrt1060/test/include/fsl_sss_ftr.h b/examples/evkbmimxrt1060/test/include/fsl_sss_ftr.h deleted file mode 100644 index eb8a23e..0000000 --- a/examples/evkbmimxrt1060/test/include/fsl_sss_ftr.h +++ /dev/null @@ -1,716 +0,0 @@ -/* - * - * Copyright 2018-2020 NXP - * SPDX-License-Identifier: Apache-2.0 - */ - -#ifndef SSS_APIS_INC_FSL_SSS_FTR_H_ -#define SSS_APIS_INC_FSL_SSS_FTR_H_ - -/* ************************************************************************** */ -/* Defines */ -/* ************************************************************************** */ - -/* clang-format off */ - - -/* # CMake Features : Start */ - - -/** Applet : The Secure Element Applet - * - * You can compile host library for different Applets listed below. - * Please note, some of these Applets may be for NXP Internal use only. - */ - -/** Compiling without any Applet Support */ -#define SSS_HAVE_APPLET_NONE 0 - -/** A71CH (ECC) */ -#define SSS_HAVE_APPLET_A71CH 0 - -/** A71CL (RSA) */ -#define SSS_HAVE_APPLET_A71CL 0 - -/** Similar to A71CH */ -#define SSS_HAVE_APPLET_A71CH_SIM 0 - -/** SE050 Type A (ECC) */ -#define SSS_HAVE_APPLET_SE05X_A 0 - -/** SE050 Type B (RSA) */ -#define SSS_HAVE_APPLET_SE05X_B 0 - -/** SE050 (Super set of A + B) */ -#define SSS_HAVE_APPLET_SE05X_C 1 - -/** SE050 (Similar to A71CL) */ -#define SSS_HAVE_APPLET_SE05X_L 0 - -/** SE051UWB (Similar to SE05x) */ -#define SSS_HAVE_APPLET_SE051_UWB 0 - -/** AUTH */ -#define SSS_HAVE_APPLET_AUTH 0 - -/** NXP Internal testing Applet */ -#define SSS_HAVE_APPLET_LOOPBACK 0 - -#if ( ( 0 \ - + SSS_HAVE_APPLET_NONE \ - + SSS_HAVE_APPLET_A71CH \ - + SSS_HAVE_APPLET_A71CL \ - + SSS_HAVE_APPLET_A71CH_SIM \ - + SSS_HAVE_APPLET_SE05X_A \ - + SSS_HAVE_APPLET_SE05X_B \ - + SSS_HAVE_APPLET_SE05X_C \ - + SSS_HAVE_APPLET_SE05X_L \ - + SSS_HAVE_APPLET_SE051_UWB \ - + SSS_HAVE_APPLET_AUTH \ - + SSS_HAVE_APPLET_LOOPBACK \ - ) > 1 ) -#error "Enable only one of 'Applet'" -#endif /* if ( ( 0 + SSS_HAVE_APPLET_NONE + SSS_HAVE_APPLET_A71CH + SSS_HAVE_APPLET_A71CL + SSS_HAVE_APPLET_A71CH_SIM + SSS_HAVE_APPLET_SE05X_A + SSS_HAVE_APPLET_SE05X_B + SSS_HAVE_APPLET_SE05X_C + SSS_HAVE_APPLET_SE05X_L + SSS_HAVE_APPLET_SE051_UWB + SSS_HAVE_APPLET_AUTH + SSS_HAVE_APPLET_LOOPBACK ) > 1 ) */ - - -#if ( ( 0 \ - + SSS_HAVE_APPLET_NONE \ - + SSS_HAVE_APPLET_A71CH \ - + SSS_HAVE_APPLET_A71CL \ - + SSS_HAVE_APPLET_A71CH_SIM \ - + SSS_HAVE_APPLET_SE05X_A \ - + SSS_HAVE_APPLET_SE05X_B \ - + SSS_HAVE_APPLET_SE05X_C \ - + SSS_HAVE_APPLET_SE05X_L \ - + SSS_HAVE_APPLET_SE051_UWB \ - + SSS_HAVE_APPLET_AUTH \ - + SSS_HAVE_APPLET_LOOPBACK \ - ) == 0 ) -#error "Enable at-least one of 'Applet'" -#endif /* if ( ( 0 + SSS_HAVE_APPLET_NONE + SSS_HAVE_APPLET_A71CH + SSS_HAVE_APPLET_A71CL + SSS_HAVE_APPLET_A71CH_SIM + SSS_HAVE_APPLET_SE05X_A + SSS_HAVE_APPLET_SE05X_B + SSS_HAVE_APPLET_SE05X_C + SSS_HAVE_APPLET_SE05X_L + SSS_HAVE_APPLET_SE051_UWB + SSS_HAVE_APPLET_AUTH + SSS_HAVE_APPLET_LOOPBACK ) == 0 ) */ - - - -/** SE05X_Ver : SE05X Applet version. - * - * Selection of Applet version 03_XX enables SE050 features. - * Selection of Applet version 06_00 enables SE051 features. - * - */ - -/** SE050 */ -#define SSS_HAVE_SE05X_VER_03_XX 1 - -/** SE051 */ -#define SSS_HAVE_SE05X_VER_06_00 0 - -#if ( ( 0 \ - + SSS_HAVE_SE05X_VER_03_XX \ - + SSS_HAVE_SE05X_VER_06_00 \ - ) > 1 ) -#error "Enable only one of 'SE05X_Ver'" -#endif - - -#if ( ( 0 \ - + SSS_HAVE_SE05X_VER_03_XX \ - + SSS_HAVE_SE05X_VER_06_00 \ - ) == 0 ) -#error "Enable at-least one of 'SE05X_Ver'" -#endif - - - -/** HostCrypto : Counterpart Crypto on Host - * - * What is being used as a cryptographic library on the host. - * As of now only OpenSSL / mbedTLS is supported - */ - -/** Use mbedTLS as host crypto */ -#define SSS_HAVE_HOSTCRYPTO_MBEDTLS 1 - -/** Use mbed-crypto as host crypto - * Required for ARM-PSA / TF-M */ -#define SSS_HAVE_HOSTCRYPTO_MBEDCRYPTO 0 - -/** Use OpenSSL as host crypto */ -#define SSS_HAVE_HOSTCRYPTO_OPENSSL 0 - -/** User Implementation of Host Crypto - * e.g. Files at ``sss/src/user/crypto`` have low level AES/CMAC primitives. - * The files at ``sss/src/user`` use those primitives. - * This becomes an example for users with their own AES Implementation - * This then becomes integration without mbedTLS/OpenSSL for SCP03 / AESKey. - * - * .. note:: ECKey abstraction is not implemented/available yet. */ -#define SSS_HAVE_HOSTCRYPTO_USER 0 - -/** NO Host Crypto - * Note, this is unsecure and only provided for experimentation - * on platforms that do not have an mbedTLS PORT - * Many :ref:`sssftr-control` have to be disabled to have a valid build. */ -#define SSS_HAVE_HOSTCRYPTO_NONE 0 - -#if ( ( 0 \ - + SSS_HAVE_HOSTCRYPTO_MBEDTLS \ - + SSS_HAVE_HOSTCRYPTO_MBEDCRYPTO \ - + SSS_HAVE_HOSTCRYPTO_OPENSSL \ - + SSS_HAVE_HOSTCRYPTO_USER \ - + SSS_HAVE_HOSTCRYPTO_NONE \ - ) > 1 ) -#error "Enable only one of 'HostCrypto'" -#endif - - -#if ( ( 0 \ - + SSS_HAVE_HOSTCRYPTO_MBEDTLS \ - + SSS_HAVE_HOSTCRYPTO_MBEDCRYPTO \ - + SSS_HAVE_HOSTCRYPTO_OPENSSL \ - + SSS_HAVE_HOSTCRYPTO_USER \ - + SSS_HAVE_HOSTCRYPTO_NONE \ - ) == 0 ) -#error "Enable at-least one of 'HostCrypto'" -#endif - - - -/** mbedTLS_ALT : ALT Engine implementation for mbedTLS - * - * When set to None, mbedTLS would not use ALT Implementation to connect to / use Secure Element. - * This needs to be set to SSS for Cloud Demos over SSS APIs - */ - -/** Use SSS Layer ALT implementation */ -#define SSS_HAVE_MBEDTLS_ALT_SSS 1 - -/** Legacy implementation */ -#define SSS_HAVE_MBEDTLS_ALT_A71CH 0 - -/** Not using any mbedTLS_ALT - * - * When this is selected, cloud demos can not work with mbedTLS */ -#define SSS_HAVE_MBEDTLS_ALT_NONE 0 - -#if ( ( 0 \ - + SSS_HAVE_MBEDTLS_ALT_SSS \ - + SSS_HAVE_MBEDTLS_ALT_A71CH \ - + SSS_HAVE_MBEDTLS_ALT_NONE \ - ) > 1 ) -#error "Enable only one of 'mbedTLS_ALT'" -#endif - - -#if ( ( 0 \ - + SSS_HAVE_MBEDTLS_ALT_SSS \ - + SSS_HAVE_MBEDTLS_ALT_A71CH \ - + SSS_HAVE_MBEDTLS_ALT_NONE \ - ) == 0 ) -#error "Enable at-least one of 'mbedTLS_ALT'" -#endif - - - -/** SCP : Secure Channel Protocol - * - * In case we enable secure channel to Secure Element, which interface to be used. - */ - -/** */ -#define SSS_HAVE_SCP_NONE 0 - -/** Use SSS Layer for SCP. Used for SE050 family. */ -#define SSS_HAVE_SCP_SCP03_SSS 1 - -/** Use Host Crypto Layer for SCP03. Legacy implementation. Used for older demos of A71CH Family. */ -#define SSS_HAVE_SCP_SCP03_HOSTCRYPTO 0 - -#if ( ( 0 \ - + SSS_HAVE_SCP_NONE \ - + SSS_HAVE_SCP_SCP03_SSS \ - + SSS_HAVE_SCP_SCP03_HOSTCRYPTO \ - ) > 1 ) -#error "Enable only one of 'SCP'" -#endif - - -#if ( ( 0 \ - + SSS_HAVE_SCP_NONE \ - + SSS_HAVE_SCP_SCP03_SSS \ - + SSS_HAVE_SCP_SCP03_HOSTCRYPTO \ - ) == 0 ) -#error "Enable at-least one of 'SCP'" -#endif - - - -/** FIPS : Enable or disable FIPS - * - * This selection mostly impacts tests, and generally not the actual Middleware - */ - -/** NO FIPS */ -#define SSS_HAVE_FIPS_NONE 1 - -/** SE050 IC FIPS */ -#define SSS_HAVE_FIPS_SE050 0 - -/** FIPS 140-2 */ -#define SSS_HAVE_FIPS_140_2 0 - -/** FIPS 140-3 */ -#define SSS_HAVE_FIPS_140_3 0 - -#if ( ( 0 \ - + SSS_HAVE_FIPS_NONE \ - + SSS_HAVE_FIPS_SE050 \ - + SSS_HAVE_FIPS_140_2 \ - + SSS_HAVE_FIPS_140_3 \ - ) > 1 ) -#error "Enable only one of 'FIPS'" -#endif - - -#if ( ( 0 \ - + SSS_HAVE_FIPS_NONE \ - + SSS_HAVE_FIPS_SE050 \ - + SSS_HAVE_FIPS_140_2 \ - + SSS_HAVE_FIPS_140_3 \ - ) == 0 ) -#error "Enable at-least one of 'FIPS'" -#endif - - - -/** SBL : Enable/Disable SBL Bootable support - * - * This option is to enable/disable boot from SBL by switching linker address - */ - -/** Not SBL bootable */ -#define SSS_HAVE_SBL_NONE 1 - -/** SE050 based LPC55S SBL bootable */ -#define SSS_HAVE_SBL_SBL_LPC55S 0 - -#if ( ( 0 \ - + SSS_HAVE_SBL_NONE \ - + SSS_HAVE_SBL_SBL_LPC55S \ - ) > 1 ) -#error "Enable only one of 'SBL'" -#endif - - -#if ( ( 0 \ - + SSS_HAVE_SBL_NONE \ - + SSS_HAVE_SBL_SBL_LPC55S \ - ) == 0 ) -#error "Enable at-least one of 'SBL'" -#endif - - - -/** SE05X_Auth : SE050 Authentication - * - * This settings is used by examples to connect using various options - * to authenticate with the Applet. - * The SE05X_Auth options can be changed for KSDK Demos and Examples. - * To change SE05X_Auth option follow below steps. - * Set flag ``SSS_HAVE_SCP_SCP03_SSS`` to 1 and Reset flag ``SSS_HAVE_SCP_NONE`` to 0. - * To change SE05X_Auth option other than ``None`` and ``PlatfSCP03``, - * execute se05x_Delete_and_test_provision.exe in order to provision the Authentication Key. - * To change SE05X_Auth option to ``ECKey`` or ``ECKey_PlatfSCP03``, - * Set additional flag ``SSS_HAVE_HOSTCRYPTO_ANY`` to 1. - */ - -/** Use the default session (i.e. session less) login */ -#define SSS_HAVE_SE05X_AUTH_NONE 1 - -/** Do User Authentication with UserID */ -#define SSS_HAVE_SE05X_AUTH_USERID 0 - -/** Use Platform SCP for connection to SE */ -#define SSS_HAVE_SE05X_AUTH_PLATFSCP03 0 - -/** Do User Authentication with AES Key - * Earlier this was called AppletSCP03 */ -#define SSS_HAVE_SE05X_AUTH_AESKEY 0 - -/** Do User Authentication with EC Key - * Earlier this was called FastSCP */ -#define SSS_HAVE_SE05X_AUTH_ECKEY 0 - -/** UserID and PlatfSCP03 */ -#define SSS_HAVE_SE05X_AUTH_USERID_PLATFSCP03 0 - -/** AESKey and PlatfSCP03 */ -#define SSS_HAVE_SE05X_AUTH_AESKEY_PLATFSCP03 0 - -/** ECKey and PlatfSCP03 */ -#define SSS_HAVE_SE05X_AUTH_ECKEY_PLATFSCP03 0 - -#if ( ( 0 \ - + SSS_HAVE_SE05X_AUTH_NONE \ - + SSS_HAVE_SE05X_AUTH_USERID \ - + SSS_HAVE_SE05X_AUTH_PLATFSCP03 \ - + SSS_HAVE_SE05X_AUTH_AESKEY \ - + SSS_HAVE_SE05X_AUTH_ECKEY \ - + SSS_HAVE_SE05X_AUTH_USERID_PLATFSCP03 \ - + SSS_HAVE_SE05X_AUTH_AESKEY_PLATFSCP03 \ - + SSS_HAVE_SE05X_AUTH_ECKEY_PLATFSCP03 \ - ) > 1 ) -#error "Enable only one of 'SE05X_Auth'" -#endif /* if ( ( 0 + SSS_HAVE_SE05X_AUTH_NONE + SSS_HAVE_SE05X_AUTH_USERID + SSS_HAVE_SE05X_AUTH_PLATFSCP03 + SSS_HAVE_SE05X_AUTH_AESKEY + SSS_HAVE_SE05X_AUTH_ECKEY + SSS_HAVE_SE05X_AUTH_USERID_PLATFSCP03 + SSS_HAVE_SE05X_AUTH_AESKEY_PLATFSCP03 + SSS_HAVE_SE05X_AUTH_ECKEY_PLATFSCP03 ) > 1 ) */ - - -#if ( ( 0 \ - + SSS_HAVE_SE05X_AUTH_NONE \ - + SSS_HAVE_SE05X_AUTH_USERID \ - + SSS_HAVE_SE05X_AUTH_PLATFSCP03 \ - + SSS_HAVE_SE05X_AUTH_AESKEY \ - + SSS_HAVE_SE05X_AUTH_ECKEY \ - + SSS_HAVE_SE05X_AUTH_USERID_PLATFSCP03 \ - + SSS_HAVE_SE05X_AUTH_AESKEY_PLATFSCP03 \ - + SSS_HAVE_SE05X_AUTH_ECKEY_PLATFSCP03 \ - ) == 0 ) -#error "Enable at-least one of 'SE05X_Auth'" -#endif /* if ( ( 0 + SSS_HAVE_SE05X_AUTH_NONE + SSS_HAVE_SE05X_AUTH_USERID + SSS_HAVE_SE05X_AUTH_PLATFSCP03 + SSS_HAVE_SE05X_AUTH_AESKEY + SSS_HAVE_SE05X_AUTH_ECKEY + SSS_HAVE_SE05X_AUTH_USERID_PLATFSCP03 + SSS_HAVE_SE05X_AUTH_AESKEY_PLATFSCP03 + SSS_HAVE_SE05X_AUTH_ECKEY_PLATFSCP03 ) == 0 ) */ - - - -/** A71CH_AUTH : A71CH Authentication - * - * This settings is used by SSS-API based examples to connect using either plain or authenticated to the A71CH. - */ - -/** Plain communication, not authenticated or encrypted */ -#define SSS_HAVE_A71CH_AUTH_NONE 1 - -/** SCP03 enabled */ -#define SSS_HAVE_A71CH_AUTH_SCP03 0 - -#if ( ( 0 \ - + SSS_HAVE_A71CH_AUTH_NONE \ - + SSS_HAVE_A71CH_AUTH_SCP03 \ - ) > 1 ) -#error "Enable only one of 'A71CH_AUTH'" -#endif - - -#if ( ( 0 \ - + SSS_HAVE_A71CH_AUTH_NONE \ - + SSS_HAVE_A71CH_AUTH_SCP03 \ - ) == 0 ) -#error "Enable at-least one of 'A71CH_AUTH'" -#endif - - -/* ====================================================================== * -* == Feature selection/values ========================================== * -* ====================================================================== */ - - -/** SE05X Secure Element : Symmetric AES */ -#define SSSFTR_SE05X_AES 1 - -/** SE05X Secure Element : Elliptic Curve Cryptography */ -#define SSSFTR_SE05X_ECC 1 - -/** SE05X Secure Element : RSA */ -#define SSSFTR_SE05X_RSA 1 - -/** SE05X Secure Element : KEY operations : SET Key */ -#define SSSFTR_SE05X_KEY_SET 1 - -/** SE05X Secure Element : KEY operations : GET Key */ -#define SSSFTR_SE05X_KEY_GET 1 - -/** SE05X Secure Element : Authenticate via ECKey */ -#define SSSFTR_SE05X_AuthECKey 1 - -/** SE05X Secure Element : Allow creation of user/authenticated session. - * - * If the intended deployment only uses Platform SCP - * Or it is a pure session less integration, this can - * save some code size. */ -#define SSSFTR_SE05X_AuthSession 1 - -/** SE05X Secure Element : Allow creation/deletion of Crypto Objects - * - * If disabled, new Crytpo Objects are neither created and - * old/existing Crypto Objects are not deleted. - * It is assumed that during provisioning phase, the required - * Crypto Objects are pre-created or they are never going to - * be needed. */ -#define SSSFTR_SE05X_CREATE_DELETE_CRYPTOOBJ 1 - -/** Software : Symmetric AES */ -#define SSSFTR_SW_AES 1 - -/** Software : Elliptic Curve Cryptography */ -#define SSSFTR_SW_ECC 1 - -/** Software : RSA */ -#define SSSFTR_SW_RSA 1 - -/** Software : KEY operations : SET Key */ -#define SSSFTR_SW_KEY_SET 1 - -/** Software : KEY operations : GET Key */ -#define SSSFTR_SW_KEY_GET 1 - -/** Software : Used as a test counterpart - * - * e.g. Major part of the mebdTLS SSS layer is purely used for - * testing of Secure Element implementation, and can be avoided - * fully during many production scenarios. */ -#define SSSFTR_SW_TESTCOUNTERPART 0 - -/* ====================================================================== * -* == Computed Options ================================================== * -* ====================================================================== */ - -/** Symmetric AES */ -#define SSSFTR_AES ( SSSFTR_SE05X_AES + SSSFTR_SW_AES ) -/** Elliptic Curve Cryptography */ -#define SSSFTR_ECC ( SSSFTR_SE05X_ECC + SSSFTR_SW_ECC ) -/** RSA */ -#define SSSFTR_RSA ( SSSFTR_SE05X_RSA + SSSFTR_SW_RSA ) -/** KEY operations : SET Key */ -#define SSSFTR_KEY_SET ( SSSFTR_SE05X_KEY_SET + SSSFTR_SW_KEY_SET ) -/** KEY operations : GET Key */ -#define SSSFTR_KEY_GET ( SSSFTR_SE05X_KEY_GET + SSSFTR_SW_KEY_GET ) -/** KEY operations */ -#define SSSFTR_KEY ( SSSFTR_KEY_SET + SSSFTR_KEY_GET ) -/** KEY operations */ -#define SSSFTR_SE05X_KEY ( SSSFTR_SE05X_KEY_SET + SSSFTR_SE05X_KEY_GET ) -/** KEY operations */ -#define SSSFTR_SW_KEY ( SSSFTR_SW_KEY_SET + SSSFTR_SW_KEY_GET ) - - -#define SSS_HAVE_APPLET \ - ( SSS_HAVE_APPLET_A71CH | SSS_HAVE_APPLET_A71CL | SSS_HAVE_APPLET_A71CH_SIM | SSS_HAVE_APPLET_SE05X_A | SSS_HAVE_APPLET_SE05X_B | SSS_HAVE_APPLET_SE05X_C | SSS_HAVE_APPLET_SE05X_L | SSS_HAVE_APPLET_SE051_UWB | SSS_HAVE_APPLET_AUTH | SSS_HAVE_APPLET_LOOPBACK ) - -#define SSS_HAVE_APPLET_SE05X_IOT \ - ( SSS_HAVE_APPLET_SE05X_A | SSS_HAVE_APPLET_SE05X_B | SSS_HAVE_APPLET_SE05X_C | SSS_HAVE_APPLET_SE051_UWB | SSS_HAVE_APPLET_AUTH ) - -#define SSS_HAVE_MBEDTLS_ALT \ - ( SSS_HAVE_MBEDTLS_ALT_SSS | SSS_HAVE_MBEDTLS_ALT_A71CH ) - -#define SSS_HAVE_HOSTCRYPTO_ANY \ - ( SSS_HAVE_HOSTCRYPTO_MBEDTLS | SSS_HAVE_HOSTCRYPTO_MBEDCRYPTO | SSS_HAVE_HOSTCRYPTO_OPENSSL | SSS_HAVE_HOSTCRYPTO_USER ) - -#define SSS_HAVE_FIPS \ - ( SSS_HAVE_FIPS_SE050 | SSS_HAVE_FIPS_140_2 | SSS_HAVE_FIPS_140_3 ) - - -/* Version checks GTE - Greater Than Or Equal To */ -#if SSS_HAVE_APPLET_SE05X_IOT -#if SSS_HAVE_SE05X_VER_06_00 -#define SSS_HAVE_SE05X_VER_GTE_06_00 1 -#define SSS_HAVE_SE05X_VER_GTE_03_XX 1 -#endif /* SSS_HAVE_SE05X_VER_06_00 */ -#if SSS_HAVE_SE05X_VER_03_XX -#define SSS_HAVE_SE05X_VER_GTE_06_00 0 -#define SSS_HAVE_SE05X_VER_GTE_03_XX 1 -#endif /* SSS_HAVE_SE05X_VER_03_XX */ -#else //SSS_HAVE_APPLET_SE05X_IOT -#define SSS_HAVE_SE05X_VER_GTE_03_XX 0 -#define SSS_HAVE_SE05X_VER_GTE_06_00 0 -#endif // SSS_HAVE_APPLET_SE05X_IOT -/** Deprecated items. Used here for backwards compatibility. */ - -#define WithApplet_SE05X ( SSS_HAVE_APPLET_SE05X_IOT ) -#define WithApplet_SE050_A ( SSS_HAVE_APPLET_SE05X_A ) -#define WithApplet_SE050_B ( SSS_HAVE_APPLET_SE05X_B ) -#define WithApplet_SE050_C ( SSS_HAVE_APPLET_SE05X_C ) -#define SSS_HAVE_SE050_A ( SSS_HAVE_APPLET_SE05X_A ) -#define SSS_HAVE_SE050_B ( SSS_HAVE_APPLET_SE05X_B ) -#define SSS_HAVE_SE050_C ( SSS_HAVE_APPLET_SE05X_C ) -#define SSS_HAVE_SE05X ( SSS_HAVE_APPLET_SE05X_IOT ) -#define SSS_HAVE_SE ( SSS_HAVE_APPLET ) -#define SSS_HAVE_LOOPBACK ( SSS_HAVE_APPLET_LOOPBACK ) -#define SSS_HAVE_ALT ( SSS_HAVE_MBEDTLS_ALT ) -#define WithApplet_None ( SSS_HAVE_APPLET_NONE ) -#define SSS_HAVE_None ( SSS_HAVE_APPLET_NONE ) -#define WithApplet_A71CH ( SSS_HAVE_APPLET_A71CH ) -#define SSS_HAVE_A71CH ( SSS_HAVE_APPLET_A71CH ) -#define WithApplet_A71CL ( SSS_HAVE_APPLET_A71CL ) -#define SSS_HAVE_A71CL ( SSS_HAVE_APPLET_A71CL ) -#define WithApplet_A71CH_SIM ( SSS_HAVE_APPLET_A71CH_SIM ) -#define SSS_HAVE_A71CH_SIM ( SSS_HAVE_APPLET_A71CH_SIM ) -#define WithApplet_SE05X_A ( SSS_HAVE_APPLET_SE05X_A ) -#define SSS_HAVE_SE05X_A ( SSS_HAVE_APPLET_SE05X_A ) -#define WithApplet_SE05X_B ( SSS_HAVE_APPLET_SE05X_B ) -#define SSS_HAVE_SE05X_B ( SSS_HAVE_APPLET_SE05X_B ) -#define WithApplet_SE05X_C ( SSS_HAVE_APPLET_SE05X_C ) -#define SSS_HAVE_SE05X_C ( SSS_HAVE_APPLET_SE05X_C ) -#define WithApplet_SE05X_L ( SSS_HAVE_APPLET_SE05X_L ) -#define SSS_HAVE_SE05X_L ( SSS_HAVE_APPLET_SE05X_L ) -#define WithApplet_SE051_UWB ( SSS_HAVE_APPLET_SE051_UWB ) -#define SSS_HAVE_SE051_UWB ( SSS_HAVE_APPLET_SE051_UWB ) -#define WithApplet_AUTH ( SSS_HAVE_APPLET_AUTH ) -#define SSS_HAVE_AUTH ( SSS_HAVE_APPLET_AUTH ) -#define WithApplet_LoopBack ( SSS_HAVE_APPLET_LOOPBACK ) -#define SSS_HAVE_LoopBack ( SSS_HAVE_APPLET_LOOPBACK ) -#define SSS_HAVE_MBEDTLS ( SSS_HAVE_HOSTCRYPTO_MBEDTLS ) -#define SSS_HAVE_MBEDCRYPTO ( SSS_HAVE_HOSTCRYPTO_MBEDCRYPTO ) -#define SSS_HAVE_OPENSSL ( SSS_HAVE_HOSTCRYPTO_OPENSSL ) -#define SSS_HAVE_USER ( SSS_HAVE_HOSTCRYPTO_USER ) -#define SSS_HAVE_NONE ( SSS_HAVE_HOSTCRYPTO_NONE ) -#define SSS_HAVE_ALT_SSS ( SSS_HAVE_MBEDTLS_ALT_SSS ) -#define SSS_HAVE_ALT_A71CH ( SSS_HAVE_MBEDTLS_ALT_A71CH ) -#define SSS_HAVE_ALT_NONE ( SSS_HAVE_MBEDTLS_ALT_NONE ) -#define SSS_HAVE_SE05X_Auth_None ( SSS_HAVE_SE05X_AUTH_NONE ) -#define SSS_HAVE_SE05X_Auth_UserID ( SSS_HAVE_SE05X_AUTH_USERID ) -#define SSS_HAVE_SE05X_Auth_PlatfSCP03 ( SSS_HAVE_SE05X_AUTH_PLATFSCP03 ) -#define SSS_HAVE_SE05X_Auth_AESKey ( SSS_HAVE_SE05X_AUTH_AESKEY ) -#define SSS_HAVE_SE05X_Auth_ECKey ( SSS_HAVE_SE05X_AUTH_ECKEY ) -#define SSS_HAVE_SE05X_Auth_UserID_PlatfSCP03 ( SSS_HAVE_SE05X_AUTH_USERID_PLATFSCP03 ) -#define SSS_HAVE_SE05X_Auth_AESKey_PlatfSCP03 ( SSS_HAVE_SE05X_AUTH_AESKEY_PLATFSCP03 ) -#define SSS_HAVE_SE05X_Auth_ECKey_PlatfSCP03 ( SSS_HAVE_SE05X_AUTH_ECKEY_PLATFSCP03 ) - -/* # CMake Features : END */ - -/* ========= Miscellaneous values : START =================== */ - -/* ECC Mode is available */ -#define SSS_HAVE_ECC 1 - -/* RSA is available */ -#define SSS_HAVE_RSA 1 - -/* TPM BARRETO_NAEHRIG Curve is enabled */ -#define SSS_HAVE_TPM_BN 1 - -/* Edwards Curve is enabled */ -#define SSS_HAVE_EC_ED 1 - -/* Montgomery Curve is enabled */ -#define SSS_HAVE_EC_MONT 1 - -/* MIFARE DESFire is enabled */ -#define SSS_HAVE_MIFARE_DESFIRE 1 - -/* PBKDF2 is enabled */ -#define SSS_HAVE_PBKDF2 1 - -/* TLS handshake support on SE is enabled */ -#define SSS_HAVE_TLS_HANDSHAKE 1 - -/* Import Export Key is enabled */ -#define SSS_HAVE_IMPORT 1 - -/* With NXP NFC Reader Library */ -#define SSS_HAVE_NXPNFCRDLIB 0 - -#define SSS_HAVE_A71XX \ - ( SSS_HAVE_APPLET_A71CH | SSS_HAVE_APPLET_A71CH_SIM ) - -#define SSS_HAVE_SSCP ( SSS_HAVE_A71XX ) - -/* For backwards compatibility */ -#define SSS_HAVE_TESTCOUNTERPART ( SSSFTR_SW_TESTCOUNTERPART ) - -/* ========= Miscellaneous values : END ===================== */ - -/* ========= Calculated values : START ====================== */ - -/* Should we expose, SSS APIs */ -#define SSS_HAVE_SSS \ - ( 0 \ - + SSS_HAVE_SSCP \ - + SSS_HAVE_APPLET_SE05X_IOT \ - + SSS_HAVE_HOSTCRYPTO_OPENSSL \ - + SSS_HAVE_HOSTCRYPTO_MBEDCRYPTO \ - + SSS_HAVE_HOSTCRYPTO_MBEDTLS \ - + SSS_HAVE_HOSTCRYPTO_USER \ - ) - -/* MBEDCRYPTO is superset of MBEDTLS and exposing that way */ -#if SSS_HAVE_HOSTCRYPTO_MBEDCRYPTO -#undef SSS_HAVE_MBEDTLS -#undef SSS_HAVE_HOSTCRYPTO_MBEDTLS - -#define SSS_HAVE_MBEDTLS 1 -#define SSS_HAVE_HOSTCRYPTO_MBEDTLS 1 -#endif // SSS_HAVE_HOSTCRYPTO_MBEDCRYPTO - -#if SSS_HAVE_HOSTCRYPTO_NONE -#undef SSSFTR_SE05X_AuthSession -#define SSSFTR_SE05X_AuthSession 0 -#endif - -/* Montgomery curves is not supported in SE05X_A*/ -#if SSS_HAVE_APPLET_SE05X_A -#undef SSS_HAVE_EC_MONT -#define SSS_HAVE_EC_MONT 0 -/* ED is not supported in SE050_A */ -#if SSS_HAVE_SE05X_VER_03_XX -#undef SSS_HAVE_EC_ED -#define SSS_HAVE_EC_ED 0 -#endif -#endif - -#if SSS_HAVE_RSA -#define SSS_HAVE_RSA_4K 1 -#if SSS_HAVE_APPLET_SE051_UWB -#undef SSS_HAVE_RSA_4K -#define SSS_HAVE_RSA_4K 0 -#endif -#endif - -#if SSS_HAVE_ECC -#define SSS_HAVE_EC_NIST_192 1 -#define SSS_HAVE_EC_NIST_224 1 -#define SSS_HAVE_EC_NIST_256 1 -#define SSS_HAVE_EC_NIST_384 1 -#define SSS_HAVE_EC_NIST_521 1 -#define SSS_HAVE_EC_BP 1 -#define SSS_HAVE_EC_NIST_K 1 -#define SSS_HAVE_ECDAA 1 -#define SSS_HAVE_EDDSA 1 -#if SSS_HAVE_APPLET_SE05X_A -#undef SSS_HAVE_ECDAA -#undef SSS_HAVE_EDDSA -#define SSS_HAVE_ECDAA 0 -#define SSS_HAVE_EDDSA 0 -#endif -#if SSS_HAVE_APPLET_AUTH -#undef SSS_HAVE_EC_NIST_192 -#undef SSS_HAVE_EC_NIST_224 -#undef SSS_HAVE_EC_NIST_521 -#undef SSS_HAVE_EC_BP -#undef SSS_HAVE_EC_NIST_K -#undef SSS_HAVE_ECDAA -#undef SSS_HAVE_EDDSA -#define SSS_HAVE_EC_NIST_192 0 -#define SSS_HAVE_EC_NIST_224 0 -#define SSS_HAVE_EC_NIST_521 0 -#define SSS_HAVE_EC_BP 0 -#define SSS_HAVE_EC_NIST_K 0 -#define SSS_HAVE_ECDAA 0 -#define SSS_HAVE_EDDSA 0 -#endif /* if SSS_HAVE_APPLET_AUTH */ -#endif /* if SSS_HAVE_ECC */ - -#if SSS_HAVE_APPLET -#define SSS_HAVE_HASH_1 1 -#define SSS_HAVE_HASH_224 1 -#define SSS_HAVE_HASH_512 1 -#if SSS_HAVE_APPLET_AUTH -#undef SSS_HAVE_HASH_1 -#undef SSS_HAVE_HASH_224 -#undef SSS_HAVE_HASH_512 -#define SSS_HAVE_HASH_1 0 -#define SSS_HAVE_HASH_224 0 -#define SSS_HAVE_HASH_512 0 -#endif -#endif /* if SSS_HAVE_APPLET */ - - -/* ========= Calculated values : END ======================== */ - -/* clang-format on */ - -#endif /* SSS_APIS_INC_FSL_SSS_FTR_H_ */ diff --git a/examples/evkbmimxrt1060/test/include/kvstore_config.h b/examples/evkbmimxrt1060/test/include/kvstore_config.h deleted file mode 100644 index 84b5951..0000000 --- a/examples/evkbmimxrt1060/test/include/kvstore_config.h +++ /dev/null @@ -1,79 +0,0 @@ -/* - * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - * https://www.FreeRTOS.org - * https://github.com/FreeRTOS - * - */ - -#ifndef _KVSTORE_CONFIG_H -#define _KVSTORE_CONFIG_H - - -#include "test_param_config.h" -#include "core_pkcs11_config.h" - -typedef enum KVStoreKey -{ - KVS_CORE_THING_NAME = 0, - KVS_CORE_MQTT_ENDPOINT, - KVS_CORE_MQTT_PORT, - KVS_DEVICE_PRIVKEY_ID, - KVS_DEVICE_PUBKEY_ID, - KVS_DEVICE_CERT_ID, - KVS_PRIV_ROOTCA_ID, - KVS_AWS_ROOTCA_ID, - KVS_CODEVERIFY_PUBKEY_ID, - KVS_NUM_KEYS -} KVStoreKey_t; - -#define KVSTORE_KEY_MAX_LEN 32 -#define KVSTORE_VAL_MAX_LEN 256 - -#define KVSTORE_FILE_PATH ( "/kvstore" ) - -/* Array to map between strings and KVStoreKey_t IDs */ -#define KVSTORE_KEYS \ - { \ - [ KVS_CORE_THING_NAME ] = "thing_name", \ - [ KVS_CORE_MQTT_ENDPOINT ] = "mqtt_endpoint", \ - [ KVS_CORE_MQTT_PORT ] = "mqtt_port", \ - [ KVS_DEVICE_PRIVKEY_ID ] = "priv_key_id", \ - [ KVS_DEVICE_PUBKEY_ID ] = "pub_key_id", \ - [ KVS_DEVICE_CERT_ID ] = "cert_id", \ - [ KVS_PRIV_ROOTCA_ID ] = "priv_root_ca_id", \ - [ KVS_AWS_ROOTCA_ID ] = "aws_root_ca_id", \ - [ KVS_CODEVERIFY_PUBKEY_ID ] = "codeverify_key_id" \ - } - -#define KV_STORE_DEFAULTS \ - { \ - KV_DFLT( KV_TYPE_STRING, IOT_THING_NAME ), /* THINGNAME */ \ - KV_DFLT( KV_TYPE_STRING, MQTT_SERVER_ENDPOINT ), /* MQTT_ENDPOINT */ \ - KV_DFLT( KV_TYPE_UINT32, MQTT_SERVER_PORT ), /* MQTT_PORT */ \ - KV_DFLT( KV_TYPE_STRING, pkcs11configLABEL_DEVICE_PRIVATE_KEY_FOR_TLS ), /* DEVICE_PRIVKEY_ID */ \ - KV_DFLT( KV_TYPE_STRING, pkcs11configLABEL_DEVICE_PUBLIC_KEY_FOR_TLS ), /* DEVICE_PUBKEY_ID */ \ - KV_DFLT( KV_TYPE_STRING, pkcs11configLABEL_DEVICE_CERTIFICATE_FOR_TLS ), /* DEVICE_CERT_ID */ \ - KV_DFLT( KV_TYPE_STRING, pkcs11configLABEL_JITP_CERTIFICATE ), /* PRIV_ROOTCA_ID */ \ - KV_DFLT( KV_TYPE_STRING, pkcs11configLABEL_ROOT_CERTIFICATE ), /* AWS_ROOTCA_ID */ \ - KV_DFLT( KV_TYPE_STRING, pkcs11configLABEL_CODE_VERIFICATION_KEY ), /* CODEVERIFY_PUBKEY_ID */ \ - } - -#endif /* _KVSTORE_CONFIG_H */ diff --git a/examples/evkbmimxrt1060/test/include/lwipopts.h b/examples/evkbmimxrt1060/test/include/lwipopts.h deleted file mode 100644 index 0fcc4a5..0000000 --- a/examples/evkbmimxrt1060/test/include/lwipopts.h +++ /dev/null @@ -1,339 +0,0 @@ -/** - ****************************************************************************** - * @file lwipopts.h - * This file is based on \src\include\lwip\opt.h - ****************************************************************************** - * Copyright (c) 2013-2016, Freescale Semiconductor, Inc. - * Copyright 2016-2019 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#ifndef __LWIPOPTS_H__ -#define __LWIPOPTS_H__ - -/** - * SYS_LIGHTWEIGHT_PROT==1: if you want inter-task protection for certain - * critical regions during buffer allocation, deallocation and memory - * allocation and deallocation. - */ -#define SYS_LIGHTWEIGHT_PROT 1 - -/** - * NO_SYS==0: Use RTOS - */ -#define NO_SYS 0 - -/** - * LWIP_NETCONN==1: Enable Netconn API (require to use api_lib.c) - */ -#define LWIP_NETCONN 1 - -/** - * LWIP_SOCKET==1: Enable Socket API (require to use sockets.c) - */ -#define LWIP_SOCKET 1 - -/** - * LWIP_SO_SNDTIMEO==1: Enable send timeout for sockets/netconns and - * SO_SNDTIMEO processing. - */ - -#define LWIP_SO_SNDTIMEO 1 - -/** - * LWIP_SO_RCVTIMEO==1: Enable receive timeout for sockets/netconns and - * SO_RCVTIMEO processing. - */ -#define LWIP_SO_RCVTIMEO 1 - -#define LWIP_SO_SNDRCVTIMEO_NONSTANDARD 1 - -#define LWIP_TIMEVAL_PRIVATE 0 - - -/* ---------- Core locking ---------- */ - -#define LWIP_TCPIP_CORE_LOCKING 1 - -void sys_lock_tcpip_core( void ); -#define LOCK_TCPIP_CORE() sys_lock_tcpip_core() - -void sys_unlock_tcpip_core( void ); -#define UNLOCK_TCPIP_CORE() sys_unlock_tcpip_core() - -void sys_check_core_locking( void ); -#define LWIP_ASSERT_CORE_LOCKED() sys_check_core_locking() - -void sys_mark_tcpip_thread( void ); -#define LWIP_MARK_TCPIP_THREAD() sys_mark_tcpip_thread() - -/* ---------- Memory options ---------- */ - -/** - * MEM_ALIGNMENT: should be set to the alignment of the CPU - * 4 byte alignment -> #define MEM_ALIGNMENT 4 - * 2 byte alignment -> #define MEM_ALIGNMENT 2 - */ -#ifndef MEM_ALIGNMENT -#define MEM_ALIGNMENT 4 -#endif - -/** - * MEM_SIZE: the size of the heap memory. If the application will send - * a lot of data that needs to be copied, this should be set high. - */ -#ifndef MEM_SIZE -#define MEM_SIZE ( 16 * 1024 ) -#endif - -/* MEMP_NUM_PBUF: the number of memp struct pbufs. If the application - * sends a lot of data out of ROM (or other static memory), this - * should be set high. */ -#ifndef MEMP_NUM_PBUF -#define MEMP_NUM_PBUF 15 -#endif - -/* MEMP_NUM_UDP_PCB: the number of UDP protocol control blocks. One - * per active UDP "connection". */ -#ifndef MEMP_NUM_UDP_PCB -#define MEMP_NUM_UDP_PCB 6 -#endif - -/* MEMP_NUM_TCP_PCB: the number of simulatenously active TCP - * connections. */ -#ifndef MEMP_NUM_TCP_PCB -#define MEMP_NUM_TCP_PCB 10 -#endif - -/* MEMP_NUM_TCP_PCB_LISTEN: the number of listening TCP - * connections. */ -#ifndef MEMP_NUM_TCP_PCB_LISTEN -#define MEMP_NUM_TCP_PCB_LISTEN 6 -#endif - -/* MEMP_NUM_TCP_SEG: the number of simultaneously queued TCP - * segments. */ -#ifndef MEMP_NUM_TCP_SEG -#define MEMP_NUM_TCP_SEG 22 -#endif - -/* MEMP_NUM_SYS_TIMEOUT: the number of simulateously active - * timeouts. */ -#ifndef MEMP_NUM_SYS_TIMEOUT -#define MEMP_NUM_SYS_TIMEOUT 10 -#endif - -/* ---------- Pbuf options ---------- */ -/* PBUF_POOL_SIZE: the number of buffers in the pbuf pool. */ -#ifndef PBUF_POOL_SIZE -#define PBUF_POOL_SIZE 5 -#endif - -/* PBUF_POOL_BUFSIZE: the size of each pbuf in the pbuf pool. */ - -/* Default value is defined in lwip\src\include\lwip\opt.h as - * LWIP_MEM_ALIGN_SIZE(TCP_MSS+40+PBUF_LINK_ENCAPSULATION_HLEN+PBUF_LINK_HLEN)*/ - -/* ---------- TCP options ---------- */ -#ifndef LWIP_TCP -#define LWIP_TCP 1 -#endif - -#ifndef TCP_TTL -#define TCP_TTL 255 -#endif - -/* Controls if TCP should queue segments that arrive out of - * order. Define to 0 if your device is low on memory. */ -#ifndef TCP_QUEUE_OOSEQ -#define TCP_QUEUE_OOSEQ 0 -#endif - -/* TCP Maximum segment size. */ -#ifndef TCP_MSS -#define TCP_MSS ( 1500 - 40 ) /* TCP_MSS = (Ethernet MTU - IP header size - TCP header size) */ -#endif - -/* TCP sender buffer space (bytes). */ -#ifndef TCP_SND_BUF -#define TCP_SND_BUF ( 6 * TCP_MSS ) /* 2 */ -#endif - -/* TCP sender buffer space (pbufs). This must be at least = 2 * - * TCP_SND_BUF/TCP_MSS for things to work. */ -#ifndef TCP_SND_QUEUELEN -#define TCP_SND_QUEUELEN ( 3 * TCP_SND_BUF ) / TCP_MSS /* 6 */ -#endif - -/* TCP receive window. */ -#ifndef TCP_WND -#define TCP_WND ( 2 * TCP_MSS ) -#endif - -/* Enable backlog*/ -#ifndef TCP_LISTEN_BACKLOG -#define TCP_LISTEN_BACKLOG 1 -#endif - -/* ---------- Network Interfaces options ---------- */ -/* Support netif api (in netifapi.c). */ -#ifndef LWIP_NETIF_API -#define LWIP_NETIF_API 1 -#endif - -/* ---------- ICMP options ---------- */ -#ifndef LWIP_ICMP -#define LWIP_ICMP 1 -#endif - -/* ---------- DHCP options ---------- */ -/* Enable DHCP module. */ -#ifndef LWIP_DHCP -#define LWIP_DHCP 1 -#endif - -/* ---------- DNS options ---------- */ -#ifndef LWIP_DNS -#define LWIP_DNS 1 -#endif - -/* ---------- UDP options ---------- */ -#ifndef LWIP_UDP -#define LWIP_UDP 1 -#endif -#ifndef UDP_TTL -#define UDP_TTL 255 -#endif - -/* ---------- Statistics options ---------- */ -#ifndef LWIP_STATS -#define LWIP_STATS 0 -#endif -#ifndef LWIP_PROVIDE_ERRNO -#define LWIP_PROVIDE_ERRNO 1 -#endif - -/* - * -------------------------------------- - * ---------- Checksum options ---------- - * -------------------------------------- - */ - -/* - * Some MCU allow computing and verifying the IP, UDP, TCP and ICMP checksums by hardware: - * - To use this feature let the following define uncommented. - * - To disable it and process by CPU comment the the checksum. - */ -/*#define CHECKSUM_BY_HARDWARE */ - -#ifdef CHECKSUM_BY_HARDWARE -/* CHECKSUM_GEN_IP==0: Generate checksums by hardware for outgoing IP packets.*/ -#define CHECKSUM_GEN_IP 0 -/* CHECKSUM_GEN_UDP==0: Generate checksums by hardware for outgoing UDP packets.*/ -#define CHECKSUM_GEN_UDP 0 -/* CHECKSUM_GEN_TCP==0: Generate checksums by hardware for outgoing TCP packets.*/ -#define CHECKSUM_GEN_TCP 0 -/* CHECKSUM_CHECK_IP==0: Check checksums by hardware for incoming IP packets.*/ -#define CHECKSUM_CHECK_IP 0 -/* CHECKSUM_CHECK_UDP==0: Check checksums by hardware for incoming UDP packets.*/ -#define CHECKSUM_CHECK_UDP 0 -/* CHECKSUM_CHECK_TCP==0: Check checksums by hardware for incoming TCP packets.*/ -#define CHECKSUM_CHECK_TCP 0 -#else /* ifdef CHECKSUM_BY_HARDWARE */ -/* CHECKSUM_GEN_IP==1: Generate checksums in software for outgoing IP packets.*/ -#define CHECKSUM_GEN_IP 1 -/* CHECKSUM_GEN_UDP==1: Generate checksums in software for outgoing UDP packets.*/ -#define CHECKSUM_GEN_UDP 1 -/* CHECKSUM_GEN_TCP==1: Generate checksums in software for outgoing TCP packets.*/ -#define CHECKSUM_GEN_TCP 1 -/* CHECKSUM_CHECK_IP==1: Check checksums in software for incoming IP packets.*/ -#define CHECKSUM_CHECK_IP 1 -/* CHECKSUM_CHECK_UDP==1: Check checksums in software for incoming UDP packets.*/ -#define CHECKSUM_CHECK_UDP 1 -/* CHECKSUM_CHECK_TCP==1: Check checksums in software for incoming TCP packets.*/ -#define CHECKSUM_CHECK_TCP 1 -#endif /* ifdef CHECKSUM_BY_HARDWARE */ - -/** - * DEFAULT_THREAD_STACKSIZE: The stack size used by any other lwIP thread. - * The stack size value itself is platform-dependent, but is passed to - * sys_thread_new() when the thread is created. - */ -#ifndef DEFAULT_THREAD_STACKSIZE -#define DEFAULT_THREAD_STACKSIZE 3000 -#endif - -/** - * DEFAULT_THREAD_PRIO: The priority assigned to any other lwIP thread. - * The priority value itself is platform-dependent, but is passed to - * sys_thread_new() when the thread is created. - */ -#ifndef DEFAULT_THREAD_PRIO -#define DEFAULT_THREAD_PRIO 3 -#endif - -/* - * ------------------------------------ - * ---------- Debugging options ---------- - * ------------------------------------ - */ - -#define LWIP_DEBUG - -#ifdef LWIP_DEBUG -#define U8_F "c" -#define S8_F "c" -#define X8_F "02x" -#define U16_F "u" -#define S16_F "d" -#define X16_F "x" -#define U32_F "u" -#define S32_F "d" -#define X32_F "x" -#define SZT_F "u" -#endif /* ifdef LWIP_DEBUG */ - -#define TCPIP_MBOX_SIZE 32 -#define TCPIP_THREAD_STACKSIZE 1024 -#define TCPIP_THREAD_PRIO 8 - -/** - * DEFAULT_RAW_RECVMBOX_SIZE: The mailbox size for the incoming packets on a - * NETCONN_RAW. The queue size value itself is platform-dependent, but is passed - * to sys_mbox_new() when the recvmbox is created. - */ -#define DEFAULT_RAW_RECVMBOX_SIZE 12 - -/** - * DEFAULT_UDP_RECVMBOX_SIZE: The mailbox size for the incoming packets on a - * NETCONN_UDP. The queue size value itself is platform-dependent, but is passed - * to sys_mbox_new() when the recvmbox is created. - */ -#define DEFAULT_UDP_RECVMBOX_SIZE 12 - -/** - * DEFAULT_TCP_RECVMBOX_SIZE: The mailbox size for the incoming packets on a - * NETCONN_TCP. The queue size value itself is platform-dependent, but is passed - * to sys_mbox_new() when the recvmbox is created. - */ -#define DEFAULT_TCP_RECVMBOX_SIZE 12 - -/** - * DEFAULT_ACCEPTMBOX_SIZE: The mailbox size for the incoming connections. - * The queue size value itself is platform-dependent, but is passed to - * sys_mbox_new() when the acceptmbox is created. - */ -#define DEFAULT_ACCEPTMBOX_SIZE 12 - -#if ( LWIP_DNS || LWIP_IGMP || LWIP_IPV6 ) && !defined( LWIP_RAND ) -/* When using IGMP or IPv6, LWIP_RAND() needs to be defined to a random-function returning an u32_t random value*/ -#include "lwip/arch.h" -u32_t lwip_rand( void ); -#define LWIP_RAND() lwip_rand() -#endif - -#endif /* __LWIPOPTS_H__ */ - -/*****END OF FILE****/ diff --git a/examples/evkbmimxrt1060/test/include/ota_config.h b/examples/evkbmimxrt1060/test/include/ota_config.h deleted file mode 100644 index ce8c494..0000000 --- a/examples/evkbmimxrt1060/test/include/ota_config.h +++ /dev/null @@ -1,198 +0,0 @@ -/* - * FreeRTOS version 202012.00-LTS - * Copyright (C) 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - * http://aws.amazon.com/freertos - * http://www.FreeRTOS.org - */ - -/** - * @file ota_config.h - * @brief OTA user configurable settings. - */ - -#ifndef _OTA_CONFIG_H -#define _OTA_CONFIG_H - - -/**************************************************/ -/******* DO NOT CHANGE the following order ********/ -/**************************************************/ - -/* Include logging header files and define logging macros in the following order: - * 1. Include the header file "logging_levels.h". - * 2. Define the LIBRARY_LOG_NAME and LIBRARY_LOG_LEVEL macros depending on - * the logging configuration for MQTT. - * 3. Include the header file "logging_stack.h", if logging is enabled for MQTT. - */ - -#include "logging_levels.h" - -/* Logging configuration for the MQTT library. */ -#ifndef LIBRARY_LOG_NAME -#define LIBRARY_LOG_NAME "OTA" -#endif - -#ifndef LIBRARY_LOG_LEVEL -#define LIBRARY_LOG_LEVEL LOG_INFO -#endif - - -#include "logging.h" - -#include "test_param_config.h" -#include "test_execution_config.h" - -#define APP_VERSION_MAJOR OTA_APP_VERSION_MAJOR -#define APP_VERSION_MINOR OTA_APP_VERSION_MINOR -#define APP_VERSION_BUILD OTA_APP_VERSION_BUILD - - -#if ( OTA_PAL_TEST_ENABLED == 1 ) -#define DISABLE_OTA_CLOSE_FILE_HEADER_CHECK 1 -#endif - -/** - * @brief The number of words allocated to the stack for the OTA agent. - */ -#define otaconfigSTACK_SIZE ( 3584U ) - -/** - * @breif Task priority for OTA task. - */ -#define otaconfigTASK_PRIORITY ( configMAX_PRIORITIES - 2 ) - -/** - * @brief Log base 2 of the size of the file data block message (excluding the header). - * - * 10 bits yields a data block size of 1KB. - */ -#define otaconfigLOG2_FILE_BLOCK_SIZE 12UL - -/** - * @brief Milliseconds to wait for the self test phase to succeed before we force reset. - */ -#define otaconfigSELF_TEST_RESPONSE_WAIT_MS 16000U - -/** - * @brief Milliseconds to wait before requesting data blocks from the OTA service if nothing is happening. - * - * The wait timer is reset whenever a data block is received from the OTA service so we will only send - * the request message after being idle for this amount of time. - */ -#define otaconfigFILE_REQUEST_WAIT_MS 10000U - -/** - * @brief The OTA agent task priority. Normally it runs at a low priority. - */ -#define otaconfigAGENT_PRIORITY tskIDLE_PRIORITY - -/** - * @brief The maximum allowed length of the thing name used by the OTA agent. - * - * AWS IoT requires Thing names to be unique for each device that connects to the broker. - * Likewise, the OTA agent requires the developer to construct and pass in the Thing name when - * initializing the OTA agent. The agent uses this size to allocate static storage for the - * Thing name used in all OTA base topics. Namely $aws/things/ - */ -#define otaconfigMAX_THINGNAME_LEN 64U - -/** - * @brief The maximum number of data blocks requested from OTA streaming service. - * - * This configuration parameter is sent with data requests and represents the maximum number of - * data blocks the service will send in response. The maximum limit for this must be calculated - * from the maximum data response limit (128 KB from service) divided by the block size. - * For example if block size is set as 1 KB then the maximum number of data blocks that we can - * request is 128/1 = 128 blocks. Configure this parameter to this maximum limit or lower based on - * how many data blocks response is expected for each data requests. - * Please note that this must be set larger than zero. - * - */ -#define otaconfigMAX_NUM_BLOCKS_REQUEST 4U - -/** - * @brief The maximum number of requests allowed to send without a response before we abort. - * - * This configuration parameter sets the maximum number of times the requests are made over - * the selected communication channel before aborting and returning error. - * - */ -#define otaconfigMAX_NUM_REQUEST_MOMENTUM 32U - -/** - * @brief The number of data buffers reserved by the OTA agent. - * - * This configurations parameter sets the maximum number of static data buffers used by - * the OTA agent for job and file data blocks received. - */ -#define otaconfigMAX_NUM_OTA_DATA_BUFFERS 5U - -/** - * @brief The protocol selected for OTA control operations. - * - * This configurations parameter sets the default protocol for all the OTA control - * operations like requesting OTA job, updating the job status etc. - * - * Note - Only MQTT is supported at this time for control operations. - */ -#define configENABLED_CONTROL_PROTOCOL ( OTA_CONTROL_OVER_MQTT ) - -/** - * @brief The protocol selected for OTA data operations. - * - * This configurations parameter sets the protocols selected for the data operations - * like requesting file blocks from the service. - * - * Note - Both MQTT and HTTP is supported for data transfer. This configuration parameter - * can be set to following - - * Enable data over MQTT - ( OTA_DATA_OVER_MQTT ) - * Enable data over HTTP - ( OTA_DATA_OVER_HTTP) - * Enable data over both MQTT & HTTP ( OTA_DATA_OVER_MQTT | OTA_DATA_OVER_HTTP ) - */ -#define configENABLED_DATA_PROTOCOLS ( OTA_DATA_OVER_MQTT ) - -/** - * @brief The preferred protocol selected for OTA data operations. - * - * Primary data protocol will be the protocol used for downloading file if more than - * one protocol is selected while creating OTA job. Default primary data protocol is MQTT - * and following update here to switch to HTTP as primary. - * - * Note - use OTA_DATA_OVER_HTTP for HTTP as primary data protocol. - */ -#define configOTA_PRIMARY_DATA_PROTOCOL ( OTA_DATA_OVER_MQTT ) - - -/** - * @brief Allow update to same or lower version. - * - * Set this to 1 to allow downgrade or same version update.This configurations parameter - * disables version check and allows update to a same or lower version.This is provided for - * testing purpose and it is recommended to always update to higher version and keep this - * configuration disabled. - */ -#define otaconfigAllowDowngrade 0U - -#define OTA_MAX_FILE_PATH_SIZE ( 64 ) - -#define OTA_MAX_STREAM_NAME_SIZE ( 64 ) - -#endif /* _OTA_CONFIG_H */ diff --git a/examples/evkbmimxrt1060/test/include/test_execution_config.h b/examples/evkbmimxrt1060/test/include/test_execution_config.h deleted file mode 100644 index 54550e7..0000000 --- a/examples/evkbmimxrt1060/test/include/test_execution_config.h +++ /dev/null @@ -1,74 +0,0 @@ -/* - * FreeRTOS FreeRTOS LTS Qualification Tests preview - * Copyright (C) 2022 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -/** - * @file test_execution_config_template.h - * @brief This is a template to setup the execution configurations for LTS qualification test. - */ - -#ifndef TEST_EXECUTION_CONFIG_H -#define TEST_EXECUTION_CONFIG_H - -/** - * @brief Configuration to enable Device Advisor testing. - * - * #define DEVICE_ADVISOR_TEST_ENABLED (0) - */ -#define DEVICE_ADVISOR_TEST_ENABLED ( 0 ) - -/** - * @brief Configuration to enable the MQTT test. - * - * #define MQTT_TEST_ENABLED (0) - */ -#define MQTT_TEST_ENABLED ( 0 ) - -/** - * @brief Configuration to enable the transport interface test. - * - * #define TRANSPORT_INTERFACE_TEST_ENABLED (0) - */ - -#define TRANSPORT_INTERFACE_TEST_ENABLED ( 0 ) - -/** - * @brief Configuration to enable the OTA PAL test. - * - * #define OTA_PAL_TEST_ENABLED (0) - */ -#define OTA_PAL_TEST_ENABLED ( 0 ) - -/** - * @brief Configuration to enable the OTA End-to-end test. - * - * #define OTA_E2E_TEST_ENABLED (0) - */ -#define OTA_E2E_TEST_ENABLED ( 0 ) - -/** - * @brief Configuration to enable the corePKCS11 test. - * - * #define CORE_PKCS11_TEST_ENABLED (0) - */ -#define CORE_PKCS11_TEST_ENABLED ( 0 ) - -#endif /* TEST_EXECUTION_CONFIG_H */ diff --git a/examples/evkbmimxrt1060/test/include/test_param_config.h b/examples/evkbmimxrt1060/test/include/test_param_config.h deleted file mode 100644 index ae0a8a3..0000000 --- a/examples/evkbmimxrt1060/test/include/test_param_config.h +++ /dev/null @@ -1,182 +0,0 @@ -/* - * FreeRTOS FreeRTOS LTS Qualification Tests preview - * Copyright (C) 2022 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -/** - * @file test_param_config.h - * @brief This setup the test parameters for LTS qualification test. - */ - -#ifndef TEST_PARAM_CONFIG_H -#define TEST_PARAM_CONFIG_H - -/** - * @brief Configuration that indicates if the device should generate a key pair. - * - * @note When FORCE_GENERATE_NEW_KEY_PAIR is set to 1, the device should generate - * a new on-device key pair and output public key. When set to 0, the device - * should keep existing key pair. - * - * #define FORCE_GENERATE_NEW_KEY_PAIR 0 - */ - -/** - * @brief Endpoint of the MQTT broker to connect to in mqtt test. - * - * #define MQTT_SERVER_ENDPOINT "PLACE_HOLDER" - */ -#define MQTT_SERVER_ENDPOINT "PLACE_HOLDER" - -/** - * @brief Port of the MQTT broker to connect to in mqtt test. - * - * #define MQTT_SERVER_PORT (8883) - */ -#define MQTT_SERVER_PORT ( 8883 ) - -/** - * @brief The MQTT client identifier used in MQTT test. Each client identifier - * must be unique; so edit as required to ensure that no two clients connecting to - * the same broker use the same client identifier. - * - * #define MQTT_TEST_CLIENT_IDENTIFIER "insert here." - */ - -/** - * @brief Network buffer size specified in bytes. Must be large enough to hold the maximum - * anticipated MQTT payload. - * - * #define MQTT_TEST_NETWORK_BUFFER_SIZE ( 5000 ) - */ -#define MQTT_TEST_NETWORK_BUFFER_SIZE ( 5000 ) - -/** - * @brief Endpoint of the echo server to connect to in transport interface test. - * - * #define ECHO_SERVER_ENDPOINT "PLACE_HOLDER" - */ - - -/** - * @brief Port of the echo server to connect to in transport interface test. - * - * #define ECHO_SERVER_PORT (9000) - */ - -/** - * @brief Root certificate of the echo server. - * - * @note This certificate should be PEM-encoded. - * - * Must include the PEM header and footer: - * "-----BEGIN CERTIFICATE-----\n"\ - * "...base64 data...\n"\ - * "-----END CERTIFICATE-----\n" - * - * #define ECHO_SERVER_ROOT_CA "PLACE_HOLDER" - */ - -/** - * @brief Client certificate to connect to echo server. - * - * @note This certificate should be PEM-encoded. - * - * Must include the PEM header and footer: - * "-----BEGIN CERTIFICATE-----\n"\ - * "...base64 data...\n"\ - * "-----END CERTIFICATE-----\n" - * - * #define TRANSPORT_CLIENT_CERTIFICATE NULL - */ - -/** - * @brief Client private key to connect to echo server. - * - * @note This is should only be used for testing purpose. - * - * For qualification, the key should be generated on-device. - * - * #define TRANSPORT_CLIENT_PRIVATE_KEY NULL - */ - -#define PKCS11_TEST_RSA_KEY_SUPPORT ( 0 ) -#define PKCS11_TEST_EC_KEY_SUPPORT ( 1 ) -#define PKCS11_TEST_IMPORT_PRIVATE_KEY_SUPPORT ( 0 ) -#define PKCS11_TEST_GENERATE_KEYPAIR_SUPPORT ( 0 ) -#define PKCS11_TEST_PREPROVISIONED_SUPPORT ( 1 ) -#define PKCS11_TEST_LABEL_DEVICE_PRIVATE_KEY_FOR_TLS pkcs11configLABEL_DEVICE_PRIVATE_KEY_FOR_TLS -#define PKCS11_TEST_LABEL_DEVICE_PUBLIC_KEY_FOR_TLS pkcs11configLABEL_DEVICE_PUBLIC_KEY_FOR_TLS -#define PKCS11_TEST_LABEL_DEVICE_CERTIFICATE_FOR_TLS pkcs11configLABEL_DEVICE_CERTIFICATE_FOR_TLS - - -#define OTA_RSA_SHA1 1 -#define OTA_RSA_SHA256 2 -#define OTA_ECDSA_SHA256 3 - -/** - * @brief Certificate type for OTA PAL test. - * Valid options are: OTA_RSA_SHA1, OTA_RSA_SHA256, OTA_ECDSA_SHA256. - * - * #define OTA_PAL_TEST_CERT_TYPE OTA_ECDSA_SHA256 - */ -#define OTA_PAL_TEST_CERT_TYPE OTA_ECDSA_SHA256 - -/** - * @brief Path to cert for OTA test PAL. Used to verify signature. - * If applicable, the device must be pre-provisioned with this certificate. Please see - * test/common/ota/test_files for the set of certificates. - */ -#define OTA_PAL_CERTIFICATE_FILE "sss:00223346" - -/** - * @brief Some devices have a hard-coded name for the firmware image to boot. - */ -#define OTA_PAL_FIRMWARE_FILE "dummy.bin" - -/** - * @brief Some boards OTA PAL layers will use the file names passed into it for the - * image and the certificates because their non-volatile memory is abstracted by a - * file system. Set this to 1 if that is the case for your device. - */ -#define OTA_PAL_USE_FILE_SYSTEM 0 - -/** - * @brief The IoT Thing name for the device for OTA test and MQTT test. - * - * #define IOT_THING_NAME "PLACE_HOLDER" - */ -#define IOT_THING_NAME "PLACE_HOLDER" - -/** - * @brief 1 if using PKCS #11 to access the code sign certificate from NVM. - */ -#define OTA_PAL_READ_CERTIFICATE_FROM_NVM_WITH_PKCS11 0 - -#define OTA_APP_VERSION_MAJOR 0 - -#define OTA_APP_VERSION_MINOR 9 - -#define OTA_APP_VERSION_BUILD 1 - -#define OUTGOING_PUBLISH_RECORD_COUNT ( 10 ) -#define INCOMING_PUBLISH_RECORD_COUNT ( 10 ) - -#endif /* TEST_PARAM_CONFIG_H */ diff --git a/examples/evkbmimxrt1060/test/include/unity_config.h b/examples/evkbmimxrt1060/test/include/unity_config.h deleted file mode 100644 index f68e930..0000000 --- a/examples/evkbmimxrt1060/test/include/unity_config.h +++ /dev/null @@ -1,9 +0,0 @@ -#ifndef _UNITY_CONFIG_H -#define _UNITY_CONFIG_H - -#define UNITY_OUTPUT_CHAR( a ) TEST_CacheResult( a ) -#define UNITY_OUTPUT_FLUSH() TEST_SubmitResultBuffer() -#define UNITY_OUTPUT_START() TEST_NotifyTestStart() -#define UNITY_OUTPUT_COMPLETE() TEST_NotifyTestFinished() - -#endif diff --git a/examples/evkbmimxrt1060/test/integration_test.c b/examples/evkbmimxrt1060/test/integration_test.c deleted file mode 100644 index fd72b6a..0000000 --- a/examples/evkbmimxrt1060/test/integration_test.c +++ /dev/null @@ -1,322 +0,0 @@ -/* - * Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - * http://www.FreeRTOS.org - * http://aws.amazon.com/freertos - */ - -/** - * @brief File implements the required stub code and task to run and pass the integration - * tests. - */ - -#include "core_pkcs11_config.h" -#include "test_param_config.h" -#include "test_execution_config.h" -#include "qualification_test.h" -#include "transport_interface_test.h" -#include "ota_pal_test.h" -#include "mqtt_test.h" -#include "demo_config.h" -#include "using_mbedtls.h" -#include "mflash_drv.h" -/* FreeRTOS includes. */ -#include "FreeRTOS.h" -#include "task.h" -#include "semphr.h" -#include "fsl_common.h" -#include "fsl_trng.h" - - -/** - * @brief Socket send and receive timeouts to use. Specified in milliseconds. - */ -#define mqttexampleTRANSPORT_SEND_RECV_TIMEOUT_MS ( 750 ) - -static NetworkCredentials_t xNetworkCredentials = { 0 }; -static TransportInterface_t xTransport = { 0 }; -static NetworkContext_t xNetworkContext = { 0 }; -static NetworkContext_t xSecondNetworkContext = { 0 }; - -/** - * @brief Global entry time into the application to use as a reference timestamp - * in the #prvGetTimeMs function. #prvGetTimeMs will always return the difference - * between the current time and the global entry time. This will reduce the chances - * of overflow for the 32 bit unsigned integer used for holding the timestamp. - */ -static uint32_t ulGlobalEntryTimeMs; - -/* Function declaration. */ -uint32_t MqttTestGetTimeMs( void ); - -static NetworkConnectStatus_t prvTransportNetworkConnect( void * pvNetworkContext, - TestHostInfo_t * pxHostInfo, - void * pvNetworkCredentials ) -{ - TlsTransportStatus_t xStatus; - - xStatus = TLS_FreeRTOS_Connect( pvNetworkContext, - pxHostInfo->pHostName, - pxHostInfo->port, - pvNetworkCredentials, - mqttexampleTRANSPORT_SEND_RECV_TIMEOUT_MS, - mqttexampleTRANSPORT_SEND_RECV_TIMEOUT_MS ); - - configASSERT( TLS_TRANSPORT_SUCCESS == xStatus ); - return NETWORK_CONNECT_SUCCESS; -} - - -static void prvTransportNetworkDisconnect( void * pNetworkContext ) -{ - TLS_FreeRTOS_Disconnect( pNetworkContext ); -} - -typedef struct TaskParam -{ - StaticSemaphore_t joinMutexBuffer; - SemaphoreHandle_t joinMutexHandle; - FRTestThreadFunction_t threadFunc; - void * pParam; - TaskHandle_t taskHandle; -} TaskParam_t; - -static void ThreadWrapper( void * pParam ) -{ - TaskParam_t * pTaskParam = pParam; - - if( ( pTaskParam != NULL ) && ( pTaskParam->threadFunc != NULL ) && ( pTaskParam->joinMutexHandle != NULL ) ) - { - pTaskParam->threadFunc( pTaskParam->pParam ); - - /* Give the mutex. */ - xSemaphoreGive( pTaskParam->joinMutexHandle ); - } - - vTaskDelete( NULL ); -} -/*-----------------------------------------------------------*/ - -int FRTest_GenerateRandInt() -{ - static bool first = true; - trng_config_t trngConfig; - int ret = 0; - - if( first ) - { - if( TRNG_GetDefaultConfig( &trngConfig ) != kStatus_Success ) - { - PRINTF( "TRNG_GetDefaultConfig fail.\n" ); - return( 0 ); - } - - /* Initialize TRNG */ - if( TRNG_Init( TRNG, &trngConfig ) != kStatus_Success ) - { - PRINTF( "TRNG_Init fail.\n" ); - return( 0 ); - } - - first = false; - } - - if( TRNG_GetRandomData( TRNG, &ret, sizeof( ret ) ) != kStatus_Success ) - { - PRINTF( "TRNG_GetRandomData fail.\n" ); - } - - return ret; -} - -/*-----------------------------------------------------------*/ - -FRTestThreadHandle_t FRTest_ThreadCreate( FRTestThreadFunction_t threadFunc, - void * pParam ) -{ - TaskParam_t * pTaskParam = NULL; - FRTestThreadHandle_t threadHandle = NULL; - BaseType_t xReturned; - - pTaskParam = malloc( sizeof( TaskParam_t ) ); - configASSERT( pTaskParam != NULL ); - - pTaskParam->joinMutexHandle = xSemaphoreCreateBinaryStatic( &pTaskParam->joinMutexBuffer ); - configASSERT( pTaskParam->joinMutexHandle != NULL ); - - pTaskParam->threadFunc = threadFunc; - pTaskParam->pParam = pParam; - - xReturned = xTaskCreate( ThreadWrapper, /* Task code. */ - "ThreadWrapper", /* All tasks have same name. */ - 8192, /* Task stack size. */ - pTaskParam, /* Where the task writes its result. */ - tskIDLE_PRIORITY, /* Task priority. */ - &pTaskParam->taskHandle ); - configASSERT( xReturned == pdPASS ); - - threadHandle = pTaskParam; - - return threadHandle; -} - -/*-----------------------------------------------------------*/ - -int FRTest_ThreadTimedJoin( FRTestThreadHandle_t threadHandle, - uint32_t timeoutMs ) -{ - TaskParam_t * pTaskParam = threadHandle; - BaseType_t xReturned; - int retValue = 0; - - /* Check the parameters. */ - configASSERT( pTaskParam != NULL ); - configASSERT( pTaskParam->joinMutexHandle != NULL ); - - /* Wait for the thread. */ - xReturned = xSemaphoreTake( pTaskParam->joinMutexHandle, pdMS_TO_TICKS( timeoutMs ) ); - - if( xReturned != pdTRUE ) - { - PRINTF( "Waiting thread exist failed after %u %d. Task abort.", timeoutMs, xReturned ); - - /* Return negative value to indicate error. */ - retValue = -1; - - /* There may be used after free. Assert here to indicate error. */ - configASSERT( false ); - } - - free( pTaskParam ); - - return retValue; -} - -/*-----------------------------------------------------------*/ - -void FRTest_TimeDelay( uint32_t delayMs ) -{ - vTaskDelay( pdMS_TO_TICKS( delayMs ) ); -} - -/*-----------------------------------------------------------*/ - -void * FRTest_MemoryAlloc( size_t size ) -{ - return pvPortMalloc( size ); -} - -/*-----------------------------------------------------------*/ - -void FRTest_MemoryFree( void * ptr ) -{ - return vPortFree( ptr ); -} -/*-----------------------------------------------------------*/ - -uint32_t FRTest_GetTimeMs() -{ - return MqttTestGetTimeMs(); -} -/*-----------------------------------------------------------*/ - -uint32_t MqttTestGetTimeMs( void ) -{ - TickType_t xTickCount = 0; - uint32_t ulTimeMs = 0UL; - - /* Get the current tick count. */ - xTickCount = xTaskGetTickCount(); - - /* Convert the ticks to milliseconds. */ - ulTimeMs = ( uint32_t ) ( xTickCount * 1000 / configTICK_RATE_HZ ); - - /* Reduce ulGlobalEntryTimeMs from obtained time so as to always return the - * elapsed time in the application. */ - ulTimeMs = ( uint32_t ) ( ulTimeMs - ulGlobalEntryTimeMs ); - - return ulTimeMs; -} -/*-----------------------------------------------------------*/ - -#if ( MQTT_TEST_ENABLED == 1 ) -void SetupMqttTestParam( MqttTestParam_t * pTestParam ) -{ - configASSERT( pTestParam != NULL ); - - /* Initialization of timestamp for MQTT. */ - ulGlobalEntryTimeMs = MqttTestGetTimeMs(); - - /* Setup the transport interface. */ - xTransport.send = TLS_FreeRTOS_Send; - xTransport.recv = TLS_FreeRTOS_Recv; - - xNetworkCredentials.pRootCa = ( unsigned char * ) democonfigROOT_CA_PEM; - xNetworkCredentials.rootCaSize = sizeof( democonfigROOT_CA_PEM ); - xNetworkCredentials.pClientCertLabel = pkcs11configLABEL_DEVICE_CERTIFICATE_FOR_TLS; - xNetworkCredentials.pPrivateKeyLabel = pkcs11configLABEL_DEVICE_PRIVATE_KEY_FOR_TLS; - xNetworkCredentials.disableSni = pdFALSE; - - pTestParam->pTransport = &xTransport; - pTestParam->pNetworkContext = &xNetworkContext; - pTestParam->pSecondNetworkContext = &xSecondNetworkContext; - pTestParam->pNetworkConnect = prvTransportNetworkConnect; - pTestParam->pNetworkDisconnect = prvTransportNetworkDisconnect; - pTestParam->pNetworkCredentials = &xNetworkCredentials; - pTestParam->pGetTimeMs = MqttTestGetTimeMs; -} -#endif /* TRANSPORT_INTERFACE_TEST_ENABLED == 1 */ -/*-----------------------------------------------------------*/ - -#if ( TRANSPORT_INTERFACE_TEST_ENABLED == 1 ) -void SetupTransportTestParam( TransportTestParam_t * pTestParam ) -{ - configASSERT( pTestParam != NULL ); - /* Setup the transport interface. */ - xTransport.send = TLS_FreeRTOS_Send; - xTransport.recv = TLS_FreeRTOS_Recv; - - xNetworkCredentials.pRootCa = ( unsigned char * ) ECHO_SERVER_ROOT_CA; - xNetworkCredentials.rootCaSize = sizeof( ECHO_SERVER_ROOT_CA ); - xNetworkCredentials.pClientCertLabel = pkcs11configLABEL_DEVICE_CERTIFICATE_FOR_TLS; - xNetworkCredentials.pPrivateKeyLabel = pkcs11configLABEL_DEVICE_PRIVATE_KEY_FOR_TLS; - xNetworkCredentials.disableSni = pdFALSE; - - pTestParam->pTransport = &xTransport; - pTestParam->pNetworkContext = &xNetworkContext; - pTestParam->pSecondNetworkContext = &xSecondNetworkContext; - pTestParam->pNetworkConnect = prvTransportNetworkConnect; - pTestParam->pNetworkDisconnect = prvTransportNetworkDisconnect; - pTestParam->pNetworkCredentials = &xNetworkCredentials; -} -#endif /* if ( TRANSPORT_INTERFACE_TEST_ENABLED == 1 ) */ - -#if ( OTA_PAL_TEST_ENABLED == 1 ) -void SetupOtaPalTestParam( OtaPalTestParam_t * pTestParam ) -{ - pTestParam->pageSize = MFLASH_PAGE_SIZE; -} -#endif /* if ( OTA_PAL_TEST_ENABLED == 1 ) */ - -void prvQualificationTestTask( void * pvParameters ) -{ - RunQualificationTest(); - vTaskDelete( NULL ); -} diff --git a/examples/evkbmimxrt1060/test/linkscripts/bss.ldt b/examples/evkbmimxrt1060/test/linkscripts/bss.ldt deleted file mode 100644 index ef9ef1f..0000000 --- a/examples/evkbmimxrt1060/test/linkscripts/bss.ldt +++ /dev/null @@ -1,3 +0,0 @@ - <#if memory.name=="SRAM_OC"> - *(.bss*) - diff --git a/examples/evkbmimxrt1060/test/linkscripts/data.ldt b/examples/evkbmimxrt1060/test/linkscripts/data.ldt deleted file mode 100644 index 83ab5fe..0000000 --- a/examples/evkbmimxrt1060/test/linkscripts/data.ldt +++ /dev/null @@ -1,6 +0,0 @@ - <#if memory.name=="SRAM_ITC"> - *mflash_drv.o(.text .text* .rodata .rodata*) - *fsl_flexspi.o(.text .text* .rodata .rodata*) - *ota_pal.o(.text .text* .rodata .rodata*) - *flexspi_nor_flash_ops.o(.text .text* .rodata .rodata*) - diff --git a/examples/evkbmimxrt1060/test/linkscripts/main_text.ldt b/examples/evkbmimxrt1060/test/linkscripts/main_text.ldt deleted file mode 100644 index b25f306..0000000 --- a/examples/evkbmimxrt1060/test/linkscripts/main_text.ldt +++ /dev/null @@ -1 +0,0 @@ - *(EXCLUDE_FILE(*mflash_drv.o *fsl_flexspi.o *ota_pal.o *flexspi_nor_flash_ops.o) .text*) \ No newline at end of file diff --git a/examples/evkbmimxrt1060/test/main.c b/examples/evkbmimxrt1060/test/main.c deleted file mode 100644 index 09c0024..0000000 --- a/examples/evkbmimxrt1060/test/main.c +++ /dev/null @@ -1,474 +0,0 @@ -/* - * Lab-Project-coreMQTT-Agent 201215 - * Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - * http://www.FreeRTOS.org - * http://aws.amazon.com/freertos - */ - -/* FreeRTOS kernel includes. */ -#include "FreeRTOS.h" -#include "task.h" -#include "queue.h" -#include "timers.h" - -/* Freescale includes. */ -#include "fsl_device_registers.h" -#include "fsl_debug_console.h" -#include "pin_mux.h" -#include "clock_config.h" -#include "board.h" - -#include "fsl_phy.h" -/* lwIP Includes */ -#include "lwip/tcpip.h" -#include "lwip/dhcp.h" -#include "lwip/prot/dhcp.h" -#include "netif/ethernet.h" -#include "enet_ethernetif.h" -#include "lwip/netifapi.h" -#include "fsl_phyksz8081.h" -#include "fsl_enet_mdio.h" -#include "fsl_gpio.h" -#include "fsl_iomuxc.h" - -#include "ksdk_mbedtls.h" - -#include "nxLog_App.h" -#include "mflash_drv.h" - -#include "ex_sss_boot.h" - -#include "mflash_file.h" -#include "kvstore.h" - -/******************************************************************************* - * Definitions - ******************************************************************************/ -#ifndef EXAMPLE_NETIF_INIT_FN -/*! @brief Network interface initialization function. */ -#define EXAMPLE_NETIF_INIT_FN ethernetif0_init -#endif /* EXAMPLE_NETIF_INIT_FN */ - -/* MAC address configuration. */ -#define configMAC_ADDR \ - { \ - 0x02, 0x12, 0x13, 0x10, 0x15, 0x25 \ - } - -/* Address of PHY interface. */ -#define EXAMPLE_PHY_ADDRESS BOARD_ENET0_PHY_ADDRESS - -/* MDIO operations. */ -#define EXAMPLE_MDIO_OPS enet_ops - -/* PHY operations. */ -#define EXAMPLE_PHY_OPS phyksz8081_ops - -/* ENET clock frequency. */ -#define EXAMPLE_CLOCK_FREQ CLOCK_GetFreq( kCLOCK_IpgClk ) - - -/******************************************************************************* - * Prototypes - ******************************************************************************/ -void Board_InitNetwork( void ); - -static const char * prvGetDHCPStateStr( dhcp_state_enum_t state ); - - -int app_main( void ); - -/******************************************************************************* - * Variables - ******************************************************************************/ -static mdio_handle_t mdioHandle = { .ops = &EXAMPLE_MDIO_OPS }; -static phy_handle_t phyHandle = { .phyAddr = EXAMPLE_PHY_ADDRESS, .mdioHandle = &mdioHandle, .ops = &EXAMPLE_PHY_OPS }; - -struct netif ethernet_netif; - -/******************************************************************************* - * Secure element contexts - ******************************************************************************/ -static ex_sss_boot_ctx_t gex_sss_demo_boot_ctx; -ex_sss_boot_ctx_t * pex_sss_demo_boot_ctx = &gex_sss_demo_boot_ctx; - -static ex_sss_cloud_ctx_t gex_sss_demo_tls_ctx; -ex_sss_cloud_ctx_t * pex_sss_demo_tls_ctx = &gex_sss_demo_tls_ctx; - -const char * g_port_name = NULL; - -static mflash_file_t dir_template[] = -{ - { - .path = KVSTORE_FILE_PATH, - .max_size = ( MFLASH_SECTOR_SIZE * 2U ) - }, - {} -}; - -/******************************************************************************* - * Code - ******************************************************************************/ -static const char * prvGetDHCPStateStr( dhcp_state_enum_t state ) -{ - const char * pcStateStr = "UNKNOWN"; - - switch( state ) - { - case DHCP_STATE_OFF: - pcStateStr = "OFF"; - break; - - case DHCP_STATE_INIT: - pcStateStr = "INIT"; - break; - - case DHCP_STATE_REBOOTING: - pcStateStr = "REBOOTING"; - break; - - case DHCP_STATE_REBINDING: - pcStateStr = "REBINDING"; - break; - - case DHCP_STATE_RENEWING: - pcStateStr = "RENEWING"; - break; - - case DHCP_STATE_SELECTING: - pcStateStr = "SELECTING"; - break; - - case DHCP_STATE_INFORMING: - pcStateStr = "INFORMING"; - break; - - case DHCP_STATE_CHECKING: - pcStateStr = "CHECKING"; - break; - - case DHCP_STATE_PERMANENT: - pcStateStr = "PERMANENT"; - break; - - case DHCP_STATE_BOUND: - pcStateStr = "BOUND"; - break; - - case DHCP_STATE_RELEASING: - pcStateStr = "RELEASING"; - break; - - case DHCP_STATE_BACKING_OFF: - pcStateStr = "BACKING_OFF"; - break; - - default: - break; - } - - return pcStateStr; -} - -void Board_InitNetwork( void ) -{ - ip4_addr_t netif_ipaddr, netif_netmask, netif_gw; - ethernetif_config_t enet_config = - { - .phyHandle = &phyHandle, - .macAddress = configMAC_ADDR, - }; - dhcp_state_enum_t prevState = DHCP_STATE_OFF; - - mdioHandle.resource.csrClock_Hz = EXAMPLE_CLOCK_FREQ; - - IP4_ADDR( &netif_ipaddr, 0, 0, 0, 0 ); - IP4_ADDR( &netif_netmask, 0, 0, 0, 0 ); - IP4_ADDR( &netif_gw, 0, 0, 0, 0 ); - - tcpip_init( NULL, NULL ); - - netifapi_netif_add( ðernet_netif, &netif_ipaddr, &netif_netmask, &netif_gw, &enet_config, EXAMPLE_NETIF_INIT_FN, - tcpip_input ); - netifapi_netif_set_default( ðernet_netif ); - netifapi_netif_set_up( ðernet_netif ); - - PRINTF( "Getting an IP address from DHCP ...\r\n" ); - netifapi_dhcp_start( ðernet_netif ); - - struct dhcp * dhcp; - - dhcp = ( struct dhcp * ) netif_get_client_data( ðernet_netif, LWIP_NETIF_CLIENT_DATA_INDEX_DHCP ); - - while( dhcp->state != DHCP_STATE_BOUND ) - { - if( dhcp->state != prevState ) - { - PRINTF( "DHCP State: %s.\r\n", prvGetDHCPStateStr( dhcp->state ) ); - prevState = dhcp->state; - } - - vTaskDelay( 1000 ); - } - - PRINTF( "DHCP OK!\r\n" ); - - PRINTF( "IPv4 Address: %u.%u.%u.%u\r\n", - ( ( u8_t * ) ðernet_netif.ip_addr.addr )[ 0 ], - ( ( u8_t * ) ðernet_netif.ip_addr.addr )[ 1 ], - ( ( u8_t * ) ðernet_netif.ip_addr.addr )[ 2 ], - ( ( u8_t * ) ðernet_netif.ip_addr.addr )[ 3 ] ); - - PRINTF( "Subnet Mask: %u.%u.%u.%u\r\n", - ( ( u8_t * ) ðernet_netif.netmask.addr )[ 0 ], - ( ( u8_t * ) ðernet_netif.netmask.addr )[ 1 ], - ( ( u8_t * ) ðernet_netif.netmask.addr )[ 2 ], - ( ( u8_t * ) ðernet_netif.netmask.addr )[ 3 ] ); - - PRINTF( "Gateway: %u.%u.%u.%u\r\n", - ( ( u8_t * ) ðernet_netif.gw.addr )[ 0 ], - ( ( u8_t * ) ðernet_netif.gw.addr )[ 1 ], - ( ( u8_t * ) ðernet_netif.gw.addr )[ 2 ], - ( ( u8_t * ) ðernet_netif.gw.addr )[ 3 ] ); -} - -void BOARD_InitModuleClock( void ) -{ - const clock_enet_pll_config_t config = { .enableClkOutput = true, .enableClkOutput25M = false, .loopDivider = 1 }; - - CLOCK_InitEnetPll( &config ); -} - -void delay( void ) -{ - volatile uint32_t i = 0; - - for( i = 0; i < 1000000; ++i ) - { - __asm( "NOP" ); /* delay */ - } -} - - -/******************************************************************************* - * Code - ******************************************************************************/ - -/*! - * @brief Application entry point. - */ -int main( void ) -{ - gpio_pin_config_t gpio_config = { kGPIO_DigitalOutput, 0, kGPIO_NoIntmode }; - - /* Init board hardware. */ - BOARD_ConfigMPU(); - BOARD_InitBootPins(); - BOARD_InitBootClocks(); - BOARD_InitDebugConsole(); - BOARD_InitModuleClock(); - SCB_DisableDCache(); - - IOMUXC_EnableMode( IOMUXC_GPR, kIOMUXC_GPR_ENET1TxClkOutputDir, true ); - - GPIO_PinInit( GPIO1, 9, &gpio_config ); - GPIO_PinInit( GPIO1, 10, &gpio_config ); - /* pull up the ENET_INT before RESET. */ - GPIO_WritePinOutput( GPIO1, 10, 1 ); - GPIO_WritePinOutput( GPIO1, 9, 0 ); - delay(); - GPIO_WritePinOutput( GPIO1, 9, 1 ); - - if( CRYPTO_InitHardware() != 0 ) - { - PRINTF( ( "\r\nFailed to initialize MBEDTLS crypto.\r\n" ) ); - - while( 1 ) - { - /* Empty while. */ - } - } - - if( mflash_drv_init() != 0 ) - { - PRINTF( ( "\r\nFailed to initialize flash driver.\r\n" ) ); - - while( 1 ) - { - /* Empty while. */ - } - } - - vTaskStartScheduler(); - - /* Should not reach here. */ - for( ; ; ) - { - } -} - -void vApplicationDaemonTaskStartupHook( void ) -{ - /* Initialize file system. */ - if( mflash_init( dir_template, false ) != kStatus_Success ) - { - PRINTF( "\r\nFailed to initialize file system.\r\n" ); - - for( ; ; ) - { - __asm( "NOP" ); - } - } - - /* Initialize network. */ - Board_InitNetwork(); - - /* Initialize Logging locks */ - if( nLog_Init() != 0 ) - { - PRINTF( "\r\nLogging initialization failed.\r\n" ); - - for( ; ; ) - { - __asm( "NOP" ); - } - } - - if( app_main() != pdPASS ) - { - PRINTF( "\r\nApp main initialization failed.\r\n" ); - - for( ; ; ) - { - __asm( "NOP" ); - } - } -} - -/** - * @brief Loop forever if stack overflow is detected. - * - * If configCHECK_FOR_STACK_OVERFLOW is set to 1, - * this hook provides a location for applications to - * define a response to a stack overflow. - * - * Use this hook to help identify that a stack overflow - * has occurred. - * - */ -void vApplicationStackOverflowHook( TaskHandle_t xTask, - char * pcTaskName ) -{ - PRINTF( "ERROR: stack overflow on task %s.\r\n", pcTaskName ); - - portDISABLE_INTERRUPTS(); - - /* Unused Parameters */ - ( void ) xTask; - ( void ) pcTaskName; - - /* Loop forever */ - for( ; ; ) - { - __asm( "NOP" ); - } -} - -/** - * @brief Warn user if pvPortMalloc fails. - * - * Called if a call to pvPortMalloc() fails because there is insufficient - * free memory available in the FreeRTOS heap. pvPortMalloc() is called - * internally by FreeRTOS API functions that create tasks, queues, software - * timers, and semaphores. The size of the FreeRTOS heap is set by the - * configTOTAL_HEAP_SIZE configuration constant in FreeRTOSConfig.h. - * - */ -void vApplicationMallocFailedHook() -{ - PRINTF( "ERROR: Malloc failed to allocate memory\r\n" ); - taskDISABLE_INTERRUPTS(); - - /* Loop forever */ - for( ; ; ) - { - } -} - -/*-----------------------------------------------------------*/ - -/* configUSE_STATIC_ALLOCATION is set to 1, so the application must provide an - * implementation of vApplicationGetIdleTaskMemory() to provide the memory that is - * used by the Idle task. */ -void vApplicationGetIdleTaskMemory( StaticTask_t ** ppxIdleTaskTCBBuffer, - StackType_t ** ppxIdleTaskStackBuffer, - uint32_t * pulIdleTaskStackSize ) -{ - /* If the buffers to be provided to the Idle task are declared inside this - * function then they must be declared static - otherwise they will be allocated on - * the stack and so not exists after this function exits. */ - static StaticTask_t xIdleTaskTCB; - static StackType_t uxIdleTaskStack[ configMINIMAL_STACK_SIZE ]; - - /* Pass out a pointer to the StaticTask_t structure in which the Idle - * task's state will be stored. */ - *ppxIdleTaskTCBBuffer = &xIdleTaskTCB; - - /* Pass out the array that will be used as the Idle task's stack. */ - *ppxIdleTaskStackBuffer = uxIdleTaskStack; - - /* Pass out the size of the array pointed to by *ppxIdleTaskStackBuffer. - * Note that, as the array is necessarily of type StackType_t, - * configMINIMAL_STACK_SIZE is specified in words, not bytes. */ - *pulIdleTaskStackSize = configMINIMAL_STACK_SIZE; -} -/*-----------------------------------------------------------*/ - -/** - * @brief This is to provide the memory that is used by the RTOS daemon/time task. - * - * If configUSE_STATIC_ALLOCATION is set to 1, so the application must provide an - * implementation of vApplicationGetTimerTaskMemory() to provide the memory that is - * used by the RTOS daemon/time task. - */ -void vApplicationGetTimerTaskMemory( StaticTask_t ** ppxTimerTaskTCBBuffer, - StackType_t ** ppxTimerTaskStackBuffer, - uint32_t * pulTimerTaskStackSize ) -{ - /* If the buffers to be provided to the Timer task are declared inside this - * function then they must be declared static - otherwise they will be allocated on - * the stack and so not exists after this function exits. */ - static StaticTask_t xTimerTaskTCB; - static StackType_t uxTimerTaskStack[ configTIMER_TASK_STACK_DEPTH ]; - - /* Pass out a pointer to the StaticTask_t structure in which the Idle - * task's state will be stored. */ - *ppxTimerTaskTCBBuffer = &xTimerTaskTCB; - - /* Pass out the array that will be used as the Timer task's stack. */ - *ppxTimerTaskStackBuffer = uxTimerTaskStack; - - /* Pass out the size of the array pointed to by *ppxTimerTaskStackBuffer. - * Note that, as the array is necessarily of type StackType_t, - * configMINIMAL_STACK_SIZE is specified in words, not bytes. */ - *pulTimerTaskStackSize = configTIMER_TASK_STACK_DEPTH; -} -/*-----------------------------------------------------------*/ diff --git a/examples/evkbmimxrt1060/test/manifest.yml b/examples/evkbmimxrt1060/test/manifest.yml deleted file mode 100644 index c94099e..0000000 --- a/examples/evkbmimxrt1060/test/manifest.yml +++ /dev/null @@ -1,13 +0,0 @@ -name : "nxprt1060" -version: "0.0.1" -description: |- - "qualification test" -dependencies: - - name: "Labs-FreeRTOS-Libraries-Integration-Tests" - version: "v1.0.0" - repository: - type: "git" - url: "https://github.com/FreeRTOS/Labs-FreeRTOS-Libraries-Integration-Tests" - path: "/Labs-FreeRTOS-Libraries-Integration-Tests" - -license: "MIT" diff --git a/examples/evkbmimxrt1060/test/pub_sub_test_task.c b/examples/evkbmimxrt1060/test/pub_sub_test_task.c deleted file mode 100644 index fc2243f..0000000 --- a/examples/evkbmimxrt1060/test/pub_sub_test_task.c +++ /dev/null @@ -1,505 +0,0 @@ -/* - * Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - * http://www.FreeRTOS.org - * http://aws.amazon.com/freertos - */ - - -/** - * @brief A test application which loops through subscribing to a topic and publishing message - * to a topic. This test application can be used with AWS IoT device advisor test suite to - * verify that an application implemented using MQTT agent follows best practices in connecting - * to AWS IoT core. - */ -/* Standard includes. */ -#include -#include -#include - -/* Kernel includes. */ -#include "FreeRTOS.h" -#include "task.h" -#include "queue.h" - -/* Demo Specific configs. */ -#include "demo_config.h" - -/* MQTT library includes. */ -#include "core_mqtt.h" - -/* MQTT agent include. */ -#include "core_mqtt_agent.h" - -/* MQTT agent task API. */ -#include "mqtt_agent_task.h" - - -/** - * @brief A test application which loops through subscribing to a topic and publishing message - * to a topic. This test application can be used with AWS IoT device advisor test suite to - * verify that an application implemented using MQTT agent follows best practices in connecting - * to AWS IoT core. - */ -#define configMS_TO_WAIT_FOR_NOTIFICATION ( 10000 ) - -/** - * @brief Delay for the synchronous publisher task between publishes. - */ -#define configDELAY_BETWEEN_PUBLISH_OPERATIONS_MS ( 2000U ) - -/** - * @brief The maximum amount of time in milliseconds to wait for the commands - * to be posted to the MQTT agent should the MQTT agent's command queue be full. - * Tasks wait in the Blocked state, so don't use any CPU time. - */ -#define configMAX_COMMAND_SEND_BLOCK_TIME_MS ( 500 ) - -/** - * @brief Size of statically allocated buffers for holding payloads. - */ -#define confgPAYLOAD_BUFFER_LENGTH ( 100 ) - -/** - * @brief Format of topic used to publish outgoing messages. - */ -#define configPUBLISH_TOPIC_FORMAT "mqtt_test/outgoing" - -/** - * @brief Size of the static buffer to hold the topic name. - */ -#define configPUBLISH_TOPIC_BUFFER_LENGTH ( sizeof( configPUBLISH_TOPIC_FORMAT ) - 1 ) - - -/** - * @brief Format of topic used to subscribe to incoming messages. - * - */ -#define configSUBSCRIBE_TOPIC_FORMAT "mqtt_test/incoming" - -/** - * @brief Size of the static buffer to hold the topic name. - */ -#define configSUBSCRIBE_TOPIC_BUFFER_LENGTH ( sizeof( configSUBSCRIBE_TOPIC_FORMAT ) - 1 ) - -/*-----------------------------------------------------------*/ - -/** - * @brief Defines the structure to use as the command callback context in this - * demo. - */ -struct MQTTAgentCommandContext -{ - TaskHandle_t xTaskToNotify; - void * pArgs; -}; - -/*-----------------------------------------------------------*/ - -/** - * @brief Passed into MQTTAgent_Subscribe() as the callback to execute when the - * broker ACKs the SUBSCRIBE message. Its implementation sends a notification - * to the task that called MQTTAgent_Subscribe() to let the task know the - * SUBSCRIBE operation completed. It also sets the xReturnStatus of the - * structure passed in as the command's context to the value of the - * xReturnStatus parameter - which enables the task to check the status of the - * operation. - * - * See https://freertos.org/mqtt/mqtt-agent-demo.html#example_mqtt_api_call - * - * @param[in] pxCommandContext Context of the initial command. - * @param[in].xReturnStatus The result of the command. - */ -static void prvSubscribeCommandCallback( MQTTAgentCommandContext_t * pxCommandContext, - MQTTAgentReturnInfo_t * pxReturnInfo ); - -/** - * @brief Passed into MQTTAgent_Publish() as the callback to execute when the - * broker ACKs the PUBLISH message. Its implementation sends a notification - * to the task that called MQTTAgent_Publish() to let the task know the - * PUBLISH operation completed. It also sets the xReturnStatus of the - * structure passed in as the command's context to the value of the - * xReturnStatus parameter - which enables the task to check the status of the - * operation. - * - * See https://freertos.org/mqtt/mqtt-agent-demo.html#example_mqtt_api_call - * - * @param[in] pxCommandContext Context of the initial command. - * @param[in].xReturnStatus The result of the command. - */ -static void prvPublishCommandCallback( MQTTAgentCommandContext_t * pxCommandContext, - MQTTAgentReturnInfo_t * pxReturnInfo ); - -/** - * @brief Passed into MQTTAgent_Subscribe() as the callback to execute when - * there is an incoming publish on the topic being subscribed to. Its - * implementation just logs information about the incoming publish including - * the publish messages source topic and payload. - * - * See https://freertos.org/mqtt/mqtt-agent-demo.html#example_mqtt_api_call - * - * @param[in] pvIncomingPublishCallbackContext Context of the initial command. - * @param[in] pxPublishInfo Deserialized publish. - */ -static void prvIncomingPublishCallback( void * pvIncomingPublishCallbackContext, - MQTTPublishInfo_t * pxPublishInfo ); - -/** - * @brief Subscribe to the topic the demo task will also publish to - that - * results in all outgoing publishes being published back to the task - * (effectively echoed back). - * - * @param[in] xQoS The quality of service (QoS) to use. Can be zero or one - * for all MQTT brokers. Can also be QoS2 if supported by the broker. AWS IoT - * does not support QoS2. - */ -static MQTTStatus_t prvSubscribeToTopic( MQTTQoS_t xQoS, - char * pcTopicFilter ); - - - -/** - * @brief Publishes the given payload using the given qos to the topic provided. - * - * Function queues a publish command with the MQTT agent and waits for response. For - * Qos0 publishes command is successful when the message is sent out of network. For Qos1 - * publishes, the command succeeds once a puback is received. If publish is unsuccessful, the function - * retries the publish for a configure number of tries. - * - * @param[in] xQoS The quality of service (QoS) to use. Can be zero or one - * for all MQTT brokers. Can also be QoS2 if supported by the broker. AWS IoT - * does not support QoS2. - * @param[in] pcTopic NULL terminated topic string to which message is published. - * @param[in] pucPayload The payload blob to be published. - * @param[in] xPayloadLength Length of the payload blob to be published. - */ -static MQTTStatus_t prvPublishToTopic( MQTTQoS_t xQoS, - char * pcTopic, - uint8_t * pucPayload, - size_t xPayloadLength ); - -/** - * @brief The function that implements the task demonstrated by this file. - * - * @param pvParameters The parameters to the task. - */ -void vSubscribePublishTestTask( void * pvParameters ); - -/*-----------------------------------------------------------*/ - -/** - * @brief The MQTT agent manages the MQTT contexts. This set the handle to the - * context used by this demo. - */ -extern MQTTAgentContext_t xGlobalMqttAgentContext; - -/*-----------------------------------------------------------*/ - -static void prvPublishCommandCallback( MQTTAgentCommandContext_t * pxCommandContext, - MQTTAgentReturnInfo_t * pxReturnInfo ) -{ - if( pxCommandContext->xTaskToNotify != NULL ) - { - xTaskNotify( pxCommandContext->xTaskToNotify, - pxReturnInfo->returnCode, - eSetValueWithOverwrite ); - } -} - -/*-----------------------------------------------------------*/ - -static void prvSubscribeCommandCallback( MQTTAgentCommandContext_t * pxCommandContext, - MQTTAgentReturnInfo_t * pxReturnInfo ) -{ - BaseType_t xSubscriptionAdded; - MQTTAgentSubscribeArgs_t * pxSubscribeArgs = ( MQTTAgentSubscribeArgs_t * ) pxCommandContext->pArgs; - - /* Check if the subscribe operation is a success. Only one topic is - * subscribed by this demo. */ - if( pxReturnInfo->returnCode == MQTTSuccess ) - { - /* Add subscription so that incoming publishes are routed to the application - * callback. */ - xSubscriptionAdded = xAddMQTTTopicFilterCallback( - pxSubscribeArgs->pSubscribeInfo->pTopicFilter, - pxSubscribeArgs->pSubscribeInfo->topicFilterLength, - prvIncomingPublishCallback, - NULL, - pdTRUE ); - configASSERT( xSubscriptionAdded == pdTRUE ); - } - - xTaskNotify( pxCommandContext->xTaskToNotify, - ( uint32_t ) ( pxReturnInfo->returnCode ), - eSetValueWithOverwrite ); -} -/*-----------------------------------------------------------*/ - -static void prvIncomingPublishCallback( void * pvIncomingPublishCallbackContext, - MQTTPublishInfo_t * pxPublishInfo ) -{ - static char cTerminatedString[ confgPAYLOAD_BUFFER_LENGTH ]; - - ( void ) pvIncomingPublishCallbackContext; - - /* Create a message that contains the incoming MQTT payload to the logger, - * terminating the string first. */ - if( pxPublishInfo->payloadLength < confgPAYLOAD_BUFFER_LENGTH ) - { - memcpy( ( void * ) cTerminatedString, pxPublishInfo->pPayload, pxPublishInfo->payloadLength ); - cTerminatedString[ pxPublishInfo->payloadLength ] = 0x00; - } - else - { - memcpy( ( void * ) cTerminatedString, pxPublishInfo->pPayload, confgPAYLOAD_BUFFER_LENGTH ); - cTerminatedString[ confgPAYLOAD_BUFFER_LENGTH - 1 ] = 0x00; - } - - LogInfo( ( "Received incoming publish message %s", cTerminatedString ) ); -} - -/*-----------------------------------------------------------*/ - -static MQTTStatus_t prvSubscribeToTopic( MQTTQoS_t xQoS, - char * pcTopicFilter ) -{ - MQTTStatus_t xMQTTStatus; - BaseType_t xNotifyStatus = pdFALSE; - MQTTAgentSubscribeArgs_t xSubscribeArgs; - MQTTSubscribeInfo_t xSubscribeInfo; - MQTTAgentCommandContext_t xCommandContext = { 0UL }; - MQTTAgentCommandInfo_t xCommandParams = { 0UL }; - uint32_t ulNotifiedValue = 0UL; - - xTaskNotifyStateClear( NULL ); - - /* Complete the subscribe information. The topic string must persist for - * duration of subscription! */ - xSubscribeInfo.pTopicFilter = pcTopicFilter; - xSubscribeInfo.topicFilterLength = ( uint16_t ) strlen( pcTopicFilter ); - xSubscribeInfo.qos = xQoS; - xSubscribeArgs.pSubscribeInfo = &xSubscribeInfo; - xSubscribeArgs.numSubscriptions = 1; - - /* Complete an application defined context associated with this subscribe message. - * This gets updated in the callback function so the variable must persist until - * the callback executes. */ - xCommandContext.xTaskToNotify = xTaskGetCurrentTaskHandle(); - xCommandContext.pArgs = ( void * ) &xSubscribeArgs; - - xCommandParams.blockTimeMs = configMAX_COMMAND_SEND_BLOCK_TIME_MS; - xCommandParams.cmdCompleteCallback = prvSubscribeCommandCallback; - xCommandParams.pCmdCompleteCallbackContext = ( void * ) &xCommandContext; - - /* Loop in case the queue used to communicate with the MQTT agent is full and - * attempts to post to it time out. The queue will not become full if the - * priority of the MQTT agent task is higher than the priority of the task - * calling this function. */ - do - { - xMQTTStatus = MQTTAgent_Subscribe( &xGlobalMqttAgentContext, - &xSubscribeArgs, - &xCommandParams ); - - if( xMQTTStatus == MQTTSuccess ) - { - xNotifyStatus = xTaskNotifyWait( 0, - 0, - &ulNotifiedValue, - portMAX_DELAY ); - - if( xNotifyStatus == pdTRUE ) - { - xMQTTStatus = ( MQTTStatus_t ) ( ulNotifiedValue ); - } - else - { - xMQTTStatus = MQTTRecvFailed; - } - } - } while( xMQTTStatus != MQTTSuccess ); - - return xMQTTStatus; -} -/*-----------------------------------------------------------*/ - - -static MQTTStatus_t prvPublishToTopic( MQTTQoS_t xQoS, - char * pcTopic, - uint8_t * pucPayload, - size_t xPayloadLength ) -{ - MQTTPublishInfo_t xPublishInfo = { 0UL }; - MQTTAgentCommandContext_t xCommandContext = { 0 }; - MQTTStatus_t xMQTTStatus; - BaseType_t xNotifyStatus; - MQTTAgentCommandInfo_t xCommandParams = { 0UL }; - uint32_t ulNotifiedValue = 0U; - - /* Create a unique number of the subscribe that is about to be sent. The number - * is used as the command context and is sent back to this task as a notification - * in the callback that executed upon receipt of the subscription acknowledgment. - * That way this task can match an acknowledgment to a subscription. */ - xTaskNotifyStateClear( NULL ); - - /* Configure the publish operation. */ - xPublishInfo.qos = xQoS; - xPublishInfo.pTopicName = pcTopic; - xPublishInfo.topicNameLength = ( uint16_t ) strlen( pcTopic ); - xPublishInfo.pPayload = pucPayload; - xPublishInfo.payloadLength = xPayloadLength; - - xCommandContext.xTaskToNotify = xTaskGetCurrentTaskHandle(); - - xCommandParams.blockTimeMs = configMAX_COMMAND_SEND_BLOCK_TIME_MS; - xCommandParams.cmdCompleteCallback = prvPublishCommandCallback; - xCommandParams.pCmdCompleteCallbackContext = &xCommandContext; - - /* Loop in case the queue used to communicate with the MQTT agent is full and - * attempts to post to it time out. The queue will not become full if the - * priority of the MQTT agent task is higher than the priority of the task - * calling this function. */ - do - { - xMQTTStatus = MQTTAgent_Publish( &xGlobalMqttAgentContext, - &xPublishInfo, - &xCommandParams ); - - if( xMQTTStatus == MQTTSuccess ) - { - /* Wait for this task to get notified, passing out the value it gets notified with. */ - xNotifyStatus = xTaskNotifyWait( 0, - 0, - &ulNotifiedValue, - portMAX_DELAY ); - - if( xNotifyStatus == pdTRUE ) - { - xMQTTStatus = ( MQTTStatus_t ) ( ulNotifiedValue ); - } - else - { - xMQTTStatus = MQTTRecvFailed; - } - } - } while( xMQTTStatus != MQTTSuccess ); - - return xMQTTStatus; -} - -/*-----------------------------------------------------------*/ - - -void vSubscribePublishTestTask( void * pvParameters ) -{ - char cPayloadBuf[ confgPAYLOAD_BUFFER_LENGTH ]; - size_t xPayloadLength; - uint32_t ulPublishCount = 0U, ulSuccessCount = 0U, ulFailCount = 0U; - BaseType_t xStatus = pdPASS; - MQTTStatus_t xMQTTStatus; - MQTTQoS_t xQoS; - TickType_t xTicksToDelay; - - if( xStatus == pdPASS ) - { - configASSERT( xGetMQTTAgentState() != MQTT_AGENT_STATE_NONE ); - - if( xGetMQTTAgentState() != MQTT_AGENT_STATE_CONNECTED ) - { - ( void ) ( xWaitForMQTTAgentState( MQTT_AGENT_STATE_CONNECTED, portMAX_DELAY ) ); - } - - LogInfo( ( "MQTT Agent is connected. Starting the publish subscribe task. " ) ); - } - - if( xStatus == pdPASS ) - { - xMQTTStatus = prvSubscribeToTopic( MQTTQoS1, - configSUBSCRIBE_TOPIC_FORMAT ); - - if( xMQTTStatus != MQTTSuccess ) - { - LogError( ( "Failed to subscribe to topic: %s.", configSUBSCRIBE_TOPIC_FORMAT ) ); - xStatus = pdFAIL; - } - } - - if( xStatus == pdPASS ) - { - /* Loop through infinitely. */ - for( ; ; ) - { - /* Have different tasks use different QoS. 0 and 1. 2 can also be used - * if supported by the broker. */ - xQoS = ( MQTTQoS_t ) ( ( ulPublishCount + 1 ) % 2UL ); - - - /* Create a payload to send with the publish message. This contains - * the task name and an incrementing number. */ - xPayloadLength = snprintf( cPayloadBuf, - confgPAYLOAD_BUFFER_LENGTH, - "Test message %lu", - ( ulPublishCount + 1 ) ); - - /* Assert if the buffer length is large enough to hold the message. */ - configASSERT( xPayloadLength <= confgPAYLOAD_BUFFER_LENGTH ); - - LogInfo( ( "Sending publish message to topic: %s with qos: %d, message : %*s", - configPUBLISH_TOPIC_FORMAT, - xQoS, - xPayloadLength, - ( char * ) cPayloadBuf ) ); - - xMQTTStatus = prvPublishToTopic( xQoS, - configPUBLISH_TOPIC_FORMAT, - ( uint8_t * ) cPayloadBuf, - xPayloadLength ); - - if( xMQTTStatus == MQTTSuccess ) - { - ulSuccessCount++; - LogInfo( ( "Successfully sent QoS %u publish to topic: %s (PassCount:%d, FailCount:%d).", - xQoS, - configPUBLISH_TOPIC_FORMAT, - ulSuccessCount, - ulFailCount ) ); - } - else - { - ulFailCount++; - LogError( ( "Timed out while sending QoS %u publish to topic: %s (PassCount:%d, FailCount: %d)", - xQoS, - configPUBLISH_TOPIC_FORMAT, - ulSuccessCount, - ulFailCount ) ); - } - - /* Add a little randomness into the delay so the tasks don't remain - * in lockstep. */ - xTicksToDelay = pdMS_TO_TICKS( configDELAY_BETWEEN_PUBLISH_OPERATIONS_MS ) + - ( xTaskGetTickCount() % 0xff ); - vTaskDelay( xTicksToDelay ); - - ulPublishCount++; - } - } - - vTaskDelete( NULL ); -} diff --git a/examples/evkbmimxrt1060/test/semihost_hardfault.c b/examples/evkbmimxrt1060/test/semihost_hardfault.c deleted file mode 100644 index d6e43ca..0000000 --- a/examples/evkbmimxrt1060/test/semihost_hardfault.c +++ /dev/null @@ -1,98 +0,0 @@ -/* **************************************************************************** */ -/* semihost_hardfault.c */ -/* - Provides hard fault handler to allow semihosting code not */ -/* to hang application when debugger not connected. */ -/* */ -/* **************************************************************************** */ -/* Copyright 2017-2021 NXP */ -/* All rights reserved. */ -/* */ -/* NXP Confidential. This software is owned or controlled by NXP and may only be */ -/* used strictly in accordance with the applicable license terms. */ -/* */ -/* By expressly accepting such terms or by downloading, installing, activating */ -/* and/or otherwise using the software, you are agreeing that you have read, and */ -/* that you agree to comply with and are bound by, such license terms. */ -/* */ -/* If you do not agree to be bound by the applicable license terms, then you may not */ -/* retain, install, activate or otherwise use the software. */ -/* **************************************************************************** */ -/* */ -/* ===== DESCRIPTION ===== */ -/* */ -/* One of the issues with applications that make use of semihosting operations */ -/* (such as printf calls) is that the code will not execute correctly when the */ -/* debugger is not connected. Generally this will show up with the application */ -/* appearing to just hang. This may include the application running from reset */ -/* or powering up the board (with the application already in FLASH), and also */ -/* as the application failing to continue to execute after a debug session is */ -/* terminated. */ -/* */ -/* The problem here is that the "bottom layer" of the semihosted variants of */ -/* the C library, semihosting is implemented by a "BKPT 0xAB" instruction. */ -/* When the debug tools are not connected, this instruction triggers a hard */ -/* fault - and the default hard fault handler within an application will */ -/* typically just contains an infinite loop - causing the application to */ -/* appear to have hang when no debugger is connected. */ -/* */ -/* The below code provides an example hard fault handler which instead looks */ -/* to see what the instruction that caused the hard fault was - and if it */ -/* was a "BKPT 0xAB", then it instead returns back to the user application. */ -/* */ -/* In most cases this will allow applications containing semihosting */ -/* operations to execute (to some degree) when the debugger is not connected. */ -/* */ -/* == NOTE == */ -/* */ -/* Correct execution of the application containing semihosted operations */ -/* which are vectored onto this hard fault handler cannot be guaranteed. This */ -/* is because the handler may not return data or return codes that the higher */ -/* level C library code or application code expects. This hard fault handler */ -/* is meant as a development aid, and it is not recommended to leave */ -/* semihosted code in a production build of your application! */ -/* */ -/* **************************************************************************** */ - -/* Allow handler to be removed by setting a define (via command line) */ -#if !defined( __SEMIHOST_HARDFAULT_DISABLE ) - -__attribute__( ( naked ) ) -void HardFault_Handler( void ) -{ - __asm( ".syntax unified\n" - /* Check which stack is in use */ - "MOVS R0, #4 \n" - "MOV R1, LR \n" - "TST R0, R1 \n" - "BEQ _MSP \n" - "MRS R0, PSP \n" - "B _process \n" - "_MSP: \n" - "MRS R0, MSP \n" - /* Load the instruction that triggered hard fault */ - "_process: \n" - "LDR R1,[R0,#24] \n" - "LDRH R2,[r1] \n" - /* Semihosting instruction is "BKPT 0xAB" (0xBEAB) */ - "LDR R3,=0xBEAB \n" - "CMP R2,R3 \n" - "BEQ _semihost_return \n" - /* Wasn't semihosting instruction so enter infinite loop */ - "B . \n" - /* Was semihosting instruction, so adjust location to */ - /* return to by 1 instruction (2 bytes), then exit function */ - "_semihost_return: \n" - "ADDS R1,#2 \n" - "STR R1,[R0,#24] \n" - /* Set a return value from semihosting operation. */ - /* 32 is slightly arbitrary, but appears to allow most */ - /* C Library IO functions sitting on top of semihosting to */ - /* continue to operate to some degree */ - "MOVS R1,#32 \n" - "STR R1,[ R0,#0 ] \n" /* R0 is at location 0 on stack */ - /* Return from hard fault handler to application */ - "BX LR \n" - ".syntax divided\n" ); -} - -#endif /* if !defined( __SEMIHOST_HARDFAULT_DISABLE ) */ diff --git a/examples/evkbmimxrt1060/test/test_logging.c b/examples/evkbmimxrt1060/test/test_logging.c deleted file mode 100644 index b53e67d..0000000 --- a/examples/evkbmimxrt1060/test/test_logging.c +++ /dev/null @@ -1,87 +0,0 @@ -/* - * Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - * http://www.FreeRTOS.org - * http://aws.amazon.com/freertos - */ - -#include -#include "FreeRTOS.h" -#include "task.h" -#include "fsl_debug_console.h" - -#define TEST_RESULT_BUFFER_CAPACITY 1024 - -/*-----------------------------------------------------------*/ - -/* The buffer to store test result. The content will be printed if an eol character - * is received */ -static char pcTestResultBuffer[ TEST_RESULT_BUFFER_CAPACITY ]; -static int16_t xBufferSize = 0; - -/*-----------------------------------------------------------*/ - -void TEST_CacheResult( char cResult ) -{ - if( TEST_RESULT_BUFFER_CAPACITY - xBufferSize == 2 ) - { - cResult = '\n'; - } - - pcTestResultBuffer[ xBufferSize++ ] = cResult; - - if( ( '\n' == cResult ) ) - { - TEST_SubmitResultBuffer(); - } -} -/*-----------------------------------------------------------*/ - -void TEST_SubmitResultBuffer() -{ - if( 0 != xBufferSize ) - { - TEST_SubmitResult( pcTestResultBuffer ); - memset( pcTestResultBuffer, 0, TEST_RESULT_BUFFER_CAPACITY ); - xBufferSize = 0; - } -} -/*-----------------------------------------------------------*/ - -void TEST_NotifyTestStart() -{ - TEST_SubmitResult( "---------STARTING TESTS---------\n" ); -} -/*-----------------------------------------------------------*/ - -void TEST_NotifyTestFinished() -{ - TEST_SubmitResult( "-------ALL TESTS FINISHED-------\n" ); -} -/*-----------------------------------------------------------*/ - -void TEST_SubmitResult( const char * pcResult ) -{ - /* We want to print test result no matter configPRINTF is defined or not */ - PRINTF( pcResult ); - - /* Wait for 0.1 seconds to let print task empty its buffer. */ - vTaskDelay( pdMS_TO_TICKS( 100UL ) ); -} diff --git a/examples/evkbmimxrt1060/test/test_logging.h b/examples/evkbmimxrt1060/test/test_logging.h deleted file mode 100644 index 209b3d1..0000000 --- a/examples/evkbmimxrt1060/test/test_logging.h +++ /dev/null @@ -1,14 +0,0 @@ -#ifndef TEST_LOGGING_H -#define TEST_LOGGING_H - -void TEST_CacheResult( char cResult ); - -void TEST_SubmitResultBuffer( void ); - -void TEST_NotifyTestStart( void ); - -void TEST_NotifyTestFinished( void ); - -void TEST_SubmitResult( const char * pcResult ); - -#endif /* TEST_LOGGING_H */ diff --git a/examples/evkbmimxrt1060/test/unity_config.h b/examples/evkbmimxrt1060/test/unity_config.h deleted file mode 100644 index 60f4f26..0000000 --- a/examples/evkbmimxrt1060/test/unity_config.h +++ /dev/null @@ -1,17 +0,0 @@ -#ifndef UNITY_CONFIG_H -#define UNITY_CONFIG_H - -#ifndef UNITY_OUTPUT_CHAR - -#define UNITY_OUTPUT_CHAR( a ) TEST_CacheResult( a ) -#endif -#ifndef UNITY_OUTPUT_FLUSH -#define UNITY_OUTPUT_FLUSH() TEST_SubmitResultBuffer() -#endif -#ifndef UNITY_OUTPUT_START -#define UNITY_OUTPUT_START() TEST_NotifyTestStart() -#endif -#ifndef UNITY_OUTPUT_COMPLETE -#define UNITY_OUTPUT_COMPLETE() TEST_NotifyTestFinished() - -#endif /* UNITY_CONFIG_H */ diff --git a/projects/evkmimxrt1060/test/.cproject b/projects/evkmimxrt1060/test/.cproject deleted file mode 100644 index 9bf9959..0000000 --- a/projects/evkmimxrt1060/test/.cproject +++ /dev/null @@ -1,339 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - SDK_2.x_EVK-MIMXRT1060 - 2.12.0 - - - <?xml version="1.0" encoding="UTF-8"?> -<TargetConfig> -<Properties property_2="LPC11_12_13_32K_8K.cfx" property_3="NXP" property_4="MIMXRT1062xxxxA" property_count="5" version="100300"/> -<infoList vendor="NXP"> -<info chip="MIMXRT1062xxxxA" name="MIMXRT1062xxxxA"> -<chip> -<name>MIMXRT1062xxxxA</name> -<family>MIMXRT1060</family> -<vendor>NXP</vendor> -<memory can_program="true" id="Flash" is_ro="true" size="0" type="Flash"/> -<memory id="RAM" size="1024" type="RAM"/> -<memoryInstance derived_from="Flash" driver="MIMXRT1060_SFDP_QSPI.cfx" edited="true" id="BOARD_FLASH" location="0x60040000" size="0x1ffc00"/> -<memoryInstance derived_from="RAM" edited="true" id="SRAM_DTC" location="0x20000000" size="0x20000"/> -<memoryInstance derived_from="RAM" edited="true" id="SRAM_ITC" location="0x0" size="0x20000"/> -<memoryInstance derived_from="RAM" edited="true" id="SRAM_OC" location="0x20200000" size="0xc0000"/> -<memoryInstance derived_from="RAM" edited="true" id="BOARD_SDRAM" location="0x80000000" size="0x1e00000"/> -<memoryInstance derived_from="RAM" edited="true" id="NCACHE_REGION" location="0x81e00000" size="0x200000"/> -</chip> -<processor> -<name gcc_name="cortex-m7">Cortex-M7</name> -<family>Cortex-M</family> -</processor> -</info> -</infoList> -</TargetConfig> - - - - - - - - - - - - - - - - - - - - - diff --git a/projects/evkmimxrt1060/test/.gitignore b/projects/evkmimxrt1060/test/.gitignore deleted file mode 100644 index 3df573f..0000000 --- a/projects/evkmimxrt1060/test/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/Debug/ diff --git a/projects/evkmimxrt1060/test/.project b/projects/evkmimxrt1060/test/.project deleted file mode 100644 index 5b618a6..0000000 --- a/projects/evkmimxrt1060/test/.project +++ /dev/null @@ -1,1166 +0,0 @@ - - - aws_iot_qual_test - - - - - - org.eclipse.xtext.ui.shared.xtextBuilder - - - - - org.eclipse.cdt.managedbuilder.core.genmakebuilder - clean,full,incremental, - - - - - org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder - full,incremental, - - - - - - org.eclipse.cdt.core.cnature - org.eclipse.cdt.managedbuilder.core.managedBuildNature - org.eclipse.cdt.managedbuilder.core.ScannerConfigNature - org.eclipse.xtext.ui.shared.xtextNature - com.nxp.mcuxpresso.core.datamodels.sdkNature - - - - CMSIS - 2 - PARENT-3-PROJECT_LOC/core/CMSIS/include - - - board - 2 - PARENT-3-PROJECT_LOC/examples/evkbmimxrt1060/test/board - - - component - 2 - virtual:/virtual - - - coreJSON - 2 - PARENT-3-PROJECT_LOC/Middleware/FreeRTOS/coreJSON - - - coreMQTT - 2 - virtual:/virtual - - - coreMQTT-Agent - 2 - virtual:/virtual - - - device - 2 - PARENT-3-PROJECT_LOC/core/devices/MIMXRT1062 - - - drivers - 2 - virtual:/virtual - - - freertos - 2 - PARENT-3-PROJECT_LOC/Middleware/FreeRTOS/kernel - - - include - 2 - PARENT-3-PROJECT_LOC/examples/evkbmimxrt1060/test/include - - - linkscripts - 2 - PARENT-3-PROJECT_LOC/examples/evkbmimxrt1060/test/linkscripts - - - lwip - 2 - virtual:/virtual - - - mbedtls - 2 - virtual:/virtual - - - mdio - 2 - PARENT-3-PROJECT_LOC/core/components/phy/mdio/enet - - - ota - 2 - PARENT-3-PROJECT_LOC/Middleware/AWS/ota - - - phy - 2 - PARENT-3-PROJECT_LOC/core/components/phy/device/phyksz8081 - - - pkcs11 - 2 - virtual:/virtual - - - secure_element - 2 - virtual:/virtual - - - source - 2 - virtual:/virtual - - - startup - 2 - virtual:/virtual - - - tests - 2 - PARENT-3-PROJECT_LOC/Middleware/FreeRTOS/tests - - - tinycbor - 2 - PARENT-3-PROJECT_LOC/Middleware/tinycbor - - - unity - 2 - PARENT-3-PROJECT_LOC/Middleware/unity - - - utilities - 2 - virtual:/virtual - - - component/lists - 2 - PARENT-3-PROJECT_LOC/core/components/lists - - - component/mflash - 2 - virtual:/virtual - - - component/serial_manager - 2 - PARENT-3-PROJECT_LOC/core/components/serial_manager - - - component/uart - 2 - PARENT-3-PROJECT_LOC/core/components/uart - - - coreMQTT/source - 2 - PARENT-3-PROJECT_LOC/Middleware/FreeRTOS/coreMQTT/source - - - coreMQTT/transport_mbedtls - 2 - PARENT-3-PROJECT_LOC/Middleware/FreeRTOS/transport_mbedtls - - - coreMQTT-Agent/port - 2 - PARENT-3-PROJECT_LOC/Middleware/FreeRTOS/mqtt-agent-interface - - - coreMQTT-Agent/source - 2 - PARENT-3-PROJECT_LOC/Middleware/FreeRTOS/coreMQTT-Agent/source - - - drivers/fsl_cache.c - 1 - PARENT-3-PROJECT_LOC/core/drivers/cache/armv7-m7/fsl_cache.c - - - drivers/fsl_cache.h - 1 - PARENT-3-PROJECT_LOC/core/drivers/cache/armv7-m7/fsl_cache.h - - - drivers/fsl_clock.c - 1 - PARENT-3-PROJECT_LOC/core/devices/MIMXRT1062/drivers/fsl_clock.c - - - drivers/fsl_clock.h - 1 - PARENT-3-PROJECT_LOC/core/devices/MIMXRT1062/drivers/fsl_clock.h - - - drivers/fsl_common.c - 1 - PARENT-3-PROJECT_LOC/core/drivers/common/fsl_common.c - - - drivers/fsl_common.h - 1 - PARENT-3-PROJECT_LOC/core/drivers/common/fsl_common.h - - - drivers/fsl_common_arm.c - 1 - PARENT-3-PROJECT_LOC/core/drivers/common/fsl_common_arm.c - - - drivers/fsl_common_arm.h - 1 - PARENT-3-PROJECT_LOC/core/drivers/common/fsl_common_arm.h - - - drivers/fsl_dcp.c - 1 - PARENT-3-PROJECT_LOC/core/drivers/dcp/fsl_dcp.c - - - drivers/fsl_dcp.h - 1 - PARENT-3-PROJECT_LOC/core/drivers/dcp/fsl_dcp.h - - - drivers/fsl_enet.c - 1 - PARENT-3-PROJECT_LOC/core/drivers/enet/fsl_enet.c - - - drivers/fsl_enet.h - 1 - PARENT-3-PROJECT_LOC/core/drivers/enet/fsl_enet.h - - - drivers/fsl_flexspi.c - 1 - PARENT-3-PROJECT_LOC/core/drivers/flexspi/fsl_flexspi.c - - - drivers/fsl_flexspi.h - 1 - PARENT-3-PROJECT_LOC/core/drivers/flexspi/fsl_flexspi.h - - - drivers/fsl_gpio.c - 1 - PARENT-3-PROJECT_LOC/core/drivers/igpio/fsl_gpio.c - - - drivers/fsl_gpio.h - 1 - PARENT-3-PROJECT_LOC/core/drivers/igpio/fsl_gpio.h - - - drivers/fsl_lpi2c.c - 1 - PARENT-3-PROJECT_LOC/core/drivers/lpi2c/fsl_lpi2c.c - - - drivers/fsl_lpi2c.h - 1 - PARENT-3-PROJECT_LOC/core/drivers/lpi2c/fsl_lpi2c.h - - - drivers/fsl_lpi2c_freertos.c - 1 - PARENT-3-PROJECT_LOC/core/drivers/lpi2c/fsl_lpi2c_freertos.c - - - drivers/fsl_lpi2c_freertos.h - 1 - PARENT-3-PROJECT_LOC/core/drivers/lpi2c/fsl_lpi2c_freertos.h - - - drivers/fsl_lpuart.c - 1 - PARENT-3-PROJECT_LOC/core/drivers/lpuart/fsl_lpuart.c - - - drivers/fsl_lpuart.h - 1 - PARENT-3-PROJECT_LOC/core/drivers/lpuart/fsl_lpuart.h - - - drivers/fsl_pit.c - 1 - PARENT-3-PROJECT_LOC/core/drivers/pit/fsl_pit.c - - - drivers/fsl_pit.h - 1 - PARENT-3-PROJECT_LOC/core/drivers/pit/fsl_pit.h - - - drivers/fsl_trng.c - 1 - PARENT-3-PROJECT_LOC/core/drivers/trng/fsl_trng.c - - - drivers/fsl_trng.h - 1 - PARENT-3-PROJECT_LOC/core/drivers/trng/fsl_trng.h - - - lwip/port - 2 - virtual:/virtual - - - lwip/src - 2 - PARENT-3-PROJECT_LOC/Middleware/lwip/src - - - mbedtls/include - 2 - PARENT-3-PROJECT_LOC/Middleware/mbedtls/include - - - mbedtls/library - 2 - PARENT-3-PROJECT_LOC/Middleware/mbedtls/library - - - mbedtls/port - 2 - virtual:/virtual - - - pkcs11/corePKCS11 - 2 - PARENT-3-PROJECT_LOC/Middleware/FreeRTOS/corePKCS11/source - - - pkcs11/include - 2 - PARENT-3-PROJECT_LOC/Middleware/FreeRTOS/pkcs11 - - - pkcs11/source - 2 - PARENT-3-PROJECT_LOC/Middleware/NXP/pkcs11 - - - secure_element/hostlib - 2 - PARENT-3-PROJECT_LOC/Middleware/NXP/hostLib - - - secure_element/sss - 2 - PARENT-3-PROJECT_LOC/Middleware/NXP/sss - - - source/app_main.c - 1 - PARENT-3-PROJECT_LOC/examples/evkbmimxrt1060/test/app_main.c - - - source/cli - 2 - PARENT-3-PROJECT_LOC/examples/common/cli - - - source/integration_test.c - 1 - PARENT-3-PROJECT_LOC/examples/evkbmimxrt1060/test/integration_test.c - - - source/kvstore - 2 - PARENT-3-PROJECT_LOC/examples/common/kvstore - - - source/logging - 2 - PARENT-3-PROJECT_LOC/examples/common/logging - - - source/main.c - 1 - PARENT-3-PROJECT_LOC/examples/evkbmimxrt1060/test/main.c - - - source/mqtt_agent - 2 - PARENT-3-PROJECT_LOC/examples/common/mqtt_agent - - - source/ota - 2 - PARENT-3-PROJECT_LOC/examples/common/ota - - - source/pub_sub_test_task.c - 1 - PARENT-3-PROJECT_LOC/examples/evkbmimxrt1060/test/pub_sub_test_task.c - - - source/semihost_hardfault.c - 1 - PARENT-3-PROJECT_LOC/examples/evkbmimxrt1060/test/semihost_hardfault.c - - - source/test_logging.c - 1 - PARENT-3-PROJECT_LOC/examples/evkbmimxrt1060/test/test_logging.c - - - source/test_logging.h - 1 - PARENT-3-PROJECT_LOC/examples/evkbmimxrt1060/test/test_logging.h - - - startup/startup_mimxrt1062.c - 1 - PARENT-3-PROJECT_LOC/core/devices/MIMXRT1062/mcuxpresso/startup_mimxrt1062.c - - - utilities/backoffAlgorithm - 2 - PARENT-3-PROJECT_LOC/Middleware/FreeRTOS/backoffAlgorithm/source - - - utilities/fsl_assert.c - 1 - PARENT-3-PROJECT_LOC/core/utilities/assert/fsl_assert.c - - - utilities/fsl_debug_console.c - 1 - PARENT-3-PROJECT_LOC/core/utilities/debug_console/debug_console/fsl_debug_console.c - - - utilities/fsl_debug_console.h - 1 - PARENT-3-PROJECT_LOC/core/utilities/debug_console/debug_console/fsl_debug_console.h - - - utilities/fsl_debug_console_conf.h - 1 - PARENT-3-PROJECT_LOC/core/utilities/debug_console/debug_console/fsl_debug_console_conf.h - - - utilities/fsl_str.c - 1 - PARENT-3-PROJECT_LOC/core/utilities/debug_console/str/fsl_str.c - - - utilities/fsl_str.h - 1 - PARENT-3-PROJECT_LOC/core/utilities/debug_console/str/fsl_str.h - - - component/mflash/mflash_file.c - 1 - PARENT-3-PROJECT_LOC/core/components/flash/mflash/mflash_file.c - - - component/mflash/mflash_file.h - 1 - PARENT-3-PROJECT_LOC/core/components/flash/mflash/mflash_file.h - - - lwip/port/arch - 2 - PARENT-3-PROJECT_LOC/Middleware/FreeRTOS/lwip_osal/include/arch - - - lwip/port/enet_ethernetif.c - 1 - PARENT-3-PROJECT_LOC/Middleware/NXP/lwip_ethernet/enet_ethernetif.c - - - lwip/port/enet_ethernetif.h - 1 - PARENT-3-PROJECT_LOC/Middleware/NXP/lwip_ethernet/enet_ethernetif.h - - - lwip/port/enet_ethernetif_kinetis.c - 1 - PARENT-3-PROJECT_LOC/Middleware/NXP/lwip_ethernet/enet_ethernetif_kinetis.c - - - lwip/port/enet_ethernetif_priv.h - 1 - PARENT-3-PROJECT_LOC/Middleware/NXP/lwip_ethernet/enet_ethernetif_priv.h - - - lwip/port/sys_arch.c - 1 - PARENT-3-PROJECT_LOC/Middleware/FreeRTOS/lwip_osal/src/sys_arch.c - - - mbedtls/port/ksdk - 2 - PARENT-3-PROJECT_LOC/Middleware/NXP/mbedtls_port/ksdk - - - mbedtls/port/mbedtls_freertos.c - 1 - PARENT-3-PROJECT_LOC/Middleware/NXP/mbedtls_port/mbedtls_freertos.c - - - - - 1640799402559 - coreJSON - 9 - - org.eclipse.ui.ide.multiFilter - 1.0-name-matches-false-false-source - - - - 1640799402577 - coreJSON - 6 - - org.eclipse.ui.ide.multiFilter - 1.0-name-matches-false-false-* - - - - 0 - device - 5 - - org.eclipse.ui.ide.multiFilter - 1.0-name-matches-false-true-system_MIMXRT1062.* - - - - 0 - device - 5 - - org.eclipse.ui.ide.multiFilter - 1.0-name-matches-false-false-MIMXRT1062_features.h - - - - 0 - device - 5 - - org.eclipse.ui.ide.multiFilter - 1.0-name-matches-false-false-MIMXRT1062.h - - - - 0 - device - 5 - - org.eclipse.ui.ide.multiFilter - 1.0-name-matches-false-false-fsl_device_registers.h - - - - 0 - device - 10 - - org.eclipse.ui.ide.multiFilter - 1.0-name-matches-false-false-* - - - - 1640798696866 - ota - 9 - - org.eclipse.ui.ide.multiFilter - 1.0-name-matches-false-false-source - - - - 1640798696880 - ota - 6 - - org.eclipse.ui.ide.multiFilter - 1.0-name-matches-false-false-* - - - - 1640798916246 - tinycbor - 9 - - org.eclipse.ui.ide.multiFilter - 1.0-name-matches-false-false-src - - - - 1640798916262 - tinycbor - 6 - - org.eclipse.ui.ide.multiFilter - 1.0-name-matches-false-false-* - - - - 1646887255667 - unity - 9 - - org.eclipse.ui.ide.multiFilter - 1.0-name-matches-false-false-src - - - - 1646887255792 - unity - 9 - - org.eclipse.ui.ide.multiFilter - 1.0-name-matches-false-false-extras - - - - 1637631424211 - component/serial_manager - 5 - - org.eclipse.ui.ide.multiFilter - 1.0-name-matches-false-true-fsl_component_serial_port_uart.* - - - - 1637631424229 - component/serial_manager - 5 - - org.eclipse.ui.ide.multiFilter - 1.0-name-matches-false-true-fsl_component_serial_manager.* - - - - 1637631424273 - component/serial_manager - 5 - - org.eclipse.ui.ide.multiFilter - 1.0-name-matches-false-false-fsl_component_serial_port_internal.h - - - - 1637631294100 - component/uart - 5 - - org.eclipse.ui.ide.multiFilter - 1.0-name-matches-false-false-fsl_adapter_lpuart.c - - - - 1638402774090 - coreMQTT-Agent/source - 10 - - org.eclipse.ui.ide.multiFilter - 1.0-name-matches-false-false-dependency - - - - 1637633559421 - freertos/portable - 9 - - org.eclipse.ui.ide.multiFilter - 1.0-name-matches-false-false-GCC - - - - 1637633559439 - freertos/portable - 9 - - org.eclipse.ui.ide.multiFilter - 1.0-name-matches-false-false-Memmang - - - - 1637706919000 - lwip/src - 10 - - org.eclipse.ui.ide.multiFilter - 1.0-name-matches-false-false-apps - - - - 1639622211516 - pkcs11/corePKCS11 - 10 - - org.eclipse.ui.ide.multiFilter - 1.0-name-matches-false-false-portable - - - - 1638835064248 - secure_element/hostlib - 9 - - org.eclipse.ui.ide.multiFilter - 1.0-name-matches-false-false-inc - - - - 1638835064274 - secure_element/hostlib - 9 - - org.eclipse.ui.ide.multiFilter - 1.0-name-matches-false-false-libCommon - - - - 1638835064286 - secure_element/hostlib - 9 - - org.eclipse.ui.ide.multiFilter - 1.0-name-matches-false-false-se05x - - - - 1638835064300 - secure_element/hostlib - 9 - - org.eclipse.ui.ide.multiFilter - 1.0-name-matches-false-false-se05x_03_xx_xx - - - - 1638835064327 - secure_element/hostlib - 9 - - org.eclipse.ui.ide.multiFilter - 1.0-name-matches-false-false-tstUtil - - - - 1638835064346 - secure_element/hostlib - 9 - - org.eclipse.ui.ide.multiFilter - 1.0-name-matches-false-false-mbedtls - - - - 1638835064356 - secure_element/hostlib - 9 - - org.eclipse.ui.ide.multiFilter - 1.0-name-matches-false-false-platform - - - - 1639622340704 - secure_element/sss - 10 - - org.eclipse.ui.ide.multiFilter - 1.0-name-matches-false-false-doc - - - - 1639622340720 - secure_element/sss - 6 - - org.eclipse.ui.ide.multiFilter - 1.0-name-matches-false-false-* - - - - 1646887576618 - unity/extras - 9 - - org.eclipse.ui.ide.multiFilter - 1.0-name-matches-false-false-fixture - - - - 1646887576633 - unity/extras - 9 - - org.eclipse.ui.ide.multiFilter - 1.0-name-matches-false-false-memory - - - - 1637633535938 - freertos/portable/GCC - 9 - - org.eclipse.ui.ide.multiFilter - 1.0-name-matches-false-false-ARM_CM4F - - - - 1637633582907 - freertos/portable/MemMang - 5 - - org.eclipse.ui.ide.multiFilter - 1.0-name-matches-false-false-heap_4.c - - - - 1637706966631 - lwip/src/netif - 10 - - org.eclipse.ui.ide.multiFilter - 1.0-name-matches-false-false-ppp - - - - 1638835193739 - secure_element/hostlib/libCommon - 10 - - org.eclipse.ui.ide.multiFilter - 1.0-name-matches-false-false-hostCrypto - - - - 1638835836690 - secure_element/hostlib/platform - 9 - - org.eclipse.ui.ide.multiFilter - 1.0-name-matches-false-false-inc - - - - 1638835836702 - secure_element/hostlib/platform - 9 - - org.eclipse.ui.ide.multiFilter - 1.0-name-matches-false-false-ksdk - - - - 1638835964024 - secure_element/hostlib/se05x_03_xx_xx - 6 - - org.eclipse.ui.ide.multiFilter - 1.0-name-matches-false-false-se05x_perso_api_int.h - - - - 1638835964035 - secure_element/hostlib/se05x_03_xx_xx - 6 - - org.eclipse.ui.ide.multiFilter - 1.0-name-matches-false-false-se05x_perso_api.c - - - - 1638835964071 - secure_element/hostlib/se05x_03_xx_xx - 6 - - org.eclipse.ui.ide.multiFilter - 1.0-name-matches-false-false-se05x_perso_api.h - - - - 1638835964084 - secure_element/hostlib/se05x_03_xx_xx - 6 - - org.eclipse.ui.ide.multiFilter - 1.0-name-matches-false-false-se05x_perso_cnst.h - - - - 1638835994952 - secure_element/hostlib/tstUtil - 5 - - org.eclipse.ui.ide.multiFilter - 1.0-name-matches-false-false-tstHostCrypto.h - - - - 1639622373548 - secure_element/sss/ex - 9 - - org.eclipse.ui.ide.multiFilter - 1.0-name-matches-false-false-inc - - - - 1639622373563 - secure_element/sss/ex - 9 - - org.eclipse.ui.ide.multiFilter - 1.0-name-matches-false-false-src - - - - 0 - secure_element/sss/plugin - 9 - - org.eclipse.ui.ide.multiFilter - 1.0-name-matches-false-false-mbedtls - - - - 0 - secure_element/sss/plugin - 9 - - org.eclipse.ui.ide.multiFilter - 1.0-name-matches-false-false-pkcs11 - - - - 0 - secure_element/sss/port - 9 - - org.eclipse.ui.ide.multiFilter - 1.0-name-matches-false-false-ksdk - - - - 0 - secure_element/sss/src - 9 - - org.eclipse.ui.ide.multiFilter - 1.0-name-matches-false-false-mbedtls - - - - 0 - secure_element/sss/src - 9 - - org.eclipse.ui.ide.multiFilter - 1.0-name-matches-false-false-se05x - - - - 1646887293360 - unity/extras/fixture - 9 - - org.eclipse.ui.ide.multiFilter - 1.0-name-matches-false-false-src - - - - 1646887592391 - unity/extras/memory - 9 - - org.eclipse.ui.ide.multiFilter - 1.0-name-matches-false-false-src - - - - 1639622271345 - pkcs11/corePKCS11/dependency/3rdparty - 9 - - org.eclipse.ui.ide.multiFilter - 1.0-name-matches-false-false-mbedtls_utils - - - - 1639642457783 - secure_element/hostlib/libCommon/infra - 6 - - org.eclipse.ui.ide.multiFilter - 1.0-name-matches-false-false-sm_demo_utils_rtos.c - - - - 1638835305905 - secure_element/hostlib/libCommon/scp - 6 - - org.eclipse.ui.ide.multiFilter - 1.0-name-matches-false-false-scp_a7x.c - - - - 1638835462231 - secure_element/hostlib/libCommon/smCom - 5 - - org.eclipse.ui.ide.multiFilter - 1.0-name-matches-false-false-smCom.c - - - - 1638835462243 - secure_element/hostlib/libCommon/smCom - 5 - - org.eclipse.ui.ide.multiFilter - 1.0-name-matches-false-false-smCom.h - - - - 1638835462258 - secure_element/hostlib/libCommon/smCom - 5 - - org.eclipse.ui.ide.multiFilter - 1.0-name-matches-false-false-smComT1oI2C.c - - - - 1638835462269 - secure_element/hostlib/libCommon/smCom - 5 - - org.eclipse.ui.ide.multiFilter - 1.0-name-matches-false-false-smComT1oI2C.h - - - - 1638835462284 - secure_element/hostlib/libCommon/smCom - 5 - - org.eclipse.ui.ide.multiFilter - 1.0-name-matches-false-false-apduComm.h - - - - 1638835462298 - secure_element/hostlib/libCommon/smCom - 5 - - org.eclipse.ui.ide.multiFilter - 1.0-name-matches-false-false-sci2c_cfg.h - - - - 1638835108682 - secure_element/hostlib/mbedtls/src - 5 - - org.eclipse.ui.ide.multiFilter - 1.0-name-matches-false-false-ecdh_alt.c - - - - 1638835108695 - secure_element/hostlib/mbedtls/src - 5 - - org.eclipse.ui.ide.multiFilter - 1.0-name-matches-false-false-rsa_alt.c - - - - 1639622745158 - secure_element/sss/ex/src - 5 - - org.eclipse.ui.ide.multiFilter - 1.0-name-matches-false-false-ex_sss_boot_connectstring.c - - - - 1639622745174 - secure_element/sss/ex/src - 5 - - org.eclipse.ui.ide.multiFilter - 1.0-name-matches-false-false-ex_sss_boot.c - - - - 1639622745190 - secure_element/sss/ex/src - 5 - - org.eclipse.ui.ide.multiFilter - 1.0-name-matches-false-false-ex_sss_boot_int.h - - - - 1639622745205 - secure_element/sss/ex/src - 5 - - org.eclipse.ui.ide.multiFilter - 1.0-name-matches-false-false-ex_sss_se05x.c - - - - 1639622745205 - secure_element/sss/ex/src - 5 - - org.eclipse.ui.ide.multiFilter - 1.0-name-matches-false-false-ex_sss_se05x_auth.c - - - - 0 - secure_element/sss/plugin/mbedtls - 10 - - org.eclipse.ui.ide.multiFilter - 1.0-name-matches-false-false-keys - - - - 0 - secure_element/sss/plugin/mbedtls - 10 - - org.eclipse.ui.ide.multiFilter - 1.0-name-matches-false-false-scripts - - - - diff --git a/projects/evkmimxrt1060/test/aws_iot_qual_test.ld b/projects/evkmimxrt1060/test/aws_iot_qual_test.ld deleted file mode 100644 index 4ef3323..0000000 --- a/projects/evkmimxrt1060/test/aws_iot_qual_test.ld +++ /dev/null @@ -1,375 +0,0 @@ - -GROUP ( - "libgcc.a" - "libc_nano.a" - "libm.a" - "libcr_newlib_nohost.a" -) - - - -MEMORY -{ - /* Define each memory region */ - BOARD_FLASH (rx) : ORIGIN = 0x60040000, LENGTH = 0x1ffc00 /* 2047K bytes (alias Flash) */ - SRAM_DTC (rwx) : ORIGIN = 0x20000000, LENGTH = 0x20000 /* 128K bytes (alias RAM) */ - SRAM_ITC (rwx) : ORIGIN = 0x0, LENGTH = 0x20000 /* 128K bytes (alias RAM2) */ - SRAM_OC (rwx) : ORIGIN = 0x20200000, LENGTH = 0xc0000 /* 768K bytes (alias RAM3) */ - BOARD_SDRAM (rwx) : ORIGIN = 0x80000000, LENGTH = 0x1e00000 /* 30M bytes (alias RAM4) */ - NCACHE_REGION (rwx) : ORIGIN = 0x81e00000, LENGTH = 0x200000 /* 2M bytes (alias RAM5) */ -} - - /* Define a symbol for the top of each memory region */ - __base_BOARD_FLASH = 0x60040000 ; /* BOARD_FLASH */ - __base_Flash = 0x60040000 ; /* Flash */ - __top_BOARD_FLASH = 0x60040000 + 0x1ffc00 ; /* 2047K bytes */ - __top_Flash = 0x60040000 + 0x1ffc00 ; /* 2047K bytes */ - __base_SRAM_DTC = 0x20000000 ; /* SRAM_DTC */ - __base_RAM = 0x20000000 ; /* RAM */ - __top_SRAM_DTC = 0x20000000 + 0x20000 ; /* 128K bytes */ - __top_RAM = 0x20000000 + 0x20000 ; /* 128K bytes */ - __base_SRAM_ITC = 0x0 ; /* SRAM_ITC */ - __base_RAM2 = 0x0 ; /* RAM2 */ - __top_SRAM_ITC = 0x0 + 0x20000 ; /* 128K bytes */ - __top_RAM2 = 0x0 + 0x20000 ; /* 128K bytes */ - __base_SRAM_OC = 0x20200000 ; /* SRAM_OC */ - __base_RAM3 = 0x20200000 ; /* RAM3 */ - __top_SRAM_OC = 0x20200000 + 0xc0000 ; /* 768K bytes */ - __top_RAM3 = 0x20200000 + 0xc0000 ; /* 768K bytes */ - __base_BOARD_SDRAM = 0x80000000 ; /* BOARD_SDRAM */ - __base_RAM4 = 0x80000000 ; /* RAM4 */ - __top_BOARD_SDRAM = 0x80000000 + 0x1e00000 ; /* 30M bytes */ - __top_RAM4 = 0x80000000 + 0x1e00000 ; /* 30M bytes */ - __base_NCACHE_REGION = 0x81e00000 ; /* NCACHE_REGION */ - __base_RAM5 = 0x81e00000 ; /* RAM5 */ - __top_NCACHE_REGION = 0x81e00000 + 0x200000 ; /* 2M bytes */ - __top_RAM5 = 0x81e00000 + 0x200000 ; /* 2M bytes */ - -ENTRY(ResetISR) - -SECTIONS -{ - .mcuboot_hdr : ALIGN(4) - { - FILL(0xff) - . = 0x400; - } > BOARD_FLASH - - /* MAIN TEXT SECTION */ - .text : ALIGN(4) - { - FILL(0xff) - __vectors_start__ = ABSOLUTE(.) ; - KEEP(*(.isr_vector)) - /* Global Section Table */ - . = ALIGN(4) ; - __section_table_start = .; - __data_section_table = .; - LONG(LOADADDR(.data)); - LONG( ADDR(.data)); - LONG( SIZEOF(.data)); - LONG(LOADADDR(.data_RAM2)); - LONG( ADDR(.data_RAM2)); - LONG( SIZEOF(.data_RAM2)); - LONG(LOADADDR(.data_RAM3)); - LONG( ADDR(.data_RAM3)); - LONG( SIZEOF(.data_RAM3)); - LONG(LOADADDR(.data_RAM4)); - LONG( ADDR(.data_RAM4)); - LONG( SIZEOF(.data_RAM4)); - LONG(LOADADDR(.data_RAM5)); - LONG( ADDR(.data_RAM5)); - LONG( SIZEOF(.data_RAM5)); - __data_section_table_end = .; - __bss_section_table = .; - LONG( ADDR(.bss)); - LONG( SIZEOF(.bss)); - LONG( ADDR(.bss_RAM2)); - LONG( SIZEOF(.bss_RAM2)); - LONG( ADDR(.bss_RAM3)); - LONG( SIZEOF(.bss_RAM3)); - LONG( ADDR(.bss_RAM4)); - LONG( SIZEOF(.bss_RAM4)); - LONG( ADDR(.bss_RAM5)); - LONG( SIZEOF(.bss_RAM5)); - __bss_section_table_end = .; - __section_table_end = . ; - /* End of Global Section Table */ - - *(.after_vectors*) - - } > BOARD_FLASH - - .text : ALIGN(4) - { - *(EXCLUDE_FILE(*mflash_drv.o *fsl_flexspi.o *ota_pal.o *flexspi_nor_flash_ops.o) .text*) *(.rodata .rodata.* .constdata .constdata.*) - . = ALIGN(4); - } > BOARD_FLASH - /* - * for exception handling/unwind - some Newlib functions (in common - * with C++ and STDC++) use this. - */ - .ARM.extab : ALIGN(4) - { - *(.ARM.extab* .gnu.linkonce.armextab.*) - } > BOARD_FLASH - - .ARM.exidx : ALIGN(4) - { - __exidx_start = .; - *(.ARM.exidx* .gnu.linkonce.armexidx.*) - __exidx_end = .; - } > BOARD_FLASH - - _etext = .; - - /* DATA section for SRAM_ITC */ - - .data_RAM2 : ALIGN(4) - { - FILL(0xff) - PROVIDE(__start_data_RAM2 = .) ; - PROVIDE(__start_data_SRAM_ITC = .) ; - *(.ramfunc.$RAM2) - *(.ramfunc.$SRAM_ITC) - - *mflash_drv.o(.text .text* .rodata .rodata*) - *fsl_flexspi.o(.text .text* .rodata .rodata*) - *ota_pal.o(.text .text* .rodata .rodata*) - *flexspi_nor_flash_ops.o(.text .text* .rodata .rodata*) - . = ALIGN(4) ; - PROVIDE(__end_data_RAM2 = .) ; - PROVIDE(__end_data_SRAM_ITC = .) ; - } > SRAM_ITC AT>BOARD_FLASH - - /* DATA section for SRAM_OC */ - - .data_RAM3 : ALIGN(4) - { - FILL(0xff) - PROVIDE(__start_data_RAM3 = .) ; - PROVIDE(__start_data_SRAM_OC = .) ; - *(.ramfunc.$RAM3) - *(.ramfunc.$SRAM_OC) - . = ALIGN(4) ; - PROVIDE(__end_data_RAM3 = .) ; - PROVIDE(__end_data_SRAM_OC = .) ; - } > SRAM_OC AT>BOARD_FLASH - - /* DATA section for BOARD_SDRAM */ - - .data_RAM4 : ALIGN(4) - { - FILL(0xff) - PROVIDE(__start_data_RAM4 = .) ; - PROVIDE(__start_data_BOARD_SDRAM = .) ; - *(.ramfunc.$RAM4) - *(.ramfunc.$BOARD_SDRAM) - . = ALIGN(4) ; - PROVIDE(__end_data_RAM4 = .) ; - PROVIDE(__end_data_BOARD_SDRAM = .) ; - } > BOARD_SDRAM AT>BOARD_FLASH - - /* DATA section for NCACHE_REGION */ - - .data_RAM5 : ALIGN(4) - { - FILL(0xff) - PROVIDE(__start_data_RAM5 = .) ; - PROVIDE(__start_data_NCACHE_REGION = .) ; - *(.ramfunc.$RAM5) - *(.ramfunc.$NCACHE_REGION) - . = ALIGN(4) ; - PROVIDE(__end_data_RAM5 = .) ; - PROVIDE(__end_data_NCACHE_REGION = .) ; - } > NCACHE_REGION AT>BOARD_FLASH - - /* MAIN DATA SECTION */ - .uninit_RESERVED (NOLOAD) : ALIGN(4) - { - _start_uninit_RESERVED = .; - KEEP(*(.bss.$RESERVED*)) - . = ALIGN(4) ; - _end_uninit_RESERVED = .; - } > SRAM_DTC AT> SRAM_DTC - - /* Main DATA section (SRAM_DTC) */ - .data : ALIGN(4) - { - FILL(0xff) - _data = . ; - PROVIDE(__start_data_RAM = .) ; - PROVIDE(__start_data_SRAM_DTC = .) ; - *(vtable) - *(.ramfunc*) - KEEP(*(CodeQuickAccess)) - KEEP(*(DataQuickAccess)) - *(RamFunction) - *(NonCacheable.init) - *(.data*) - . = ALIGN(4) ; - _edata = . ; - PROVIDE(__end_data_RAM = .) ; - PROVIDE(__end_data_SRAM_DTC = .) ; - } > SRAM_DTC AT>BOARD_FLASH - - /* BSS section for SRAM_ITC */ - .bss_RAM2 : ALIGN(4) - { - PROVIDE(__start_bss_RAM2 = .) ; - PROVIDE(__start_bss_SRAM_ITC = .) ; - . = ALIGN (. != 0 ? 4 : 1) ; /* avoid empty segment */ - PROVIDE(__end_bss_RAM2 = .) ; - PROVIDE(__end_bss_SRAM_ITC = .) ; - } > SRAM_ITC AT> SRAM_ITC - - /* BSS section for SRAM_OC */ - .bss_RAM3 : ALIGN(4) - { - PROVIDE(__start_bss_RAM3 = .) ; - PROVIDE(__start_bss_SRAM_OC = .) ; - - *(.bss*) - . = ALIGN (. != 0 ? 4 : 1) ; /* avoid empty segment */ - PROVIDE(__end_bss_RAM3 = .) ; - PROVIDE(__end_bss_SRAM_OC = .) ; - } > SRAM_OC AT> SRAM_OC - - /* BSS section for BOARD_SDRAM */ - .bss_RAM4 : ALIGN(4) - { - PROVIDE(__start_bss_RAM4 = .) ; - PROVIDE(__start_bss_BOARD_SDRAM = .) ; - . = ALIGN (. != 0 ? 4 : 1) ; /* avoid empty segment */ - PROVIDE(__end_bss_RAM4 = .) ; - PROVIDE(__end_bss_BOARD_SDRAM = .) ; - } > BOARD_SDRAM AT> BOARD_SDRAM - - /* BSS section for NCACHE_REGION */ - .bss_RAM5 : ALIGN(4) - { - PROVIDE(__start_bss_RAM5 = .) ; - PROVIDE(__start_bss_NCACHE_REGION = .) ; - . = ALIGN (. != 0 ? 4 : 1) ; /* avoid empty segment */ - PROVIDE(__end_bss_RAM5 = .) ; - PROVIDE(__end_bss_NCACHE_REGION = .) ; - } > NCACHE_REGION AT> NCACHE_REGION - - /* MAIN BSS SECTION */ - .bss : ALIGN(4) - { - _bss = .; - PROVIDE(__start_bss_RAM = .) ; - PROVIDE(__start_bss_SRAM_DTC = .) ; - *(NonCacheable) - *(.bss*) - *(COMMON) - . = ALIGN(4) ; - _ebss = .; - PROVIDE(__end_bss_RAM = .) ; - PROVIDE(__end_bss_SRAM_DTC = .) ; - PROVIDE(end = .); - } > SRAM_DTC AT> SRAM_DTC - - /* NOINIT section for SRAM_ITC */ - .noinit_RAM2 (NOLOAD) : ALIGN(4) - { - PROVIDE(__start_noinit_RAM2 = .) ; - PROVIDE(__start_noinit_SRAM_ITC = .) ; - *(.noinit.$RAM2) - *(.noinit.$SRAM_ITC) - *(.noinit.$RAM2.*) - *(.noinit.$SRAM_ITC.*) - . = ALIGN(4) ; - PROVIDE(__end_noinit_RAM2 = .) ; - PROVIDE(__end_noinit_SRAM_ITC = .) ; - } > SRAM_ITC AT> SRAM_ITC - - /* NOINIT section for SRAM_OC */ - .noinit_RAM3 (NOLOAD) : ALIGN(4) - { - PROVIDE(__start_noinit_RAM3 = .) ; - PROVIDE(__start_noinit_SRAM_OC = .) ; - *(.noinit.$RAM3) - *(.noinit.$SRAM_OC) - *(.noinit.$RAM3.*) - *(.noinit.$SRAM_OC.*) - . = ALIGN(4) ; - PROVIDE(__end_noinit_RAM3 = .) ; - PROVIDE(__end_noinit_SRAM_OC = .) ; - } > SRAM_OC AT> SRAM_OC - - /* NOINIT section for BOARD_SDRAM */ - .noinit_RAM4 (NOLOAD) : ALIGN(4) - { - PROVIDE(__start_noinit_RAM4 = .) ; - PROVIDE(__start_noinit_BOARD_SDRAM = .) ; - *(.noinit.$RAM4) - *(.noinit.$BOARD_SDRAM) - *(.noinit.$RAM4.*) - *(.noinit.$BOARD_SDRAM.*) - . = ALIGN(4) ; - PROVIDE(__end_noinit_RAM4 = .) ; - PROVIDE(__end_noinit_BOARD_SDRAM = .) ; - } > BOARD_SDRAM AT> BOARD_SDRAM - - /* NOINIT section for NCACHE_REGION */ - .noinit_RAM5 (NOLOAD) : ALIGN(4) - { - PROVIDE(__start_noinit_RAM5 = .) ; - PROVIDE(__start_noinit_NCACHE_REGION = .) ; - *(.noinit.$RAM5) - *(.noinit.$NCACHE_REGION) - *(.noinit.$RAM5.*) - *(.noinit.$NCACHE_REGION.*) - . = ALIGN(4) ; - PROVIDE(__end_noinit_RAM5 = .) ; - PROVIDE(__end_noinit_NCACHE_REGION = .) ; - } > NCACHE_REGION AT> NCACHE_REGION - - /* DEFAULT NOINIT SECTION */ - .noinit (NOLOAD): ALIGN(4) - { - _noinit = .; - PROVIDE(__start_noinit_RAM = .) ; - PROVIDE(__start_noinit_SRAM_DTC = .) ; - *(.noinit*) - . = ALIGN(4) ; - _end_noinit = .; - PROVIDE(__end_noinit_RAM = .) ; - PROVIDE(__end_noinit_SRAM_DTC = .) ; - } > SRAM_DTC AT> SRAM_DTC - - /* Reserve and place Heap within memory map */ - _HeapSize = 0x1000; - .heap : ALIGN(4) - { - _pvHeapStart = .; - . += _HeapSize; - . = ALIGN(4); - _pvHeapLimit = .; - } > SRAM_DTC - - _StackSize = 0x1000; - /* Reserve space in memory for Stack */ - .heap2stackfill : - { - . += _StackSize; - } > SRAM_DTC - /* Locate actual Stack in memory map */ - .stack ORIGIN(SRAM_DTC) + LENGTH(SRAM_DTC) - _StackSize - 0: ALIGN(4) - { - _vStackBase = .; - . = ALIGN(4); - _vStackTop = . + _StackSize; - } > SRAM_DTC - - /* Provide basic symbols giving location and size of main text - * block, including initial values of RW data sections. Note that - * these will need extending to give a complete picture with - * complex images (e.g multiple Flash banks). - */ - _image_start = LOADADDR(.text); - _image_end = LOADADDR(.data) + SIZEOF(.data); - _image_size = _image_end - _image_start; -} \ No newline at end of file