![](/media/cache/group/arrow_temp_636x636.png.50x50_q85.png)
Repostiory containing DAPLink source code with Reset Pin workaround for HANI_IOT board.
Upstream: https://github.com/ARMmbed/DAPLink
source/family/wiznet/w7500/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 W7500 |
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 | static const uint32_t w7500_flash_prog_blob[] = { |
Pawel Zarembski |
0:01f31e923fe2 | 24 | 0xE00ABE00, 0x062D780D, 0x24084068, 0xD3000040, 0x1E644058, 0x1C49D1FA, 0x2A001E52, 0x4770D1F2, |
Pawel Zarembski |
0:01f31e923fe2 | 25 | 0x4d27b430, 0x606c2400, 0x1e644d26, 0x4c26602c, 0x086d6925, 0x6125006d, 0x46a44c24, 0x4760bc30, |
Pawel Zarembski |
0:01f31e923fe2 | 26 | 0x47702000, 0x47702000, 0x2014b570, 0x21004c1c, 0x4d1c6061, 0x602c1e4c, 0x69224c1b, 0x006d0855, |
Pawel Zarembski |
0:01f31e923fe2 | 27 | 0x460b6125, 0x461a4c19, 0x200047a0, 0xb570bd70, 0x49132512, 0x604a2200, 0x17494b12, 0x4c126019, |
Pawel Zarembski |
0:01f31e923fe2 | 28 | 0x08496921, 0x61210049, 0x4c104601, 0x46284613, 0x200047a0, 0xb570bd70, 0x4b092422, 0x605d2500, |
Pawel Zarembski |
0:01f31e923fe2 | 29 | 0x175b4d08, 0x4d08602b, 0x085e692b, 0x612e0076, 0x4601460b, 0x4c054620, 0x200047a0, 0x0000bd70, |
Pawel Zarembski |
0:01f31e923fe2 | 30 | 0xe000ed00, 0xe000e180, 0xe000e000, 0x1fff1001, 0x00000000, |
Pawel Zarembski |
0:01f31e923fe2 | 31 | }; |
Pawel Zarembski |
0:01f31e923fe2 | 32 | |
Pawel Zarembski |
0:01f31e923fe2 | 33 | /** |
Pawel Zarembski |
0:01f31e923fe2 | 34 | * List of start and size for each size of flash sector |
Pawel Zarembski |
0:01f31e923fe2 | 35 | * The size will apply to all sectors between the listed address and the next address |
Pawel Zarembski |
0:01f31e923fe2 | 36 | * in the list. |
Pawel Zarembski |
0:01f31e923fe2 | 37 | * The last pair in the list will have sectors starting at that address and ending |
Pawel Zarembski |
0:01f31e923fe2 | 38 | * at address start + size. |
Pawel Zarembski |
0:01f31e923fe2 | 39 | */ |
Pawel Zarembski |
0:01f31e923fe2 | 40 | static const sector_info_t sectors_info[] = { |
Pawel Zarembski |
0:01f31e923fe2 | 41 | {0, 256}, |
Pawel Zarembski |
0:01f31e923fe2 | 42 | }; |
Pawel Zarembski |
0:01f31e923fe2 | 43 | |
Pawel Zarembski |
0:01f31e923fe2 | 44 | static const program_target_t flash = { |
Pawel Zarembski |
0:01f31e923fe2 | 45 | 0x20000041, // Init |
Pawel Zarembski |
0:01f31e923fe2 | 46 | 0x20000045, // UnInit |
Pawel Zarembski |
0:01f31e923fe2 | 47 | 0x20000049, // EraseChip |
Pawel Zarembski |
0:01f31e923fe2 | 48 | 0x2000006F, // EraseSector |
Pawel Zarembski |
0:01f31e923fe2 | 49 | 0x20000097, // ProgramPage |
Pawel Zarembski |
0:01f31e923fe2 | 50 | 0x0, // Verify |
Pawel Zarembski |
0:01f31e923fe2 | 51 | |
Pawel Zarembski |
0:01f31e923fe2 | 52 | // BKPT : start of blob + 1 |
Pawel Zarembski |
0:01f31e923fe2 | 53 | // RSB : blob start + header + rw data offset |
Pawel Zarembski |
0:01f31e923fe2 | 54 | // RSP : stack pointer |
Pawel Zarembski |
0:01f31e923fe2 | 55 | { |
Pawel Zarembski |
0:01f31e923fe2 | 56 | 0x20000000 + 0x00000001, |
Pawel Zarembski |
0:01f31e923fe2 | 57 | 0x20000000 + 0x00000020 + 0x000000b0, |
Pawel Zarembski |
0:01f31e923fe2 | 58 | 0x20000800 |
Pawel Zarembski |
0:01f31e923fe2 | 59 | }, |
Pawel Zarembski |
0:01f31e923fe2 | 60 | |
Pawel Zarembski |
0:01f31e923fe2 | 61 | 0x20000000 + 0x00000A00, // mem buffer location |
Pawel Zarembski |
0:01f31e923fe2 | 62 | 0x20000000, // location to write prog_blob in target RAM |
Pawel Zarembski |
0:01f31e923fe2 | 63 | sizeof(w7500_flash_prog_blob), // prog_blob size |
Pawel Zarembski |
0:01f31e923fe2 | 64 | w7500_flash_prog_blob, // address of prog_blob |
Pawel Zarembski |
0:01f31e923fe2 | 65 | |
Pawel Zarembski |
0:01f31e923fe2 | 66 | // Do not modify. program_buffer_size of W7500 must be set to 0x00000100 |
Pawel Zarembski |
0:01f31e923fe2 | 67 | 0x00000100 // ram_to_flash_bytes_to_be_written |
Pawel Zarembski |
0:01f31e923fe2 | 68 | }; |