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 lpc55S69_flash_prog_blob[] = {
Pawel Zarembski 0:01f31e923fe2 18 0xE00ABE00, 0x062D780D, 0x24084068, 0xD3000040, 0x1E644058, 0x1C49D1FA, 0x2A001E52, 0x4770D1F2,
Pawel Zarembski 0:01f31e923fe2 19 0x20c8b580, 0x0002f2c4, 0x60012120, 0x6080f64f, 0x4100f240, 0x70fff6cf, 0x0100f2c4, 0x500a2200,
Pawel Zarembski 0:01f31e923fe2 20 0x6084f64f, 0x70fff6cf, 0x6808500a, 0x6300f04f, 0x30f8f440, 0xf64f6008, 0xf6cf5048, 0x500b70ff,
Pawel Zarembski 0:01f31e923fe2 21 0x6028f64f, 0x70fff6cf, 0xf243500b, 0xf2c40010, 0x68030001, 0x4380f443, 0xf8416003, 0xf04f2c80,
Pawel Zarembski 0:01f31e923fe2 22 0x21024080, 0xf2406001, 0xf2c0000c, 0x44480000, 0xf862f000, 0xbf182800, 0xbd802001, 0x47702000,
Pawel Zarembski 0:01f31e923fe2 23 0xf240b510, 0xf2c0040c, 0xf2460400, 0xeb09636c, 0xf6c60004, 0x21003365, 0x2218f44f, 0xf86cf000,
Pawel Zarembski 0:01f31e923fe2 24 0xbf182800, 0xeb09bd10, 0x21000004, 0x2218f44f, 0x4010e8bd, 0xb8b0f000, 0xf240b5b0, 0xf2c0050c,
Pawel Zarembski 0:01f31e923fe2 25 0xeb090500, 0x690a0105, 0xf2464604, 0xf6c6636c, 0x46083365, 0xf0004621, 0x2800f84f, 0xbdb0bf18,
Pawel Zarembski 0:01f31e923fe2 26 0x0005eb09, 0x46216902, 0x40b0e8bd, 0xb894f000, 0xb085b5f0, 0x070cf240, 0x4606460d, 0x0700f2c0,
Pawel Zarembski 0:01f31e923fe2 27 0x0007eb09, 0x462b4631, 0xf0004614, 0xb108f85d, 0xbdf0b005, 0xf10da804, 0x90000c0c, 0x0007eb09,
Pawel Zarembski 0:01f31e923fe2 28 0x462a4631, 0xf8cd4623, 0xf000c004, 0xb005f88b, 0x0000bdf0, 0xe7fdbe00, 0x1100f241, 0x3100f2c1,
Pawel Zarembski 0:01f31e923fe2 29 0x29006809, 0x680ad00a, 0x0308f240, 0x2207f3c2, 0x0300f2c0, 0x2003f849, 0x47086849, 0x309ef240,
Pawel Zarembski 0:01f31e923fe2 30 0x0000f2c0, 0x31abf240, 0x0100f2c0, 0x44794478, 0xf7ff2276, 0xbf00ffdf, 0x0c08f240, 0x0c00f2c0,
Pawel Zarembski 0:01f31e923fe2 31 0xc00cf859, 0x0f00f1bc, 0xf241d00b, 0xf2c11c00, 0xf8dc3c00, 0xf1bcc000, 0xd0070f00, 0xc008f8dc,
Pawel Zarembski 0:01f31e923fe2 32 0xf2444760, 0xf2c11c3b, 0x47603c00, 0x304ef240, 0x0000f2c0, 0x315bf240, 0x0100f2c0, 0x44794478,
Pawel Zarembski 0:01f31e923fe2 33 0xf7ff2286, 0xbf00ffb7, 0x0c08f240, 0x0c00f2c0, 0xc00cf859, 0x0f00f1bc, 0xf241d00b, 0xf2c11c00,
Pawel Zarembski 0:01f31e923fe2 34 0xf8dc3c00, 0xf1bcc000, 0xd0070f00, 0xc00cf8dc, 0xf2444760, 0xf2c11c9d, 0x47603c00, 0x20fef240,
Pawel Zarembski 0:01f31e923fe2 35 0x0000f2c0, 0x310bf240, 0x0100f2c0, 0x44794478, 0xf7ff2296, 0xbf00ff8f, 0x1300f241, 0x3300f2c1,
Pawel Zarembski 0:01f31e923fe2 36 0x2b00681b, 0x691bd001, 0xf2404718, 0xf2c020d0, 0xf2400000, 0xf2c021dd, 0x44780100, 0x229e4479,
Pawel Zarembski 0:01f31e923fe2 37 0xff78f7ff, 0x0c08f240, 0x0c00f2c0, 0xc00cf859, 0x0f00f1bc, 0xf241d00b, 0xf2c11c00, 0xf8dc3c00,
Pawel Zarembski 0:01f31e923fe2 38 0xf1bcc000, 0xd0070f00, 0xc014f8dc, 0xf2444760, 0xf2c12c7d, 0x47603c00, 0x2082f240, 0x0000f2c0,
Pawel Zarembski 0:01f31e923fe2 39 0x218ff240, 0x0100f2c0, 0x44794478, 0xf7ff22b2, 0xbf00ff51, 0x1300f241, 0x3300f2c1, 0x2b00681b,
Pawel Zarembski 0:01f31e923fe2 40 0x699bd001, 0xf2404718, 0xf2c02054, 0xf2400000, 0xf2c02161, 0x44780100, 0x22bb4479, 0xff3af7ff,
Pawel Zarembski 0:01f31e923fe2 41 0x1100f241, 0x3100f2c1, 0x29006809, 0x69c9d001, 0xf2404708, 0xf2c02028, 0xf2400000, 0xf2c02135,
Pawel Zarembski 0:01f31e923fe2 42 0x44780100, 0x22c54479, 0xff24f7ff, 0x1100f241, 0x3100f2c1, 0x29006809, 0x6a09d001, 0xf2404708,
Pawel Zarembski 0:01f31e923fe2 43 0xf2c010fc, 0xf2400000, 0xf2c02109, 0x44780100, 0x22cc4479, 0xff0ef7ff, 0x1100f241, 0x3100f2c1,
Pawel Zarembski 0:01f31e923fe2 44 0x29006809, 0xf644d004, 0xf2c11151, 0x47083100, 0x10caf240, 0x0000f2c0, 0x11d7f240, 0x0100f2c0,
Pawel Zarembski 0:01f31e923fe2 45 0x44794478, 0xf7ff22d2, 0xbf00fef5, 0x230bf644, 0x3300f2c1, 0xbf004718, 0x1c00f241, 0x3c00f2c1,
Pawel Zarembski 0:01f31e923fe2 46 0xc000f8dc, 0x0f00f1bc, 0xf8dcd002, 0x4760c040, 0x108af240, 0x0000f2c0, 0x1197f240, 0x0100f2c0,
Pawel Zarembski 0:01f31e923fe2 47 0x44794478, 0xf7ff22e0, 0xbf00fed5, 0x21fff644, 0x3100f2c1, 0xbf004708, 0x313df644, 0x3100f2c1,
Pawel Zarembski 0:01f31e923fe2 48 0xbf004708, 0x1200f241, 0x3200f2c1, 0x2a006812, 0xf644d004, 0xf2c1328b, 0x47103200, 0x103ef240,
Pawel Zarembski 0:01f31e923fe2 49 0x0000f2c0, 0x114bf240, 0x0100f2c0, 0x44794478, 0xf7ff22f5, 0xbf00feaf, 0x1300f241, 0x3300f2c1,
Pawel Zarembski 0:01f31e923fe2 50 0x2b00681b, 0x6a5bd001, 0xf2404718, 0xf2c01010, 0xf2400000, 0xf2c0111d, 0x44780100, 0x22fc4479,
Pawel Zarembski 0:01f31e923fe2 51 0xfe98f7ff, 0x62a7f644, 0x3200f2c1, 0xbf004710, 0x1c00f241, 0x3c00f2c1, 0xc000f8dc, 0x0f00f1bc,
Pawel Zarembski 0:01f31e923fe2 52 0xf8dcd002, 0x4760c02c, 0x00d2f240, 0x0000f2c0, 0x01dff240, 0x0100f2c0, 0x44794478, 0x7284f44f,
Pawel Zarembski 0:01f31e923fe2 53 0xfe78f7ff, 0x1200f241, 0x3200f2c1, 0x2a006812, 0x6b12d001, 0xf2404710, 0xf2c000a4, 0xf2400000,
Pawel Zarembski 0:01f31e923fe2 54 0xf2c001b1, 0x44780100, 0xf2404479, 0xf7ff120f, 0xbf00fe61, 0x1200f241, 0x3200f2c1, 0x2a006812,
Pawel Zarembski 0:01f31e923fe2 55 0x6b52d001, 0xf2404710, 0xf2c00074, 0xf2400000, 0xf2c00181, 0x44780100, 0xf44f4479, 0xf7ff728b,
Pawel Zarembski 0:01f31e923fe2 56 0xbf00fe49, 0x1300f241, 0x3300f2c1, 0x2b00681b, 0x6b9bd001, 0xf2404718, 0xf2c00044, 0xf2400000,
Pawel Zarembski 0:01f31e923fe2 57 0xf2c00151, 0x44780100, 0xf2404479, 0xf7ff121d, 0xbf00fe31, 0x6c15f644, 0x3c00f2c1, 0xbf004760,
Pawel Zarembski 0:01f31e923fe2 58 0x1200f241, 0x3200f2c1, 0x2a006812, 0x6a92d001, 0xf2404710, 0xf2c00008, 0xf2400000, 0xf2c00115,
Pawel Zarembski 0:01f31e923fe2 59 0x44780100, 0xf44f4479, 0xf7ff7295, 0x4c46fe13, 0x5f485341, 0x5f495041, 0x45455254, 0x2f2e2e00,
Pawel Zarembski 0:01f31e923fe2 60 0x2e2f2e2e, 0x6f732f2e, 0x65637275, 0x70786e2f, 0x63706c2f, 0x36533535, 0x73662f39, 0x61695f6c,
Pawel Zarembski 0:01f31e923fe2 61 0x00632e70, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
Pawel Zarembski 0:01f31e923fe2 62 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
Pawel Zarembski 0:01f31e923fe2 63 0x00000000, 0x00000000, 0x00000000
Pawel Zarembski 0:01f31e923fe2 64 };
Pawel Zarembski 0:01f31e923fe2 65
Pawel Zarembski 0:01f31e923fe2 66 // Start address of flash
Pawel Zarembski 0:01f31e923fe2 67 static const uint32_t flash_start = 0x00000000;
Pawel Zarembski 0:01f31e923fe2 68 // Size of flash
Pawel Zarembski 0:01f31e923fe2 69 static const uint32_t flash_size = 0x00098000;
Pawel Zarembski 0:01f31e923fe2 70
Pawel Zarembski 0:01f31e923fe2 71 /**
Pawel Zarembski 0:01f31e923fe2 72 * List of start and size for each size of flash sector
Pawel Zarembski 0:01f31e923fe2 73 * The size will apply to all sectors between the listed address and the next address
Pawel Zarembski 0:01f31e923fe2 74 * in the list.
Pawel Zarembski 0:01f31e923fe2 75 * The last pair in the list will have sectors starting at that address and ending
Pawel Zarembski 0:01f31e923fe2 76 * at address start + size.
Pawel Zarembski 0:01f31e923fe2 77 */
Pawel Zarembski 0:01f31e923fe2 78 static const sector_info_t sectors_info[] = {
Pawel Zarembski 0:01f31e923fe2 79 {0x00000000, 0x00008000},
Pawel Zarembski 0:01f31e923fe2 80 };
Pawel Zarembski 0:01f31e923fe2 81
Pawel Zarembski 0:01f31e923fe2 82 static const program_target_t flash = {
Pawel Zarembski 0:01f31e923fe2 83 0x20000021, // Init
Pawel Zarembski 0:01f31e923fe2 84 0x2000009d, // UnInit
Pawel Zarembski 0:01f31e923fe2 85 0x200000a1, // EraseChip
Pawel Zarembski 0:01f31e923fe2 86 0x200000d9, // EraseSector
Pawel Zarembski 0:01f31e923fe2 87 0x20000111, // ProgramPage
Pawel Zarembski 0:01f31e923fe2 88 0x0, // Verify
Pawel Zarembski 0:01f31e923fe2 89
Pawel Zarembski 0:01f31e923fe2 90 // BKPT : start of blob + 1
Pawel Zarembski 0:01f31e923fe2 91 // RSB : blob start + header + rw data offset
Pawel Zarembski 0:01f31e923fe2 92 // RSP : stack pointer
Pawel Zarembski 0:01f31e923fe2 93 {
Pawel Zarembski 0:01f31e923fe2 94 0x20000001,
Pawel Zarembski 0:01f31e923fe2 95 0x20000564,
Pawel Zarembski 0:01f31e923fe2 96 0x20000800
Pawel Zarembski 0:01f31e923fe2 97 },
Pawel Zarembski 0:01f31e923fe2 98
Pawel Zarembski 0:01f31e923fe2 99 0x20000000 + 0x00000A00, // mem buffer location
Pawel Zarembski 0:01f31e923fe2 100 0x20000000, // location to write prog_blob in target RAM
Pawel Zarembski 0:01f31e923fe2 101 sizeof(lpc55S69_flash_prog_blob), // prog_blob size
Pawel Zarembski 0:01f31e923fe2 102 lpc55S69_flash_prog_blob, // address of prog_blob
Pawel Zarembski 0:01f31e923fe2 103 0x00000200 // ram_to_flash_bytes_to_be_written
Pawel Zarembski 0:01f31e923fe2 104 };