Repostiory containing DAPLink source code with Reset Pin workaround for HANI_IOT board.
Upstream: https://github.com/ARMmbed/DAPLink
source/family/st/xDot-L151/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 | |
Pawel Zarembski |
0:01f31e923fe2 | 17 | static const uint32_t stm32l151_flash_prog_blob[] = { |
Pawel Zarembski |
0:01f31e923fe2 | 18 | 0xE00ABE00, 0x062D780D, 0x24084068, 0xD3000040, 0x1E644058, 0x1C49D1FA, 0x2A001E52, 0x4770D1F2, |
Pawel Zarembski |
0:01f31e923fe2 | 19 | 0xbf182a01, 0xd1042a02, 0x6801488e, 0x6170f441, 0x20006001, 0x28014770, 0x2802bf18, 0x488ad108, |
Pawel Zarembski |
0:01f31e923fe2 | 20 | 0xf0416801, 0x60010102, 0xf0416801, 0x60010101, 0x47702000, 0x68114a84, 0x0f01f011, 0x4984d004, |
Pawel Zarembski |
0:01f31e923fe2 | 21 | 0x600b4b82, 0x600b4b83, 0xf0116811, 0xd0040f02, 0x4b814982, 0x4b82600b, 0x6811600b, 0x7100f441, |
Pawel Zarembski |
0:01f31e923fe2 | 22 | 0x68116011, 0x0108f041, 0x21006011, 0x49756001, 0xf0106808, 0xd1fb0f01, 0xf4106808, 0xd0056f70, |
Pawel Zarembski |
0:01f31e923fe2 | 23 | 0x680a6808, 0x6270f442, 0x4770600a, 0xf4206810, 0x60107000, 0xf0206810, 0x60100008, 0x47702000, |
Pawel Zarembski |
0:01f31e923fe2 | 24 | 0x4df0e92d, 0xc1a8f8df, 0x4e6a4d68, 0xf8df4f6a, 0x4a6481b0, 0xf8df4b64, 0xf04fe1ac, 0xf10c6100, |
Pawel Zarembski |
0:01f31e923fe2 | 25 | 0xf04f0404, 0x68180a00, 0x0f01f010, 0xf8ccbf1c, 0xf8cc5000, 0x68186000, 0x0f02f010, 0x6027bf1c, |
Pawel Zarembski |
0:01f31e923fe2 | 26 | 0x8000f8c4, 0xf4406818, 0x60187000, 0xf0406818, 0x60180008, 0xa000f8c1, 0xf0106810, 0xd1fb0f01, |
Pawel Zarembski |
0:01f31e923fe2 | 27 | 0xf4106810, 0xd0076f70, 0xf8d26810, 0xf44bb000, 0xf8c26b70, 0xe008b000, 0xf4206818, 0x60187000, |
Pawel Zarembski |
0:01f31e923fe2 | 28 | 0xf0206818, 0x60180008, 0x28002000, 0xe8bdbf18, 0xf5018df0, 0x45717180, 0x2000d3c5, 0x8df0e8bd, |
Pawel Zarembski |
0:01f31e923fe2 | 29 | 0x47702001, 0x4df0e92d, 0x68294d3f, 0x80fcf8df, 0xf8df4e3f, 0xf011a100, 0xbf1c0f01, 0x8000f8c6, |
Pawel Zarembski |
0:01f31e923fe2 | 30 | 0xa000f8c6, 0xf8df6829, 0x4f3cb0f0, 0xe0f0f8df, 0x0f02f011, 0xf8c7bf1c, 0xf8c7b000, 0x6829e000, |
Pawel Zarembski |
0:01f31e923fe2 | 31 | 0x0f01f011, 0x6829bf04, 0x0f02f011, 0x2001d002, 0x8df0e8bd, 0xf4416829, 0x60296180, 0xf0416829, |
Pawel Zarembski |
0:01f31e923fe2 | 32 | 0x60290108, 0x68214c27, 0x0f01f011, 0x2100d1fb, 0xf852460b, 0xf840c023, 0x1d09c001, 0x29801c5b, |
Pawel Zarembski |
0:01f31e923fe2 | 33 | 0x6821dbf7, 0x6f70f411, 0x6829d134, 0x0f01f011, 0xf8c6bf1c, 0xf8c68000, 0x6829a000, 0x0f02f011, |
Pawel Zarembski |
0:01f31e923fe2 | 34 | 0xf8c7bf1c, 0xf8c7b000, 0x6829e000, 0x0f01f011, 0x6829bf04, 0x0f02f011, 0x6829d1c9, 0x6180f441, |
Pawel Zarembski |
0:01f31e923fe2 | 35 | 0x68296029, 0x0108f041, 0x68216029, 0x0f01f011, 0x2180d1fb, 0xf8522320, 0xf840c023, 0x1d09c001, |
Pawel Zarembski |
0:01f31e923fe2 | 36 | 0xf5b11c5b, 0xdbf67f80, 0xf4106820, 0xbf086070, 0x8df0e8bd, 0x68216820, 0x6170f441, 0xe8bd6021, |
Pawel Zarembski |
0:01f31e923fe2 | 37 | 0x00008df0, 0x40023c18, 0x40023c04, 0x89abcdef, 0x40023c0c, 0x02030405, 0x8c9daebf, 0x40023c10, |
Pawel Zarembski |
0:01f31e923fe2 | 38 | 0x13141516, 0x08040000, 0x00000000, |
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 | {0x08000000, 256}, |
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 | 0x20000021, // Init |
Pawel Zarembski |
0:01f31e923fe2 | 54 | 0x20000037, // UnInit |
Pawel Zarembski |
0:01f31e923fe2 | 55 | 0x200000C1, // EraseChip |
Pawel Zarembski |
0:01f31e923fe2 | 56 | 0x20000055, // EraseSector |
Pawel Zarembski |
0:01f31e923fe2 | 57 | 0x20000165, // ProgramPage |
Pawel Zarembski |
0:01f31e923fe2 | 58 | 0x0, // Verify |
Pawel Zarembski |
0:01f31e923fe2 | 59 | |
Pawel Zarembski |
0:01f31e923fe2 | 60 | // BKPT : start of blob + 1 |
Pawel Zarembski |
0:01f31e923fe2 | 61 | // RSB : blob start + header + rw data offset |
Pawel Zarembski |
0:01f31e923fe2 | 62 | // RSP : stack pointer |
Pawel Zarembski |
0:01f31e923fe2 | 63 | { |
Pawel Zarembski |
0:01f31e923fe2 | 64 | 0x20000000 + 0x00000001, |
Pawel Zarembski |
0:01f31e923fe2 | 65 | 0x20000000 + 0x00000020 + 0x00000268, |
Pawel Zarembski |
0:01f31e923fe2 | 66 | 0x20000800 |
Pawel Zarembski |
0:01f31e923fe2 | 67 | }, |
Pawel Zarembski |
0:01f31e923fe2 | 68 | |
Pawel Zarembski |
0:01f31e923fe2 | 69 | 0x20000000 + 0x00000A00, // mem buffer location |
Pawel Zarembski |
0:01f31e923fe2 | 70 | 0x20000000, // location to write prog_blob in target RAM |
Pawel Zarembski |
0:01f31e923fe2 | 71 | sizeof(stm32l151_flash_prog_blob), // prog_blob size |
Pawel Zarembski |
0:01f31e923fe2 | 72 | stm32l151_flash_prog_blob, // address of prog_blob |
Pawel Zarembski |
0:01f31e923fe2 | 73 | 0x00000200 // ram_to_flash_bytes_to_be_written |
Pawel Zarembski |
0:01f31e923fe2 | 74 | }; |