Repostiory containing DAPLink source code with Reset Pin workaround for HANI_IOT board.
Upstream: https://github.com/ARMmbed/DAPLink
source/family/nxp/lpc1768/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 lpc1768 |
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 LPC1768_FLM[] = { |
Pawel Zarembski |
0:01f31e923fe2 | 25 | 0xe00abe00, 0x062d780d, 0x24084068, 0xd3000040, 0x1e644058, 0x1c49d1fa, 0x2a001e52, 0x4770d1f2, |
Pawel Zarembski |
0:01f31e923fe2 | 26 | |
Pawel Zarembski |
0:01f31e923fe2 | 27 | /*0x20*/ 0x28100b00, 0x210ed302, 0xd0eb01, 0x494f4770, 0x607af44f, 0x60084449, 0x2100484d, 0x21aa7001, |
Pawel Zarembski |
0:01f31e923fe2 | 28 | /*0x40*/ 0x21557301, 0x21017301, 0x1c40f800, 0x47702000, 0x47702000, 0x41f0e92d, 0x20324c46, 0x2500444c, |
Pawel Zarembski |
0:01f31e923fe2 | 29 | /*0x60*/ 0xe884261dL, 0xf1040061L, 0x4f430114, 0x46204688, 0x696047b8, 0x2034b960, 0x61e884, 0x4641483b, |
Pawel Zarembski |
0:01f31e923fe2 | 30 | /*0x80*/ 0x68004448, 0x462060e0, 0x696047b8, 0xd0002800L, 0xe8bd2001L, 0xe92d81f0L, 0xf7ff41f0L, 0x4d35ffc1, |
Pawel Zarembski |
0:01f31e923fe2 | 31 | /*0xa0*/ 0x444d4604, 0xe9c52032L, 0xf1050400L, 0x4e320114, 0x4628460f, 0x47b060ac, 0xb9686968L, 0xe9c52034L, |
Pawel Zarembski |
0:01f31e923fe2 | 32 | /*0xc0*/ 0x482a0400, 0x444860ac, 0x68004639, 0x462860e8, 0x696847b0, 0xd0dc2800L, 0xe7da2001L, 0x41f0e92d, |
Pawel Zarembski |
0:01f31e923fe2 | 33 | /*0xe0*/ 0x64614, 0x4825d11d, 0x12fcf8d4, 0xd03a4281L, 0x42814823, 0x4823d037, 0xd0344281L, 0x4030ea4f, |
Pawel Zarembski |
0:01f31e923fe2 | 34 | /*0x100*/ 0xd0304281L, 0x100e9d4, 0xe9d44408L, 0x44111202, 0x69214408, 0x69614408, 0x69a14408, 0x42404408, |
Pawel Zarembski |
0:01f31e923fe2 | 35 | /*0x120*/ 0x463061e0, 0xff7cf7ffL, 0x21324d12, 0x4f12444d, 0x1000e9c5, 0x114f105, 0x468860a8, 0x47b84628, |
Pawel Zarembski |
0:01f31e923fe2 | 36 | /*0x140*/ 0xb9806968L, 0xe9c52033L, 0xf44f0600L, 0xe9c57000L, 0x48064002, 0x44484641, 0x61286800, 0x47b84628, |
Pawel Zarembski |
0:01f31e923fe2 | 37 | /*0x160*/ 0x28006968, 0x2001d095, 0xe793, 0x4, 0x400fc080, 0x8, 0x1fff1ff1, 0x4e697370, |
Pawel Zarembski |
0:01f31e923fe2 | 38 | /*0x180*/ 0x12345678, 0x87654321L, 0x0, 0x0 |
Pawel Zarembski |
0:01f31e923fe2 | 39 | }; |
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 | {0, 1024}, |
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 | 0x1000002f, // init |
Pawel Zarembski |
0:01f31e923fe2 | 54 | 0x10000051, // uninit |
Pawel Zarembski |
0:01f31e923fe2 | 55 | 0x10000055, // erase_chip |
Pawel Zarembski |
0:01f31e923fe2 | 56 | 0x10000097, // erase_sector |
Pawel Zarembski |
0:01f31e923fe2 | 57 | 0x100000dd, // program_page |
Pawel Zarembski |
0:01f31e923fe2 | 58 | 0x0, // Verify |
Pawel Zarembski |
0:01f31e923fe2 | 59 | |
Pawel Zarembski |
0:01f31e923fe2 | 60 | {0x10000001, 0x10000214, 0x10001000}, // {breakpoint, RSB, RSP} |
Pawel Zarembski |
0:01f31e923fe2 | 61 | |
Pawel Zarembski |
0:01f31e923fe2 | 62 | 0x1000023c, // program_buffer |
Pawel Zarembski |
0:01f31e923fe2 | 63 | 0x10000000, // algo_start |
Pawel Zarembski |
0:01f31e923fe2 | 64 | 0x00000190, // algo_size |
Pawel Zarembski |
0:01f31e923fe2 | 65 | LPC1768_FLM, // image |
Pawel Zarembski |
0:01f31e923fe2 | 66 | |
Pawel Zarembski |
0:01f31e923fe2 | 67 | 512 // ram_to_flash_bytes_to_be_written |
Pawel Zarembski |
0:01f31e923fe2 | 68 | }; |