Repostiory containing DAPLink source code with Reset Pin workaround for HANI_IOT board.

Upstream: https://github.com/ARMmbed/DAPLink

Committer:
Pawel Zarembski
Date:
Tue Apr 07 12:55:42 2020 +0200
Revision:
0:01f31e923fe2
hani: DAPLink with reset workaround

Who changed what in which revision?

UserRevisionLine numberNew contents of line
Pawel Zarembski 0:01f31e923fe2 1 /**
Pawel Zarembski 0:01f31e923fe2 2 * @file daplink.h
Pawel Zarembski 0:01f31e923fe2 3 * @brief Information about different Hardware Interface Circuits the firmware runs
Pawel Zarembski 0:01f31e923fe2 4 *
Pawel Zarembski 0:01f31e923fe2 5 * DAPLink Interface Firmware
Pawel Zarembski 0:01f31e923fe2 6 * Copyright (c) 2009-2016, ARM Limited, All Rights Reserved
Pawel Zarembski 0:01f31e923fe2 7 * SPDX-License-Identifier: Apache-2.0
Pawel Zarembski 0:01f31e923fe2 8 *
Pawel Zarembski 0:01f31e923fe2 9 * Licensed under the Apache License, Version 2.0 (the "License"); you may
Pawel Zarembski 0:01f31e923fe2 10 * not use this file except in compliance with the License.
Pawel Zarembski 0:01f31e923fe2 11 * You may obtain a copy of the License at
Pawel Zarembski 0:01f31e923fe2 12 *
Pawel Zarembski 0:01f31e923fe2 13 * http://www.apache.org/licenses/LICENSE-2.0
Pawel Zarembski 0:01f31e923fe2 14 *
Pawel Zarembski 0:01f31e923fe2 15 * Unless required by applicable law or agreed to in writing, software
Pawel Zarembski 0:01f31e923fe2 16 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
Pawel Zarembski 0:01f31e923fe2 17 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
Pawel Zarembski 0:01f31e923fe2 18 * See the License for the specific language governing permissions and
Pawel Zarembski 0:01f31e923fe2 19 * limitations under the License.
Pawel Zarembski 0:01f31e923fe2 20 */
Pawel Zarembski 0:01f31e923fe2 21
Pawel Zarembski 0:01f31e923fe2 22 #ifndef DAPLINK_H
Pawel Zarembski 0:01f31e923fe2 23 #define DAPLINK_H
Pawel Zarembski 0:01f31e923fe2 24
Pawel Zarembski 0:01f31e923fe2 25 #include <stdbool.h>
Pawel Zarembski 0:01f31e923fe2 26 #include <stdint.h>
Pawel Zarembski 0:01f31e923fe2 27
Pawel Zarembski 0:01f31e923fe2 28 #include "daplink_addr.h"
Pawel Zarembski 0:01f31e923fe2 29 #include "compiler.h"
Pawel Zarembski 0:01f31e923fe2 30
Pawel Zarembski 0:01f31e923fe2 31 #ifdef __cplusplus
Pawel Zarembski 0:01f31e923fe2 32 extern "C" {
Pawel Zarembski 0:01f31e923fe2 33 #endif
Pawel Zarembski 0:01f31e923fe2 34
Pawel Zarembski 0:01f31e923fe2 35 // Assert that regions are sequential with no gaps
Pawel Zarembski 0:01f31e923fe2 36 // and that they take up all available space
Pawel Zarembski 0:01f31e923fe2 37
Pawel Zarembski 0:01f31e923fe2 38 // ROM check
Pawel Zarembski 0:01f31e923fe2 39 COMPILER_ASSERT(DAPLINK_ROM_BL_START == DAPLINK_ROM_START);
Pawel Zarembski 0:01f31e923fe2 40 COMPILER_ASSERT(DAPLINK_ROM_BL_START + DAPLINK_ROM_BL_SIZE == DAPLINK_ROM_CONFIG_ADMIN_START);
Pawel Zarembski 0:01f31e923fe2 41 COMPILER_ASSERT(DAPLINK_ROM_CONFIG_ADMIN_START + DAPLINK_ROM_CONFIG_ADMIN_SIZE == DAPLINK_ROM_IF_START);
Pawel Zarembski 0:01f31e923fe2 42 COMPILER_ASSERT(DAPLINK_ROM_IF_START + DAPLINK_ROM_IF_SIZE == DAPLINK_ROM_CONFIG_USER_START);
Pawel Zarembski 0:01f31e923fe2 43 COMPILER_ASSERT(DAPLINK_ROM_CONFIG_USER_START + DAPLINK_ROM_CONFIG_USER_SIZE == DAPLINK_ROM_START + DAPLINK_ROM_SIZE);
Pawel Zarembski 0:01f31e923fe2 44
Pawel Zarembski 0:01f31e923fe2 45 // RAM check
Pawel Zarembski 0:01f31e923fe2 46 COMPILER_ASSERT(DAPLINK_RAM_APP_START == DAPLINK_RAM_START);
Pawel Zarembski 0:01f31e923fe2 47 COMPILER_ASSERT(DAPLINK_RAM_APP_START + DAPLINK_RAM_APP_SIZE == DAPLINK_RAM_SHARED_START);
Pawel Zarembski 0:01f31e923fe2 48 COMPILER_ASSERT(DAPLINK_RAM_SHARED_START + DAPLINK_RAM_SHARED_SIZE == DAPLINK_RAM_START + DAPLINK_RAM_SIZE);
Pawel Zarembski 0:01f31e923fe2 49
Pawel Zarembski 0:01f31e923fe2 50 #define DAPLINK_BUILD_KEY_IF 0x9B939E8F
Pawel Zarembski 0:01f31e923fe2 51 #define DAPLINK_BUILD_KEY_BL 0x9B939D93
Pawel Zarembski 0:01f31e923fe2 52
Pawel Zarembski 0:01f31e923fe2 53 //! @name HIC IDs
Pawel Zarembski 0:01f31e923fe2 54 //@{
Pawel Zarembski 0:01f31e923fe2 55 #define DAPLINK_HIC_ID_K20DX 0x97969900
Pawel Zarembski 0:01f31e923fe2 56 #define DAPLINK_HIC_ID_KL26 0x97969901
Pawel Zarembski 0:01f31e923fe2 57 #define DAPLINK_HIC_ID_LPC11U35 0x97969902
Pawel Zarembski 0:01f31e923fe2 58 #define DAPLINK_HIC_ID_SAM3U2C 0x97969903
Pawel Zarembski 0:01f31e923fe2 59 #define DAPLINK_HIC_ID_MAX32620 0x97969904
Pawel Zarembski 0:01f31e923fe2 60 #define DAPLINK_HIC_ID_LPC4322 0x97969905
Pawel Zarembski 0:01f31e923fe2 61 #define DAPLINK_HIC_ID_MAX32625 0x97969906
Pawel Zarembski 0:01f31e923fe2 62 #define DAPLINK_HIC_ID_MAX32550 0x97969907
Pawel Zarembski 0:01f31e923fe2 63 #define DAPLINK_HIC_ID_STM32F103XB 0x97969908
Pawel Zarembski 0:01f31e923fe2 64 #define DAPLINK_HIC_ID_K26F 0x97969909
Pawel Zarembski 0:01f31e923fe2 65 #define DAPLINK_HIC_ID_K22F 0x9796990A
Pawel Zarembski 0:01f31e923fe2 66 #define DAPLINK_HIC_ID_KL27Z 0x9796990B // reserving for future use
Pawel Zarembski 0:01f31e923fe2 67 #define DAPLINK_HIC_ID_LPC54606 0x9796990C // reserving for future use
Pawel Zarembski 0:01f31e923fe2 68 #define DAPLINK_HIC_ID_STM32F723IE 0x9796990D // reserving for future use
Pawel Zarembski 0:01f31e923fe2 69 #define DAPLINK_HIC_ID_LPC55S69 0x97969920 // reserving for future use
Pawel Zarembski 0:01f31e923fe2 70 #define DAPLINK_HIC_ID_M48SSIDAE 0x97969921
Pawel Zarembski 0:01f31e923fe2 71 #define DAPLINK_HIC_ID_PSOC5 0x2E127069
Pawel Zarembski 0:01f31e923fe2 72 //@}
Pawel Zarembski 0:01f31e923fe2 73
Pawel Zarembski 0:01f31e923fe2 74 #define DAPLINK_INFO_OFFSET 0x20
Pawel Zarembski 0:01f31e923fe2 75
Pawel Zarembski 0:01f31e923fe2 76 typedef struct {
Pawel Zarembski 0:01f31e923fe2 77 uint32_t build_key;
Pawel Zarembski 0:01f31e923fe2 78 uint32_t hic_id;
Pawel Zarembski 0:01f31e923fe2 79 uint32_t version;
Pawel Zarembski 0:01f31e923fe2 80 } daplink_info_t;
Pawel Zarembski 0:01f31e923fe2 81
Pawel Zarembski 0:01f31e923fe2 82 bool daplink_is_bootloader(void);
Pawel Zarembski 0:01f31e923fe2 83 bool daplink_is_interface(void);
Pawel Zarembski 0:01f31e923fe2 84
Pawel Zarembski 0:01f31e923fe2 85 #ifdef __cplusplus
Pawel Zarembski 0:01f31e923fe2 86 }
Pawel Zarembski 0:01f31e923fe2 87 #endif
Pawel Zarembski 0:01f31e923fe2 88
Pawel Zarembski 0:01f31e923fe2 89 #endif