Repostiory containing DAPLink source code with Reset Pin workaround for HANI_IOT board.
Upstream: https://github.com/ARMmbed/DAPLink
source/family/nxp/lpc812/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 lpc812 |
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 LPC812_FLM[] = { |
Pawel Zarembski |
0:01f31e923fe2 | 25 | 0xE00ABE00, 0x062D780D, 0x24084068, 0xD3000040, 0x1E644058, 0x1C49D1FA, 0x2A001E52, 0x4770D1F2, |
Pawel Zarembski |
0:01f31e923fe2 | 26 | |
Pawel Zarembski |
0:01f31e923fe2 | 27 | // flash algo begins here |
Pawel Zarembski |
0:01f31e923fe2 | 28 | /* 0x20 */ 0x47700a80, 0x48454946, 0x60084449, 0x22004845, 0x21016302, 0x63426341, 0x63816341, 0x20024941, |
Pawel Zarembski |
0:01f31e923fe2 | 29 | /* 0x40 */ 0x70083940, 0x47704610, 0x47702000, 0x4c3eb5f8, 0x444c2032, 0x260f2500, 0xc2614622L, 0x31144621, |
Pawel Zarembski |
0:01f31e923fe2 | 30 | /* 0x60 */ 0x46204f3a, 0x47b89100, 0x28006960, 0x2034d10c, 0xc1614621L, 0x44484832, 0x60e06800, 0x99004620L, |
Pawel Zarembski |
0:01f31e923fe2 | 31 | /* 0x80 */ 0x696047b8, 0xd0002800L, 0xbdf82001L, 0x4d2eb5f8, 0x444d0a84, 0x60282032, 0x46292000, 0x311460ac, |
Pawel Zarembski |
0:01f31e923fe2 | 32 | /* 0xa0 */ 0x4e2a6068, 0x4628460f, 0x696847b0, 0xd10d2800L, 0x2034606c, 0x602860ac, 0x46394821, 0x68004448, |
Pawel Zarembski |
0:01f31e923fe2 | 33 | /* 0xc0 */ 0x462860e8, 0x696847b0, 0xd0002800L, 0xbdf82001L, 0x6b5f8, 0xd10e4614L, 0x68206861, 0x184068e2, |
Pawel Zarembski |
0:01f31e923fe2 | 34 | /* 0xe0 */ 0x188968a1, 0x69211840, 0x69611840, 0x69a11840, 0x42401840, 0x4d1461e0, 0x444d2132, 0x21006029, |
Pawel Zarembski |
0:01f31e923fe2 | 35 | /* 0x100 */ 0xab06069, 0x462960a8, 0x4f103114, 0x91004628L, 0x696847b8, 0xd10f2800L, 0x2033606e, 0x602860ac, |
Pawel Zarembski |
0:01f31e923fe2 | 36 | /* 0x120 */ 0x60e82040, 0x44484806, 0x61286800, 0x99004628L, 0x696847b8, 0xd0002800L, 0xbdf82001L, 0x2ee0, |
Pawel Zarembski |
0:01f31e923fe2 | 37 | /* 0x140 */ 0x4, 0x40048040, 0x8, 0x1fff1ff1 |
Pawel Zarembski |
0:01f31e923fe2 | 38 | }; |
Pawel Zarembski |
0:01f31e923fe2 | 39 | |
Pawel Zarembski |
0:01f31e923fe2 | 40 | /** |
Pawel Zarembski |
0:01f31e923fe2 | 41 | * List of start and size for each size of flash sector |
Pawel Zarembski |
0:01f31e923fe2 | 42 | * The size will apply to all sectors between the listed address and the next address |
Pawel Zarembski |
0:01f31e923fe2 | 43 | * in the list. |
Pawel Zarembski |
0:01f31e923fe2 | 44 | * The last pair in the list will have sectors starting at that address and ending |
Pawel Zarembski |
0:01f31e923fe2 | 45 | * at address start + size. |
Pawel Zarembski |
0:01f31e923fe2 | 46 | */ |
Pawel Zarembski |
0:01f31e923fe2 | 47 | static const sector_info_t sectors_info[] = { |
Pawel Zarembski |
0:01f31e923fe2 | 48 | {0x00000000, 0x1000}, |
Pawel Zarembski |
0:01f31e923fe2 | 49 | }; |
Pawel Zarembski |
0:01f31e923fe2 | 50 | |
Pawel Zarembski |
0:01f31e923fe2 | 51 | static const program_target_t flash = { |
Pawel Zarembski |
0:01f31e923fe2 | 52 | 0x10000025, // init |
Pawel Zarembski |
0:01f31e923fe2 | 53 | 0x10000049, // uninit |
Pawel Zarembski |
0:01f31e923fe2 | 54 | 0x1000004d, // erase_chip |
Pawel Zarembski |
0:01f31e923fe2 | 55 | 0x1000008d, // erase_sector |
Pawel Zarembski |
0:01f31e923fe2 | 56 | 0x100000d1, // program_page |
Pawel Zarembski |
0:01f31e923fe2 | 57 | 0x0, // Verify |
Pawel Zarembski |
0:01f31e923fe2 | 58 | |
Pawel Zarembski |
0:01f31e923fe2 | 59 | {0x10000001, 0x10000300, 0x10001000}, // {breakpoint, RSB, RSP} |
Pawel Zarembski |
0:01f31e923fe2 | 60 | |
Pawel Zarembski |
0:01f31e923fe2 | 61 | 0x10000400, // program_buffer |
Pawel Zarembski |
0:01f31e923fe2 | 62 | 0x10000000, // algo_start |
Pawel Zarembski |
0:01f31e923fe2 | 63 | 0x00000150, // algo_size |
Pawel Zarembski |
0:01f31e923fe2 | 64 | LPC812_FLM, // image |
Pawel Zarembski |
0:01f31e923fe2 | 65 | |
Pawel Zarembski |
0:01f31e923fe2 | 66 | 64 // ram_to_flash_bytes_to_be_written |
Pawel Zarembski |
0:01f31e923fe2 | 67 | }; |