Repostiory containing DAPLink source code with Reset Pin workaround for HANI_IOT board.
Upstream: https://github.com/ARMmbed/DAPLink
source/family/nxp/lpc54608/flash_blob.c@0:01f31e923fe2, 2020-04-07 (annotated)
- 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?
User | Revision | Line number | New 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 lpc54608_flash_prog_blob[] = { |
Pawel Zarembski |
0:01f31e923fe2 | 18 | 0xE00ABE00, 0x062D780D, 0x24084068, 0xD3000040, 0x1E644058, 0x1C49D1FA, 0x2A001E52, 0x4770D1F2, |
Pawel Zarembski |
0:01f31e923fe2 | 19 | 0x21002210, 0xf8c00690, 0x4a2c2630, 0xf0236813, 0x60134380, 0x1280f8c0, 0x1284f8c0, 0x68134a28, |
Pawel Zarembski |
0:01f31e923fe2 | 20 | 0x4370f423, 0xf8c06013, 0x21021380, 0x20006001, 0x20004770, 0xb5104770, 0x2000210f, 0xf844f000, |
Pawel Zarembski |
0:01f31e923fe2 | 21 | 0xbf182800, 0x4a1fbd10, 0xe8bd210f, 0x20004010, 0xb864f000, 0x0bc4b510, 0x46084621, 0xf834f000, |
Pawel Zarembski |
0:01f31e923fe2 | 22 | 0xbf182800, 0x4a17bd10, 0xe8bd4621, 0x46084010, 0xb854f000, 0x4614b570, 0xd10e0005, 0x0100e9d4, |
Pawel Zarembski |
0:01f31e923fe2 | 23 | 0xe9d44408, 0x44111202, 0x69214408, 0x69614408, 0x69a14408, 0x42404408, 0x0be861e0, 0xf0004601, |
Pawel Zarembski |
0:01f31e923fe2 | 24 | 0x2800f813, 0xbd70bf18, 0x46214b06, 0xe8bd4628, 0xf44f4070, 0xf0007280, 0x0000b818, 0x40000500, |
Pawel Zarembski |
0:01f31e923fe2 | 25 | 0x40000400, 0x00b71b00, 0xb08bb500, 0x92002232, 0x0101e9cd, 0x46684a39, 0x4790a906, 0x28009806, |
Pawel Zarembski |
0:01f31e923fe2 | 26 | 0xf600bf18, 0xb00b10c4, 0xb500bd00, 0xf04fb08b, 0x92030c33, 0xc000f8cd, 0x0101e9cd, 0x707af44f, |
Pawel Zarembski |
0:01f31e923fe2 | 27 | 0xf0f0fbb3, 0x4a2d9004, 0xa9064668, 0x98064790, 0xbf182800, 0x10c4f600, 0xbd00b00b, 0xb08bb500, |
Pawel Zarembski |
0:01f31e923fe2 | 28 | 0x93002334, 0x0101e9cd, 0x707af44f, 0xf0f0fbb2, 0x4a229003, 0xa9064668, 0x98064790, 0xbf182800, |
Pawel Zarembski |
0:01f31e923fe2 | 29 | 0x10c4f600, 0xbd00b00b, 0xb08bb500, 0x9300233b, 0x0101e9cd, 0x707af44f, 0xf0f0fbb2, 0x4a179003, |
Pawel Zarembski |
0:01f31e923fe2 | 30 | 0xa9064668, 0x98064790, 0xbf182800, 0x10c4f600, 0xbd00b00b, 0xb08bb500, 0x92002235, 0x0101e9cd, |
Pawel Zarembski |
0:01f31e923fe2 | 31 | 0x46684a0e, 0x4790a906, 0x28009806, 0xf600bf18, 0xb00b10c4, 0xb500bd00, 0x2338b08b, 0x93009203, |
Pawel Zarembski |
0:01f31e923fe2 | 32 | 0x0101e9cd, 0x46684a05, 0x4790a906, 0x28009806, 0xf600bf18, 0xb00b10c4, 0x0000bd00, 0x03000205, |
Pawel Zarembski |
0:01f31e923fe2 | 33 | 0x00000000 |
Pawel Zarembski |
0:01f31e923fe2 | 34 | }; |
Pawel Zarembski |
0:01f31e923fe2 | 35 | |
Pawel Zarembski |
0:01f31e923fe2 | 36 | // Start address of flash |
Pawel Zarembski |
0:01f31e923fe2 | 37 | static const uint32_t flash_start = 0x00000000; |
Pawel Zarembski |
0:01f31e923fe2 | 38 | // Size of flash |
Pawel Zarembski |
0:01f31e923fe2 | 39 | static const uint32_t flash_size = 0x00080000; |
Pawel Zarembski |
0:01f31e923fe2 | 40 | |
Pawel Zarembski |
0:01f31e923fe2 | 41 | /** |
Pawel Zarembski |
0:01f31e923fe2 | 42 | * List of start and size for each size of flash sector |
Pawel Zarembski |
0:01f31e923fe2 | 43 | * The size will apply to all sectors between the listed address and the next address |
Pawel Zarembski |
0:01f31e923fe2 | 44 | * in the list. |
Pawel Zarembski |
0:01f31e923fe2 | 45 | * The last pair in the list will have sectors starting at that address and ending |
Pawel Zarembski |
0:01f31e923fe2 | 46 | * at address start + size. |
Pawel Zarembski |
0:01f31e923fe2 | 47 | */ |
Pawel Zarembski |
0:01f31e923fe2 | 48 | static const sector_info_t sectors_info[] = { |
Pawel Zarembski |
0:01f31e923fe2 | 49 | {0x00000000, 0x00008000}, |
Pawel Zarembski |
0:01f31e923fe2 | 50 | }; |
Pawel Zarembski |
0:01f31e923fe2 | 51 | |
Pawel Zarembski |
0:01f31e923fe2 | 52 | static const program_target_t flash = { |
Pawel Zarembski |
0:01f31e923fe2 | 53 | 0x20000021, // Init |
Pawel Zarembski |
0:01f31e923fe2 | 54 | 0x20000053, // UnInit |
Pawel Zarembski |
0:01f31e923fe2 | 55 | 0x20000057, // EraseChip |
Pawel Zarembski |
0:01f31e923fe2 | 56 | 0x20000075, // EraseSector |
Pawel Zarembski |
0:01f31e923fe2 | 57 | 0x20000095, // ProgramPage |
Pawel Zarembski |
0:01f31e923fe2 | 58 | 0x0, // Verify |
Pawel Zarembski |
0:01f31e923fe2 | 59 | |
Pawel Zarembski |
0:01f31e923fe2 | 60 | // BKPT : start of blob + 1 |
Pawel Zarembski |
0:01f31e923fe2 | 61 | // RSB : blob start + header + rw data offset |
Pawel Zarembski |
0:01f31e923fe2 | 62 | // RSP : stack pointer |
Pawel Zarembski |
0:01f31e923fe2 | 63 | { |
Pawel Zarembski |
0:01f31e923fe2 | 64 | 0x20000001, |
Pawel Zarembski |
0:01f31e923fe2 | 65 | 0x200001e0, |
Pawel Zarembski |
0:01f31e923fe2 | 66 | 0x20000400 |
Pawel Zarembski |
0:01f31e923fe2 | 67 | }, |
Pawel Zarembski |
0:01f31e923fe2 | 68 | |
Pawel Zarembski |
0:01f31e923fe2 | 69 | 0x20000000 + 0x00000A00, // mem buffer location |
Pawel Zarembski |
0:01f31e923fe2 | 70 | 0x20000000, // location to write prog_blob in target RAM |
Pawel Zarembski |
0:01f31e923fe2 | 71 | sizeof(lpc54608_flash_prog_blob), // prog_blob size |
Pawel Zarembski |
0:01f31e923fe2 | 72 | lpc54608_flash_prog_blob, // address of prog_blob |
Pawel Zarembski |
0:01f31e923fe2 | 73 | 0x00000100 // ram_to_flash_bytes_to_be_written |
Pawel Zarembski |
0:01f31e923fe2 | 74 | }; |