Repostiory containing DAPLink source code with Reset Pin workaround for HANI_IOT board.
Upstream: https://github.com/ARMmbed/DAPLink
source/family/st/stm32l486jg/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 | /* Flash OS Routines (Automagically Generated) |
Pawel Zarembski |
0:01f31e923fe2 | 2 | * Copyright (c) 2009-2019 ARM Limited |
Pawel Zarembski |
0:01f31e923fe2 | 3 | * |
Pawel Zarembski |
0:01f31e923fe2 | 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
Pawel Zarembski |
0:01f31e923fe2 | 5 | * you may not use this file except in compliance with the License. |
Pawel Zarembski |
0:01f31e923fe2 | 6 | * You may obtain a copy of the License at |
Pawel Zarembski |
0:01f31e923fe2 | 7 | * |
Pawel Zarembski |
0:01f31e923fe2 | 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
Pawel Zarembski |
0:01f31e923fe2 | 9 | * |
Pawel Zarembski |
0:01f31e923fe2 | 10 | * Unless required by applicable law or agreed to in writing, software |
Pawel Zarembski |
0:01f31e923fe2 | 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
Pawel Zarembski |
0:01f31e923fe2 | 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
Pawel Zarembski |
0:01f31e923fe2 | 13 | * See the License for the specific language governing permissions and |
Pawel Zarembski |
0:01f31e923fe2 | 14 | * limitations under the License. |
Pawel Zarembski |
0:01f31e923fe2 | 15 | */ |
Pawel Zarembski |
0:01f31e923fe2 | 16 | #include "flash_blob.h" |
Pawel Zarembski |
0:01f31e923fe2 | 17 | |
Pawel Zarembski |
0:01f31e923fe2 | 18 | static const uint32_t _flash_prog_blob[] = { |
Pawel Zarembski |
0:01f31e923fe2 | 19 | 0xE00ABE00, 0x062D780D, 0x24084068, 0xD3000040, 0x1E644058, 0x1C49D1FA, 0x2A001E52, 0x4770D1F2, |
Pawel Zarembski |
0:01f31e923fe2 | 20 | 0x8f4ff3bf, 0x48584770, 0x49586800, 0x0d000500, 0xd0001840, 0x47702001, 0x6a004855, 0x0fc00280, |
Pawel Zarembski |
0:01f31e923fe2 | 21 | 0xb5004770, 0xf7ff4602, 0x2801ffee, 0xf7ffd108, 0x2801fff3, 0x484fd104, 0xd3014282, 0xbd002001, |
Pawel Zarembski |
0:01f31e923fe2 | 22 | 0xbd002000, 0x4602b500, 0xffddf7ff, 0xd0022801, 0x0d8002d0, 0x4948bd00, 0x40080ad0, 0xd5f90311, |
Pawel Zarembski |
0:01f31e923fe2 | 23 | 0x300130ff, 0x4842bd00, 0x60814944, 0x60814944, 0x60012100, 0x61014943, 0x03c06a00, 0x4843d406, |
Pawel Zarembski |
0:01f31e923fe2 | 24 | 0x60014941, 0x60412106, 0x60814941, 0x47702000, 0x49372001, 0x614807c0, 0x47702000, 0x47702001, |
Pawel Zarembski |
0:01f31e923fe2 | 25 | 0x49384833, 0x13c16101, 0x69416141, 0x04122201, 0x61414311, 0x4a354937, 0x6011e000, 0x03db6903, |
Pawel Zarembski |
0:01f31e923fe2 | 26 | 0x2100d4fb, 0x46086141, 0xb5104770, 0xf7ff4604, 0x4603ffa8, 0xf7ff4620, 0x4925ffb5, 0x610c4c29, |
Pawel Zarembski |
0:01f31e923fe2 | 27 | 0x02d800c2, 0x43021c92, 0x6948614a, 0x04122201, 0x61484310, 0x8f4ff3bf, 0x4a244826, 0x6010e000, |
Pawel Zarembski |
0:01f31e923fe2 | 28 | 0x03db690b, 0x2000d4fb, 0x69086148, 0xd0014020, 0x2001610c, 0xb5f0bd10, 0x4d151dc9, 0x4f1908c9, |
Pawel Zarembski |
0:01f31e923fe2 | 29 | 0x612f00c9, 0x616b2300, 0xe0184c1a, 0x616b2301, 0x60036813, 0x60436853, 0x8f4ff3bf, 0xe0004b13, |
Pawel Zarembski |
0:01f31e923fe2 | 30 | 0x692e601c, 0xd4fb03f6, 0x616b2300, 0x423b692b, 0x612fd002, 0xbdf02001, 0x39083008, 0x29003208, |
Pawel Zarembski |
0:01f31e923fe2 | 31 | 0x2000d1e4, 0x0000bdf0, 0xe0042000, 0xfffffbcb, 0x40022000, 0x08080000, 0x000002ff, 0x45670123, |
Pawel Zarembski |
0:01f31e923fe2 | 32 | 0xcdef89ab, 0x0000c3fa, 0x00005555, 0x40003000, 0x00000fff, 0x0000aaaa, 0x00000000 |
Pawel Zarembski |
0:01f31e923fe2 | 33 | }; |
Pawel Zarembski |
0:01f31e923fe2 | 34 | |
Pawel Zarembski |
0:01f31e923fe2 | 35 | // Start address of flash |
Pawel Zarembski |
0:01f31e923fe2 | 36 | static const uint32_t flash_start = 0x08000000; |
Pawel Zarembski |
0:01f31e923fe2 | 37 | // Size of flash |
Pawel Zarembski |
0:01f31e923fe2 | 38 | static const uint32_t flash_size = 0x00100000; |
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 | {0x08000000, 0x00000800}, |
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 | 0x20000087, // Init |
Pawel Zarembski |
0:01f31e923fe2 | 53 | 0x200000b1, // UnInit |
Pawel Zarembski |
0:01f31e923fe2 | 54 | 0x200000c1, // EraseChip |
Pawel Zarembski |
0:01f31e923fe2 | 55 | 0x200000eb, // EraseSector |
Pawel Zarembski |
0:01f31e923fe2 | 56 | 0x20000137, // ProgramPage |
Pawel Zarembski |
0:01f31e923fe2 | 57 | 0x0, // Verify |
Pawel Zarembski |
0:01f31e923fe2 | 58 | |
Pawel Zarembski |
0:01f31e923fe2 | 59 | // BKPT : start of blob + 1 |
Pawel Zarembski |
0:01f31e923fe2 | 60 | // RSB : blob start + header + rw data offset |
Pawel Zarembski |
0:01f31e923fe2 | 61 | // RSP : stack pointer |
Pawel Zarembski |
0:01f31e923fe2 | 62 | { |
Pawel Zarembski |
0:01f31e923fe2 | 63 | 0x20000001, |
Pawel Zarembski |
0:01f31e923fe2 | 64 | 0x200001b8, |
Pawel Zarembski |
0:01f31e923fe2 | 65 | 0x20000800 |
Pawel Zarembski |
0:01f31e923fe2 | 66 | }, |
Pawel Zarembski |
0:01f31e923fe2 | 67 | |
Pawel Zarembski |
0:01f31e923fe2 | 68 | 0x20000000 + 0x00000A00, // mem buffer location |
Pawel Zarembski |
0:01f31e923fe2 | 69 | 0x20000000, // location to write prog_blob in target RAM |
Pawel Zarembski |
0:01f31e923fe2 | 70 | sizeof(_flash_prog_blob), // prog_blob size |
Pawel Zarembski |
0:01f31e923fe2 | 71 | _flash_prog_blob, // address of prog_blob |
Pawel Zarembski |
0:01f31e923fe2 | 72 | 0x00000400 // ram_to_flash_bytes_to_be_written |
Pawel Zarembski |
0:01f31e923fe2 | 73 | }; |