Repostiory containing DAPLink source code with Reset Pin workaround for HANI_IOT board.
Upstream: https://github.com/ARMmbed/DAPLink
source/family/st/stm32l082cz/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 | #include "flash_blob.h" |
Pawel Zarembski |
0:01f31e923fe2 | 18 | |
Pawel Zarembski |
0:01f31e923fe2 | 19 | static const uint32_t stm32l0xx_192_flash_prog_blob[] = { |
Pawel Zarembski |
0:01f31e923fe2 | 20 | 0xE00ABE00, 0x062D780D, 0x24084068, 0xD3000040, 0x1E644058, 0x1C49D1FA, 0x2A001E52, 0x4770D1F2, |
Pawel Zarembski |
0:01f31e923fe2 | 21 | 0x4603b510, 0x69804851, 0x0224240f, 0x4c4f4320, 0x484f61a0, 0x484f60e0, 0x484f60e0, 0x484f6120, |
Pawel Zarembski |
0:01f31e923fe2 | 22 | 0x46206120, 0x240169c0, 0x40200524, 0xd1062800, 0x4c4c484b, 0x20066020, 0x484b6060, 0x200060a0, |
Pawel Zarembski |
0:01f31e923fe2 | 23 | 0x4601bd10, 0x68404841, 0x43102202, 0x60504a3f, 0x68404610, 0x43102201, 0x60504a3c, 0x47702000, |
Pawel Zarembski |
0:01f31e923fe2 | 24 | 0x483a4601, 0x22016840, 0x43100252, 0x60504a37, 0x68404610, 0x43102208, 0x60504a34, 0x60082000, |
Pawel Zarembski |
0:01f31e923fe2 | 25 | 0x483ae002, 0x60104a37, 0x69804830, 0x0fc007c0, 0xd1f62800, 0x6840482d, 0x02522201, 0x4a2b4390, |
Pawel Zarembski |
0:01f31e923fe2 | 26 | 0x46106050, 0x22086840, 0x4a284390, 0x20006050, 0x46034770, 0x47702001, 0x4603b570, 0x303f4608, |
Pawel Zarembski |
0:01f31e923fe2 | 27 | 0x01890981, 0xe03b2500, 0x68404820, 0x02b62601, 0x4e1e4330, 0x46306070, 0x26086840, 0x4e1b4330, |
Pawel Zarembski |
0:01f31e923fe2 | 28 | 0x24406070, 0x6810e004, 0x1d1b6018, 0x1f241d12, 0xd1f82c00, 0x481de002, 0x60304e1a, 0x69804813, |
Pawel Zarembski |
0:01f31e923fe2 | 29 | 0x0fc007c0, 0xd1f62800, 0x69804810, 0x0236260f, 0x28004030, 0x480dd006, 0x43306980, 0x61b04e0b, |
Pawel Zarembski |
0:01f31e923fe2 | 30 | 0xbd702001, 0x68404809, 0x02b62601, 0x4e0743b0, 0x46306070, 0x26086840, 0x4e0443b0, 0x1c6d6070, |
Pawel Zarembski |
0:01f31e923fe2 | 31 | 0x42a80988, 0x2000d8c0, 0x0000e7eb, 0x40022000, 0x89abcdef, 0x02030405, 0x8c9daebf, 0x13141516, |
Pawel Zarembski |
0:01f31e923fe2 | 32 | 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 = 0x00030000; |
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, 0x00000080}, |
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 | 0x20000021, // Init |
Pawel Zarembski |
0:01f31e923fe2 | 53 | 0x20000063, // UnInit |
Pawel Zarembski |
0:01f31e923fe2 | 54 | 0x00000000, // EraseChip - NOT SUPPORTED |
Pawel Zarembski |
0:01f31e923fe2 | 55 | 0x20000081, // EraseSector |
Pawel Zarembski |
0:01f31e923fe2 | 56 | 0x200000d9, // 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 | 0x20000190, |
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(stm32l0xx_192_flash_prog_blob), // prog_blob size |
Pawel Zarembski |
0:01f31e923fe2 | 71 | stm32l0xx_192_flash_prog_blob, // address of prog_blob |
Pawel Zarembski |
0:01f31e923fe2 | 72 | 0x00000080 // ram_to_flash_bytes_to_be_written |
Pawel Zarembski |
0:01f31e923fe2 | 73 | }; |