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 flash_blob.c
Pawel Zarembski 0:01f31e923fe2 3 * @brief Flash algorithm for the efm32gg
Pawel Zarembski 0:01f31e923fe2 4 *
Pawel Zarembski 0:01f31e923fe2 5 * DAPLink Interface Firmware
Pawel Zarembski 0:01f31e923fe2 6 * Copyright (c) 2009-2019, 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 #include "flash_blob.h"
Pawel Zarembski 0:01f31e923fe2 23
Pawel Zarembski 0:01f31e923fe2 24 static const uint32_t efm32gg_flash_prog_blob[] = {
Pawel Zarembski 0:01f31e923fe2 25 0xE00ABE00, 0x062D780D, 0x24084068, 0xD3000040, 0x1E644058, 0x1C49D1FA, 0x2A001E52, 0x4770D1F2,
Pawel Zarembski 0:01f31e923fe2 26 0x4770ba40, 0x4770bac0, 0x4c0cb510, 0xf04068a0, 0x60a00001, 0x301af246, 0xf44f6560, 0x60e07040,
Pawel Zarembski 0:01f31e923fe2 27 0x20012100, 0xf83ef000, 0x65612100, 0xf02168a1, 0x60a10101, 0xbf182800, 0xbd102001, 0x400c0000,
Pawel Zarembski 0:01f31e923fe2 28 0x4684b510, 0xf44f2300, 0xf8505180, 0x1f092b04, 0x1c52d002, 0xe001d0f9, 0xd0131c50, 0x68a04c0c,
Pawel Zarembski 0:01f31e923fe2 29 0x0001f040, 0xf8c460a0, 0x2001c010, 0x200260e0, 0x210060e0, 0xf0002001, 0x4603f815, 0xf02068a0,
Pawel Zarembski 0:01f31e923fe2 30 0x60a00001, 0xbf142b00, 0x20002001, 0x0000bd10, 0x400c0000, 0xf6414902, 0x63c83071, 0x47702000,
Pawel Zarembski 0:01f31e923fe2 31 0x400c0000, 0x4b14b410, 0xc050f8df, 0x201cf8dc, 0x0f16f012, 0xf8dcd014, 0xf0200008, 0xf8cc0005,
Pawel Zarembski 0:01f31e923fe2 32 0xf0120008, 0xbf1e0f02, 0x0001f06f, 0x4770bc10, 0x0f04f012, 0xf04fbf1e, 0xbc1030ff, 0xe0074770,
Pawel Zarembski 0:01f31e923fe2 33 0x428a4002, 0xbc10d102, 0x47702000, 0xd1dd1e5b, 0xf06fbc10, 0x47700002, 0x00989680, 0x400c0000,
Pawel Zarembski 0:01f31e923fe2 34 0x4df0e92d, 0x1cc84604, 0x0603f020, 0x46904859, 0xf0416881, 0x60810101, 0xd9732e07, 0x0f07f014,
Pawel Zarembski 0:01f31e923fe2 35 0xf8d8d011, 0x61041000, 0x60c22201, 0x21086181, 0x210060c1, 0xf7ff4610, 0x2800ffb5, 0x1d24d17e,
Pawel Zarembski 0:01f31e923fe2 36 0x0810f108, 0x484b1f36, 0xf0416881, 0x60810104, 0xbf882e07, 0x0a02f06f, 0xf504d966, 0x46015080,
Pawel Zarembski 0:01f31e923fe2 37 0x010bf36f, 0x42b11b09, 0x4635bf8e, 0x000bf36f, 0xf0151b05, 0xbf180f04, 0x46471f2d, 0x20012100,
Pawel Zarembski 0:01f31e923fe2 38 0xff90f7ff, 0xd13b2800, 0xe0e8f8df, 0x4010f8ce, 0xf8ce2001, 0xf857000c, 0xf8ce0b04, 0xf8570018,
Pawel Zarembski 0:01f31e923fe2 39 0xf8ce0b04, 0x20080018, 0x000cf8ce, 0x0208f1a5, 0xd9332a07, 0x0b08f04f, 0x46dc482f, 0x101cf8de,
Pawel Zarembski 0:01f31e923fe2 40 0x0f16f011, 0xf8ded012, 0xf0200008, 0xf8ce0005, 0xf0110008, 0xbf180f02, 0x0001f06f, 0xf011d10f,
Pawel Zarembski 0:01f31e923fe2 41 0xbf180f04, 0x30fff04f, 0xe007d109, 0x010bea01, 0xd1014561, 0xe0022000, 0xd1df1e40, 0xb1104650,
Pawel Zarembski 0:01f31e923fe2 42 0xe00bb9e0, 0xf857e01c, 0xf8ce0b04, 0xf8570018, 0xf8ce0b04, 0x3a080018, 0xd8cb2a07, 0xeb081b76,
Pawel Zarembski 0:01f31e923fe2 43 0x442c0885, 0xd8982e07, 0x20012100, 0xff3af7ff, 0x4810b920, 0xf0216881, 0xe0000104, 0x6081e00f,
Pawel Zarembski 0:01f31e923fe2 44 0x480cb186, 0x1000f8d8, 0x22016104, 0x618160c2, 0x60c12108, 0x46102100, 0xff24f7ff, 0x2001b110,
Pawel Zarembski 0:01f31e923fe2 45 0x8df0e8bd, 0x68814803, 0x0101f021, 0x20006081, 0x8df0e8bd, 0x400c0000, 0x00989680, 0x68814803,
Pawel Zarembski 0:01f31e923fe2 46 0x0105f021, 0x20006081, 0x00004770, 0x400c0000, 0x00000000,
Pawel Zarembski 0:01f31e923fe2 47 };
Pawel Zarembski 0:01f31e923fe2 48
Pawel Zarembski 0:01f31e923fe2 49 /**
Pawel Zarembski 0:01f31e923fe2 50 * List of start and size for each size of flash sector
Pawel Zarembski 0:01f31e923fe2 51 * The size will apply to all sectors between the listed address and the next address
Pawel Zarembski 0:01f31e923fe2 52 * in the list.
Pawel Zarembski 0:01f31e923fe2 53 * The last pair in the list will have sectors starting at that address and ending
Pawel Zarembski 0:01f31e923fe2 54 * at address start + size.
Pawel Zarembski 0:01f31e923fe2 55 */
Pawel Zarembski 0:01f31e923fe2 56 static const sector_info_t sectors_info[] = {
Pawel Zarembski 0:01f31e923fe2 57 {0, 4096},
Pawel Zarembski 0:01f31e923fe2 58 };
Pawel Zarembski 0:01f31e923fe2 59
Pawel Zarembski 0:01f31e923fe2 60 static const program_target_t flash = {
Pawel Zarembski 0:01f31e923fe2 61 0x200000B5, // Init
Pawel Zarembski 0:01f31e923fe2 62 0x2000029D, // UnInit
Pawel Zarembski 0:01f31e923fe2 63 0x20000029, // EraseChip
Pawel Zarembski 0:01f31e923fe2 64 0x20000061, // EraseSector
Pawel Zarembski 0:01f31e923fe2 65 0x20000121, // ProgramPage
Pawel Zarembski 0:01f31e923fe2 66 0x0, // Verify
Pawel Zarembski 0:01f31e923fe2 67
Pawel Zarembski 0:01f31e923fe2 68 // BKPT : start of blob + 1
Pawel Zarembski 0:01f31e923fe2 69 // RSB : blob start + header + rw data offset
Pawel Zarembski 0:01f31e923fe2 70 // RSP : stack pointer
Pawel Zarembski 0:01f31e923fe2 71 {
Pawel Zarembski 0:01f31e923fe2 72 0x20000000 + 0x00000001,
Pawel Zarembski 0:01f31e923fe2 73 0x20000000 + 0x00000020 + 0x00000290,
Pawel Zarembski 0:01f31e923fe2 74 0x20000800
Pawel Zarembski 0:01f31e923fe2 75 },
Pawel Zarembski 0:01f31e923fe2 76
Pawel Zarembski 0:01f31e923fe2 77 0x20000000 + 0x00000A00, // mem buffer location
Pawel Zarembski 0:01f31e923fe2 78 0x20000000, // location to write prog_blob in target RAM
Pawel Zarembski 0:01f31e923fe2 79 sizeof(efm32gg_flash_prog_blob), // prog_blob size
Pawel Zarembski 0:01f31e923fe2 80 efm32gg_flash_prog_blob, // address of prog_blob
Pawel Zarembski 0:01f31e923fe2 81 0x00000200 // ram_to_flash_bytes_to_be_written
Pawel Zarembski 0:01f31e923fe2 82 };