Repostiory containing DAPLink source code with Reset Pin workaround for HANI_IOT board.

Upstream: https://github.com/ARMmbed/DAPLink

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?

UserRevisionLine numberNew 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 stm32l1xx_256_flash_prog_blob[] = {
Pawel Zarembski 0:01f31e923fe2 18 0xE00ABE00, 0x062D780D, 0x24084068, 0xD3000040, 0x1E644058, 0x1C49D1FA, 0x2A001E52, 0x4770D1F2,
Pawel Zarembski 0:01f31e923fe2 19 0xbf182a01, 0xd11e2a02, 0x680148a5, 0x6170f441, 0x48a56001, 0x600149a3, 0x600149a4, 0x0004f100,
Pawel Zarembski 0:01f31e923fe2 20 0x600149a3, 0x600149a3, 0x680048a3, 0x1f80f410, 0x48a2d109, 0x5155f245, 0xf04f6001, 0x60410106,
Pawel Zarembski 0:01f31e923fe2 21 0x71fff640, 0xf04f6081, 0x47700000, 0xbf182801, 0xd1082802, 0x6801489a, 0x0102f041, 0x68016001,
Pawel Zarembski 0:01f31e923fe2 22 0x0101f041, 0xf04f6001, 0x47700000, 0xc250f8df, 0x1000f8dc, 0x0f01f011, 0x498bd004, 0x600a4a89,
Pawel Zarembski 0:01f31e923fe2 23 0x600a4a8a, 0x1000f8dc, 0x0f02f011, 0x498dd004, 0x600a4a87, 0x600a4a87, 0x1000f8dc, 0x7100f441,
Pawel Zarembski 0:01f31e923fe2 24 0x1000f8cc, 0x1000f8dc, 0x0108f041, 0x1000f8cc, 0x60012100, 0x6801487a, 0x0f01f011, 0xf64abf1c,
Pawel Zarembski 0:01f31e923fe2 25 0x4a7e21aa, 0x6011d004, 0xf0136803, 0xd1fa0f01, 0xf4116801, 0xd0056f70, 0xf4416801, 0x60016170,
Pawel Zarembski 0:01f31e923fe2 26 0x47702001, 0x0000f8dc, 0x7000f420, 0x0000f8cc, 0x0000f8dc, 0x0008f020, 0x0000f8cc, 0x47702000,
Pawel Zarembski 0:01f31e923fe2 27 0x4df0e92d, 0x4f674c68, 0x81a0f8df, 0xa1a0f8df, 0xb1a0f8df, 0x4a624e69, 0xf04f4b69, 0x1d256100,
Pawel Zarembski 0:01f31e923fe2 28 0x0e00f04f, 0x2caaf64a, 0xf0106818, 0xbf1c0f01, 0xf8c46027, 0x68188000, 0x0f02f010, 0xf8c5bf1c,
Pawel Zarembski 0:01f31e923fe2 29 0xf8c5a000, 0x6818b000, 0x7000f440, 0x68186018, 0x0008f040, 0xf8c16018, 0x6810e000, 0x0f01f010,
Pawel Zarembski 0:01f31e923fe2 30 0xf8c6d005, 0x6810c000, 0x0f01f010, 0x6810d1f9, 0x6f70f410, 0x6810d005, 0x6070f440, 0x20016010,
Pawel Zarembski 0:01f31e923fe2 31 0x6818e008, 0x7000f420, 0x68186018, 0x0008f020, 0x20006018, 0xbf182800, 0x8df0e8bd, 0xf501484a,
Pawel Zarembski 0:01f31e923fe2 32 0x42817180, 0x2000d3c0, 0x8df0e8bd, 0x47702001, 0x4e43b4f0, 0x31ff2380, 0xc000f8d6, 0x01fff021,
Pawel Zarembski 0:01f31e923fe2 33 0x6c80f44c, 0xc000f8c6, 0xc000f8d6, 0x0c08f04c, 0xc000f8c6, 0xf852e005, 0xf840cb04, 0x1f09cb04,
Pawel Zarembski 0:01f31e923fe2 34 0x29001f1b, 0x2b00bf18, 0xf8dfd1f5, 0xf8dcc0b4, 0x4d323000, 0x0f01f013, 0x24aaf64a, 0x602cd005,
Pawel Zarembski 0:01f31e923fe2 35 0x3000f8dc, 0x0f01f013, 0xf8dcd1f9, 0xf4133000, 0xd12e6f70, 0xf4236833, 0x60336380, 0xf0236833,
Pawel Zarembski 0:01f31e923fe2 36 0x60330308, 0xf4436833, 0x60336380, 0xf0436833, 0x60330308, 0x0380f04f, 0xf852e007, 0xf8407b04,
Pawel Zarembski 0:01f31e923fe2 37 0xf1a17b04, 0xf1a30104, 0x29000304, 0x2b00bf18, 0xf8dcd1f3, 0xf0100000, 0xd0050f01, 0xf8dc602c,
Pawel Zarembski 0:01f31e923fe2 38 0xf0100000, 0xd1f90f01, 0x0000f8dc, 0x6f70f410, 0xf8dcd009, 0xf4400000, 0xf8cc6070, 0xbcf00000,
Pawel Zarembski 0:01f31e923fe2 39 0x0001f04f, 0x68304770, 0x6080f420, 0x68306030, 0x0008f020, 0xbcf06030, 0x0000f04f, 0x00004770,
Pawel Zarembski 0:01f31e923fe2 40 0x40023c18, 0x89abcdef, 0x40023c0c, 0x02030405, 0x8c9daebf, 0x13141516, 0x40023c1c, 0x40003000,
Pawel Zarembski 0:01f31e923fe2 41 0x40023c04, 0x40023c10, 0x08040000, 0x00000000
Pawel Zarembski 0:01f31e923fe2 42 };
Pawel Zarembski 0:01f31e923fe2 43
Pawel Zarembski 0:01f31e923fe2 44 /**
Pawel Zarembski 0:01f31e923fe2 45 * List of start and size for each size of flash sector
Pawel Zarembski 0:01f31e923fe2 46 * The size will apply to all sectors between the listed address and the next address
Pawel Zarembski 0:01f31e923fe2 47 * in the list.
Pawel Zarembski 0:01f31e923fe2 48 * The last pair in the list will have sectors starting at that address and ending
Pawel Zarembski 0:01f31e923fe2 49 * at address start + size.
Pawel Zarembski 0:01f31e923fe2 50 */
Pawel Zarembski 0:01f31e923fe2 51 static const sector_info_t sectors_info[] = {
Pawel Zarembski 0:01f31e923fe2 52 {0x08000000, 256},
Pawel Zarembski 0:01f31e923fe2 53 };
Pawel Zarembski 0:01f31e923fe2 54
Pawel Zarembski 0:01f31e923fe2 55 static const program_target_t flash = {
Pawel Zarembski 0:01f31e923fe2 56 0x20000021, // Init
Pawel Zarembski 0:01f31e923fe2 57 0x2000006d, // UnInit
Pawel Zarembski 0:01f31e923fe2 58 0x20000121, // EraseChip
Pawel Zarembski 0:01f31e923fe2 59 0x2000008d, // EraseSector
Pawel Zarembski 0:01f31e923fe2 60 0x200001d1, // ProgramPage
Pawel Zarembski 0:01f31e923fe2 61 0x0, // Verify
Pawel Zarembski 0:01f31e923fe2 62
Pawel Zarembski 0:01f31e923fe2 63 // BKPT : start of blob + 1
Pawel Zarembski 0:01f31e923fe2 64 // RSB : blob start + header + rw data offset
Pawel Zarembski 0:01f31e923fe2 65 // RSP : stack pointer
Pawel Zarembski 0:01f31e923fe2 66 {
Pawel Zarembski 0:01f31e923fe2 67 0x20000001,
Pawel Zarembski 0:01f31e923fe2 68 0x200002ec,
Pawel Zarembski 0:01f31e923fe2 69 0x20000800
Pawel Zarembski 0:01f31e923fe2 70 },
Pawel Zarembski 0:01f31e923fe2 71
Pawel Zarembski 0:01f31e923fe2 72 0x20000000 + 0x00000A00, // mem buffer location
Pawel Zarembski 0:01f31e923fe2 73 0x20000000, // location to write prog_blob in target RAM
Pawel Zarembski 0:01f31e923fe2 74 sizeof(stm32l1xx_256_flash_prog_blob), // prog_blob size
Pawel Zarembski 0:01f31e923fe2 75 stm32l1xx_256_flash_prog_blob, // address of prog_blob
Pawel Zarembski 0:01f31e923fe2 76 0x00000100 // ram_to_flash_bytes_to_be_written
Pawel Zarembski 0:01f31e923fe2 77 };