Repostiory containing DAPLink source code with Reset Pin workaround for HANI_IOT board.
Upstream: https://github.com/ARMmbed/DAPLink
source/family/nxp/lpc1114/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 | /** |
Pawel Zarembski |
0:01f31e923fe2 | 2 | * @file flash_blob.c |
Pawel Zarembski |
0:01f31e923fe2 | 3 | * @brief Flash algorithm for the lpc1114 |
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 LPC1114_FLM[] = { |
Pawel Zarembski |
0:01f31e923fe2 | 25 | /*0x000*/ 0xE00ABE00, 0x062D780D, 0x24084068, 0xD3000040, 0x1E644058, 0x1C49D1FA, 0x2A001E52, 0x4770D1F2, |
Pawel Zarembski |
0:01f31e923fe2 | 26 | /*0x020*/ 0x47700b00, 0x21004841, 0x22016301, 0x63416342, 0x6b416342, 0xd0fc07c9, 0x493c6382, 0x39402002, |
Pawel Zarembski |
0:01f31e923fe2 | 27 | /*0x040*/ 0x20006008, 0x20004770, 0xb5f84770, 0x20324c38, 0x2500444c, 0x46222607, 0x4621c261, 0x4f353114, |
Pawel Zarembski |
0:01f31e923fe2 | 28 | /*0x060*/ 0x91004620, 0x696047b8, 0xd10a2800, 0x46212034, 0x4831c161, 0x462060e0, 0x47b89900, 0x28006960, |
Pawel Zarembski |
0:01f31e923fe2 | 29 | /*0x080*/ 0x2001d000, 0xb5f8bdf8, 0x0b044d29, 0x2032444d, 0x4629606c, 0x311460ac, 0x4e266028, 0x4628460f, |
Pawel Zarembski |
0:01f31e923fe2 | 30 | /*0x0A0*/ 0x696847b0, 0xd10b2800, 0x2034606c, 0x602860ac, 0x60e84821, 0x46284639, 0x696847b0, 0xd0002800, |
Pawel Zarembski |
0:01f31e923fe2 | 31 | /*0x0C0*/ 0xbdf82001, 0x4614b5f8, 0xd10e0006, 0x68206861, 0x184068e2, 0x188968a1, 0x69211840, 0x69611840, |
Pawel Zarembski |
0:01f31e923fe2 | 32 | /*0x0E0*/ 0x69a11840, 0x42401840, 0x4d1161e0, 0x444d0b30, 0x60682132, 0x60a86029, 0x31144629, 0x46284f0d, |
Pawel Zarembski |
0:01f31e923fe2 | 33 | /*0x100*/ 0x47b89100, 0x28006968, 0x606ed10e, 0x60ac2033, 0x20ff6028, 0x60e83001, 0x61284807, 0x99004628, |
Pawel Zarembski |
0:01f31e923fe2 | 34 | /*0x120*/ 0x696847b8, 0xd0002800, 0xbdf82001, 0x40048040, 0x00000004, 0x1fff1ff1, 0x00002ee0, 0x00000000, |
Pawel Zarembski |
0:01f31e923fe2 | 35 | }; |
Pawel Zarembski |
0:01f31e923fe2 | 36 | |
Pawel Zarembski |
0:01f31e923fe2 | 37 | /** |
Pawel Zarembski |
0:01f31e923fe2 | 38 | * List of start and size for each size of flash sector |
Pawel Zarembski |
0:01f31e923fe2 | 39 | * The size will apply to all sectors between the listed address and the next address |
Pawel Zarembski |
0:01f31e923fe2 | 40 | * in the list. |
Pawel Zarembski |
0:01f31e923fe2 | 41 | * The last pair in the list will have sectors starting at that address and ending |
Pawel Zarembski |
0:01f31e923fe2 | 42 | * at address start + size. |
Pawel Zarembski |
0:01f31e923fe2 | 43 | */ |
Pawel Zarembski |
0:01f31e923fe2 | 44 | static const sector_info_t sectors_info[] = { |
Pawel Zarembski |
0:01f31e923fe2 | 45 | {0, 4096}, |
Pawel Zarembski |
0:01f31e923fe2 | 46 | }; |
Pawel Zarembski |
0:01f31e923fe2 | 47 | |
Pawel Zarembski |
0:01f31e923fe2 | 48 | static const program_target_t flash = { |
Pawel Zarembski |
0:01f31e923fe2 | 49 | 0x10000025, // Init |
Pawel Zarembski |
0:01f31e923fe2 | 50 | 0x10000047, // UnInit |
Pawel Zarembski |
0:01f31e923fe2 | 51 | 0x1000004B, // EraseChip |
Pawel Zarembski |
0:01f31e923fe2 | 52 | 0x10000087, // EraseSector |
Pawel Zarembski |
0:01f31e923fe2 | 53 | 0x100000C5, // ProgramPage |
Pawel Zarembski |
0:01f31e923fe2 | 54 | 0x0, // Verify |
Pawel Zarembski |
0:01f31e923fe2 | 55 | |
Pawel Zarembski |
0:01f31e923fe2 | 56 | // RSB : base adreess is address of Execution Region PrgData in map file |
Pawel Zarembski |
0:01f31e923fe2 | 57 | // to access global/static data |
Pawel Zarembski |
0:01f31e923fe2 | 58 | // RSP : Initial stack pointer |
Pawel Zarembski |
0:01f31e923fe2 | 59 | {0x10000001, 0x10000020 + 0x00000120, 0x10001000 - 32}, // {breakpoint, RSB, RSP} |
Pawel Zarembski |
0:01f31e923fe2 | 60 | |
Pawel Zarembski |
0:01f31e923fe2 | 61 | 0x10000200, // program_buffer |
Pawel Zarembski |
0:01f31e923fe2 | 62 | 0x10000000, // algo_start |
Pawel Zarembski |
0:01f31e923fe2 | 63 | 0x00000150, // algo_size |
Pawel Zarembski |
0:01f31e923fe2 | 64 | LPC1114_FLM,// algo_blob |
Pawel Zarembski |
0:01f31e923fe2 | 65 | |
Pawel Zarembski |
0:01f31e923fe2 | 66 | 256 // program_buffer_size |
Pawel Zarembski |
0:01f31e923fe2 | 67 | }; |