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 STM32F103RB_flash_prog_blob[] = {
Pawel Zarembski 0:01f31e923fe2 18 0xE00ABE00, 0x062D780D, 0x24084068, 0xD3000040, 0x1E644058, 0x1C49D1FA, 0x2A001E52, 0x4770D1F2,
Pawel Zarembski 0:01f31e923fe2 19 0x4603b510, 0x4c442000, 0x48446020, 0x48446060, 0x46206060, 0xf01069c0, 0xd1080f04, 0x5055f245,
Pawel Zarembski 0:01f31e923fe2 20 0x60204c40, 0x60602006, 0x70fff640, 0x200060a0, 0x4601bd10, 0x69004838, 0x0080f040, 0x61104a36,
Pawel Zarembski 0:01f31e923fe2 21 0x47702000, 0x69004834, 0x0004f040, 0x61084932, 0x69004608, 0x0040f040, 0xe0036108, 0x20aaf64a,
Pawel Zarembski 0:01f31e923fe2 22 0x60084930, 0x68c0482c, 0x0f01f010, 0x482ad1f6, 0xf0206900, 0x49280004, 0x20006108, 0x46014770,
Pawel Zarembski 0:01f31e923fe2 23 0x69004825, 0x0002f040, 0x61104a23, 0x61414610, 0xf0406900, 0x61100040, 0xf64ae003, 0x4a2120aa,
Pawel Zarembski 0:01f31e923fe2 24 0x481d6010, 0xf01068c0, 0xd1f60f01, 0x6900481a, 0x0002f020, 0x61104a18, 0x47702000, 0x4603b510,
Pawel Zarembski 0:01f31e923fe2 25 0xf0201c48, 0xe0220101, 0x69004813, 0x0001f040, 0x61204c11, 0x80188810, 0x480fbf00, 0xf01068c0,
Pawel Zarembski 0:01f31e923fe2 26 0xd1fa0f01, 0x6900480c, 0x0001f020, 0x61204c0a, 0x68c04620, 0x0f14f010, 0x4620d006, 0xf04068c0,
Pawel Zarembski 0:01f31e923fe2 27 0x60e00014, 0xbd102001, 0x1c921c9b, 0x29001e89, 0x2000d1da, 0x0000e7f7, 0x40022000, 0x45670123,
Pawel Zarembski 0:01f31e923fe2 28 0xcdef89ab, 0x40003000, 0x00000000
Pawel Zarembski 0:01f31e923fe2 29 };
Pawel Zarembski 0:01f31e923fe2 30
Pawel Zarembski 0:01f31e923fe2 31 /**
Pawel Zarembski 0:01f31e923fe2 32 * List of start and size for each size of flash sector
Pawel Zarembski 0:01f31e923fe2 33 * The size will apply to all sectors between the listed address and the next address
Pawel Zarembski 0:01f31e923fe2 34 * in the list.
Pawel Zarembski 0:01f31e923fe2 35 * The last pair in the list will have sectors starting at that address and ending
Pawel Zarembski 0:01f31e923fe2 36 * at address start + size.
Pawel Zarembski 0:01f31e923fe2 37 */
Pawel Zarembski 0:01f31e923fe2 38 static const sector_info_t sectors_info[] = {
Pawel Zarembski 0:01f31e923fe2 39 {0x08000000, 0x400},
Pawel Zarembski 0:01f31e923fe2 40 };
Pawel Zarembski 0:01f31e923fe2 41
Pawel Zarembski 0:01f31e923fe2 42 static const program_target_t flash = {
Pawel Zarembski 0:01f31e923fe2 43 0x20000021, // Init
Pawel Zarembski 0:01f31e923fe2 44 0x20000053, // UnInit
Pawel Zarembski 0:01f31e923fe2 45 0x20000065, // EraseChip
Pawel Zarembski 0:01f31e923fe2 46 0x2000009f, // EraseSector
Pawel Zarembski 0:01f31e923fe2 47 0x200000dd, // ProgramPage
Pawel Zarembski 0:01f31e923fe2 48 0x0, // Verify
Pawel Zarembski 0:01f31e923fe2 49
Pawel Zarembski 0:01f31e923fe2 50 // BKPT : start of blob + 1
Pawel Zarembski 0:01f31e923fe2 51 // RSB : blob start + header + rw data offset
Pawel Zarembski 0:01f31e923fe2 52 // RSP : stack pointer
Pawel Zarembski 0:01f31e923fe2 53 {
Pawel Zarembski 0:01f31e923fe2 54 0x20000001,
Pawel Zarembski 0:01f31e923fe2 55 0x20000148,
Pawel Zarembski 0:01f31e923fe2 56 0x20000800
Pawel Zarembski 0:01f31e923fe2 57 },
Pawel Zarembski 0:01f31e923fe2 58
Pawel Zarembski 0:01f31e923fe2 59 0x20000000 + 0x00000A00, // mem buffer location
Pawel Zarembski 0:01f31e923fe2 60 0x20000000, // location to write prog_blob in target RAM
Pawel Zarembski 0:01f31e923fe2 61 sizeof(STM32F103RB_flash_prog_blob), // prog_blob size
Pawel Zarembski 0:01f31e923fe2 62 STM32F103RB_flash_prog_blob, // address of prog_blob
Pawel Zarembski 0:01f31e923fe2 63 0x00000400 // ram_to_flash_bytes_to_be_written
Pawel Zarembski 0:01f31e923fe2 64 };