Repostiory containing DAPLink source code with Reset Pin workaround for HANI_IOT board.
Upstream: https://github.com/ARMmbed/DAPLink
source/family/st/stm32f411/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 stm32f411 |
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 output_flash_prog_blob[] = { |
Pawel Zarembski |
0:01f31e923fe2 | 25 | 0xE00ABE00, 0x062D780D, 0x24084068, 0xD3000040, 0x1E644058, 0x1C49D1FA, 0x2A001E52, 0x4770D1F2, |
Pawel Zarembski |
0:01f31e923fe2 | 26 | 0x03004601, 0x28200e00, 0x0940d302, 0xe0051d00, 0xd3022810, 0x1cc00900, 0x0880e000, 0xd50102c9, |
Pawel Zarembski |
0:01f31e923fe2 | 27 | 0x43082110, 0x48424770, 0x60414940, 0x60414941, 0x60012100, 0x22f068c1, 0x60c14311, 0x06806940, |
Pawel Zarembski |
0:01f31e923fe2 | 28 | 0x483ed406, 0x6001493c, 0x60412106, 0x6081493c, 0x47702000, 0x69014836, 0x43110542, 0x20006101, |
Pawel Zarembski |
0:01f31e923fe2 | 29 | 0xb5104770, 0x69014832, 0x43212404, 0x69016101, 0x431103a2, 0x49336101, 0xe0004a30, 0x68c36011, |
Pawel Zarembski |
0:01f31e923fe2 | 30 | 0xd4fb03db, 0x43a16901, 0x20006101, 0xb530bd10, 0xffb6f7ff, 0x68ca4926, 0x431a23f0, 0x240260ca, |
Pawel Zarembski |
0:01f31e923fe2 | 31 | 0x690a610c, 0x0e0006c0, 0x610a4302, 0x03e26908, 0x61084310, 0x4a214823, 0x6010e000, 0x03ed68cd, |
Pawel Zarembski |
0:01f31e923fe2 | 32 | 0x6908d4fb, 0x610843a0, 0x060068c8, 0xd0030f00, 0x431868c8, 0x200160c8, 0xb570bd30, 0x1cc94d14, |
Pawel Zarembski |
0:01f31e923fe2 | 33 | 0x68eb0889, 0x26f00089, 0x60eb4333, 0x612b2300, 0xe0174b15, 0x431c692c, 0x6814612c, 0x68ec6004, |
Pawel Zarembski |
0:01f31e923fe2 | 34 | 0xd4fc03e4, 0x0864692c, 0x612c0064, 0x062468ec, 0xd0040f24, 0x433068e8, 0x200160e8, 0x1d00bd70, |
Pawel Zarembski |
0:01f31e923fe2 | 35 | 0x1f091d12, 0xd1e52900, 0xbd702000, 0x45670123, 0x40023c00, 0xcdef89ab, 0x00005555, 0x40003000, |
Pawel Zarembski |
0:01f31e923fe2 | 36 | 0x00000fff, 0x0000aaaa, 0x00000201, 0x00000000, |
Pawel Zarembski |
0:01f31e923fe2 | 37 | }; |
Pawel Zarembski |
0:01f31e923fe2 | 38 | |
Pawel Zarembski |
0:01f31e923fe2 | 39 | /** |
Pawel Zarembski |
0:01f31e923fe2 | 40 | * List of start and size for each size of flash sector |
Pawel Zarembski |
0:01f31e923fe2 | 41 | * The size will apply to all sectors between the listed address and the next address |
Pawel Zarembski |
0:01f31e923fe2 | 42 | * in the list. |
Pawel Zarembski |
0:01f31e923fe2 | 43 | * The last pair in the list will have sectors starting at that address and ending |
Pawel Zarembski |
0:01f31e923fe2 | 44 | * at address start + size. |
Pawel Zarembski |
0:01f31e923fe2 | 45 | */ |
Pawel Zarembski |
0:01f31e923fe2 | 46 | static const sector_info_t sectors_info[] = { |
Pawel Zarembski |
0:01f31e923fe2 | 47 | {0x08000000, KB(16)}, |
Pawel Zarembski |
0:01f31e923fe2 | 48 | }; |
Pawel Zarembski |
0:01f31e923fe2 | 49 | |
Pawel Zarembski |
0:01f31e923fe2 | 50 | static const program_target_t flash = { |
Pawel Zarembski |
0:01f31e923fe2 | 51 | 0x20000047, // Init |
Pawel Zarembski |
0:01f31e923fe2 | 52 | 0x20000075, // UnInit |
Pawel Zarembski |
0:01f31e923fe2 | 53 | 0x20000083, // EraseChip |
Pawel Zarembski |
0:01f31e923fe2 | 54 | 0x200000AF, // EraseSector |
Pawel Zarembski |
0:01f31e923fe2 | 55 | 0x200000FB, // ProgramPage |
Pawel Zarembski |
0:01f31e923fe2 | 56 | 0x0, // Verify |
Pawel Zarembski |
0:01f31e923fe2 | 57 | |
Pawel Zarembski |
0:01f31e923fe2 | 58 | // BKPT : start of blob + 1 |
Pawel Zarembski |
0:01f31e923fe2 | 59 | // RSB : blob start + header + rw data offset |
Pawel Zarembski |
0:01f31e923fe2 | 60 | // RSP : stack pointer |
Pawel Zarembski |
0:01f31e923fe2 | 61 | { |
Pawel Zarembski |
0:01f31e923fe2 | 62 | 0x20000000 + 0x00000001, |
Pawel Zarembski |
0:01f31e923fe2 | 63 | 0x20000000 + 0x00000020 + 0x0000014c, |
Pawel Zarembski |
0:01f31e923fe2 | 64 | 0x20000800 |
Pawel Zarembski |
0:01f31e923fe2 | 65 | }, |
Pawel Zarembski |
0:01f31e923fe2 | 66 | |
Pawel Zarembski |
0:01f31e923fe2 | 67 | 0x20000000 + 0x00000A00, // mem buffer location |
Pawel Zarembski |
0:01f31e923fe2 | 68 | 0x20000000, // location to write prog_blob in target RAM |
Pawel Zarembski |
0:01f31e923fe2 | 69 | sizeof(output_flash_prog_blob), // prog_blob size |
Pawel Zarembski |
0:01f31e923fe2 | 70 | output_flash_prog_blob, // address of prog_blob |
Pawel Zarembski |
0:01f31e923fe2 | 71 | 0x00000200 // ram_to_flash_bytes_to_be_written |
Pawel Zarembski |
0:01f31e923fe2 | 72 | }; |