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 /* Flash OS Routines (Automagically Generated)
Pawel Zarembski 0:01f31e923fe2 2 * Copyright (c) 2009-2019 ARM Limited
Pawel Zarembski 0:01f31e923fe2 3 *
Pawel Zarembski 0:01f31e923fe2 4 * Licensed under the Apache License, Version 2.0 (the "License");
Pawel Zarembski 0:01f31e923fe2 5 * you may not use this file except in compliance with the License.
Pawel Zarembski 0:01f31e923fe2 6 * You may obtain a copy of the License at
Pawel Zarembski 0:01f31e923fe2 7 *
Pawel Zarembski 0:01f31e923fe2 8 * http://www.apache.org/licenses/LICENSE-2.0
Pawel Zarembski 0:01f31e923fe2 9 *
Pawel Zarembski 0:01f31e923fe2 10 * Unless required by applicable law or agreed to in writing, software
Pawel Zarembski 0:01f31e923fe2 11 * distributed under the License is distributed on an "AS IS" BASIS,
Pawel Zarembski 0:01f31e923fe2 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
Pawel Zarembski 0:01f31e923fe2 13 * See the License for the specific language governing permissions and
Pawel Zarembski 0:01f31e923fe2 14 * limitations under the License.
Pawel Zarembski 0:01f31e923fe2 15 */
Pawel Zarembski 0:01f31e923fe2 16
Pawel Zarembski 0:01f31e923fe2 17 static const uint32_t cc3220sf_flash_prog_blob[] = {
Pawel Zarembski 0:01f31e923fe2 18 0xE00ABE00, 0x062D780D, 0x24084068, 0xD3000040, 0x1E644058, 0x1C49D1FA, 0x2A001E52, 0x4770D1F2,
Pawel Zarembski 0:01f31e923fe2 19 0xd1fd3801, 0x49964770, 0x6e48b418, 0x0000f440, 0x4b946648, 0xf241681a, 0x380140d5, 0xf042d1fd,
Pawel Zarembski 0:01f31e923fe2 20 0x60180010, 0x40d5f241, 0xd1fd3801, 0xf8d24a8e, 0xf040016c, 0xf8c2003c, 0x4b8c016c, 0xf0406c98,
Pawel Zarembski 0:01f31e923fe2 21 0x64980001, 0x6480f44f, 0x6cd86820, 0x0001f040, 0xf04f64d8, 0xf8cd0c00, 0x9800c000, 0x90001c40,
Pawel Zarembski 0:01f31e923fe2 22 0xd3fa2810, 0xf0206cd8, 0x64d80001, 0xf0206c98, 0x64980001, 0x68c0487e, 0x0ffff010, 0x487dd106,
Pawel Zarembski 0:01f31e923fe2 23 0xc000f8c0, 0x40d5f241, 0xd1fd3801, 0x00c8f8d1, 0x2802b2c0, 0xf8d2d113, 0xf0200110, 0xf420000f,
Pawel Zarembski 0:01f31e923fe2 24 0xf0406040, 0xf8c20002, 0xf8d20110, 0xf0200114, 0xf420000f, 0xf0406040, 0xf8c20002, 0xf8d20114,
Pawel Zarembski 0:01f31e923fe2 25 0xf0400184, 0xf8c20002, 0x486b0184, 0xf3c06800, 0x280e5083, 0x00b0f8d1, 0x007cf420, 0xf440bf0c,
Pawel Zarembski 0:01f31e923fe2 26 0xf4400048, 0xf8c10024, 0x486400b0, 0xf0236803, 0x60035380, 0xb2806820, 0xd2062802, 0x00a8f8d1,
Pawel Zarembski 0:01f31e923fe2 27 0x0004f040, 0x00a8f8c1, 0x6820e022, 0xd01f0c00, 0x0188f8d2, 0x00e1f040, 0x0188f8c2, 0x68034858,
Pawel Zarembski 0:01f31e923fe2 28 0x0f01f013, 0x6803d014, 0x0301f023, 0xf8d26003, 0xf4400188, 0xf8c27000, 0x48520188, 0xf0226802,
Pawel Zarembski 0:01f31e923fe2 29 0x60020201, 0xf8c01d00, 0x1d00c000, 0xc000f8c0, 0x6800484d, 0xf3c00f02, 0x2a036003, 0xd22cd00f,
Pawel Zarembski 0:01f31e923fe2 30 0x6800484a, 0x1080f3c0, 0x6a88b158, 0x0080f020, 0x69086288, 0x4070f020, 0x5080f040, 0xb9e0e01c,
Pawel Zarembski 0:01f31e923fe2 31 0x6a48e7ee, 0x000ff020, 0x6070f420, 0x30c0f420, 0x0001f040, 0x60a0f440, 0x3080f440, 0x6a886248,
Pawel Zarembski 0:01f31e923fe2 32 0x0080f020, 0x4070f020, 0x007ff420, 0x104cf440, 0x69086288, 0x4070f020, 0xbc186108, 0x0000f04f,
Pawel Zarembski 0:01f31e923fe2 33 0x20004770, 0x48324770, 0x2201f640, 0x49316142, 0x68816081, 0x0f04f011, 0x68c0d1fb, 0xbf184010,
Pawel Zarembski 0:01f31e923fe2 34 0x47702001, 0x2201f640, 0x614a4929, 0x482a6008, 0x68886088, 0x0f02f010, 0x68c8d1fb, 0xbf184010,
Pawel Zarembski 0:01f31e923fe2 35 0x47702001, 0xf242b430, 0x4b216c01, 0xc014f8c3, 0xbf182900, 0xc084f8df, 0xf020d01e, 0x601c047f,
Pawel Zarembski 0:01f31e923fe2 36 0xf000e00b, 0xf105057c, 0xf5054580, 0xf852257d, 0xf8c54b04, 0x1d004100, 0xf0101f09, 0xd1010f7c,
Pawel Zarembski 0:01f31e923fe2 37 0xb90c6b1c, 0xd1ec2900, 0xc020f8c3, 0xf0146a1c, 0xd1fb0f01, 0xd1e02900, 0x2000bc30, 0x00004770,
Pawel Zarembski 0:01f31e923fe2 38 0x4402f000, 0x4402fc18, 0x4402e000, 0x44025000, 0x4402d000, 0x4402f804, 0x4402dc78, 0x4402fc74,
Pawel Zarembski 0:01f31e923fe2 39 0x4402fc20, 0x4402f818, 0x4402dc80, 0x4402f840, 0x400fd000, 0xa4420004, 0xa4420002, 0xa4420001,
Pawel Zarembski 0:01f31e923fe2 40 0x00000004, 0x00000008, 0x00000014, 0x00000018, 0x00000024, 0x00000028, 0x00000030, 0x00000034,
Pawel Zarembski 0:01f31e923fe2 41 0x00000040, 0x00000044, 0x00000048, 0x0000004c, 0x00000050, 0x00000054, 0x00000058, 0x0000005c,
Pawel Zarembski 0:01f31e923fe2 42 0x00000060, 0x00000064, 0x00000068, 0x0000006c, 0x00000070, 0x00000074, 0x00000078, 0x0000007c,
Pawel Zarembski 0:01f31e923fe2 43 0x00000080, 0x00000084, 0x00000088, 0x0000008c, 0x00000090, 0x00000094, 0x00000098, 0x0000009c,
Pawel Zarembski 0:01f31e923fe2 44 0x000000a0, 0x000000a4, 0x000000a8, 0x000000ac, 0x000000b8, 0x000000bc, 0x000000c8, 0x000000cc,
Pawel Zarembski 0:01f31e923fe2 45 0x000000d8, 0x000000dc, 0x00000000
Pawel Zarembski 0:01f31e923fe2 46 };
Pawel Zarembski 0:01f31e923fe2 47
Pawel Zarembski 0:01f31e923fe2 48 // Start address of flash
Pawel Zarembski 0:01f31e923fe2 49 static const uint32_t flash_start = 0x01000000;
Pawel Zarembski 0:01f31e923fe2 50 // Size of flash
Pawel Zarembski 0:01f31e923fe2 51 static const uint32_t flash_size = 0x00100000;
Pawel Zarembski 0:01f31e923fe2 52
Pawel Zarembski 0:01f31e923fe2 53 /**
Pawel Zarembski 0:01f31e923fe2 54 * List of start and size for each size of flash sector
Pawel Zarembski 0:01f31e923fe2 55 * The size will apply to all sectors between the listed address and the next address
Pawel Zarembski 0:01f31e923fe2 56 * in the list.
Pawel Zarembski 0:01f31e923fe2 57 * The last pair in the list will have sectors starting at that address and ending
Pawel Zarembski 0:01f31e923fe2 58 * at address start + size.
Pawel Zarembski 0:01f31e923fe2 59 */
Pawel Zarembski 0:01f31e923fe2 60 static const sector_info_t sectors_info[] = {
Pawel Zarembski 0:01f31e923fe2 61 {0x01000000, 2048},
Pawel Zarembski 0:01f31e923fe2 62 };
Pawel Zarembski 0:01f31e923fe2 63
Pawel Zarembski 0:01f31e923fe2 64 static const program_target_t flash = {
Pawel Zarembski 0:01f31e923fe2 65 0x20000027, // Init
Pawel Zarembski 0:01f31e923fe2 66 0x200001e3, // UnInit
Pawel Zarembski 0:01f31e923fe2 67 0x200001e7, // EraseChip
Pawel Zarembski 0:01f31e923fe2 68 0x20000205, // EraseSector
Pawel Zarembski 0:01f31e923fe2 69 0x20000225, // ProgramPage
Pawel Zarembski 0:01f31e923fe2 70 0x0, // Verify
Pawel Zarembski 0:01f31e923fe2 71
Pawel Zarembski 0:01f31e923fe2 72 // BKPT : start of blob + 1
Pawel Zarembski 0:01f31e923fe2 73 // RSB : blob start + header + rw data offset
Pawel Zarembski 0:01f31e923fe2 74 // RSP : stack pointer
Pawel Zarembski 0:01f31e923fe2 75 {
Pawel Zarembski 0:01f31e923fe2 76 0x20000001,
Pawel Zarembski 0:01f31e923fe2 77 0x20000368,
Pawel Zarembski 0:01f31e923fe2 78 0x20000600
Pawel Zarembski 0:01f31e923fe2 79 },
Pawel Zarembski 0:01f31e923fe2 80
Pawel Zarembski 0:01f31e923fe2 81 0x20000000 + 0x00000A00, // mem buffer location
Pawel Zarembski 0:01f31e923fe2 82 0x20000000, // location to write prog_blob in target RAM
Pawel Zarembski 0:01f31e923fe2 83 sizeof(cc3220sf_flash_prog_blob), // prog_blob size
Pawel Zarembski 0:01f31e923fe2 84 cc3220sf_flash_prog_blob, // address of prog_blob
Pawel Zarembski 0:01f31e923fe2 85 0x00000400 // ram_to_flash_bytes_to_be_written
Pawel Zarembski 0:01f31e923fe2 86 };