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 #
Pawel Zarembski 0:01f31e923fe2 2 # DAPLink Interface Firmware
Pawel Zarembski 0:01f31e923fe2 3 # Copyright (c) 2009-2018, ARM Limited, All Rights Reserved
Pawel Zarembski 0:01f31e923fe2 4 # SPDX-License-Identifier: Apache-2.0
Pawel Zarembski 0:01f31e923fe2 5 #
Pawel Zarembski 0:01f31e923fe2 6 # Licensed under the Apache License, Version 2.0 (the "License"); you may
Pawel Zarembski 0:01f31e923fe2 7 # not use this file except in compliance with the License.
Pawel Zarembski 0:01f31e923fe2 8 # You may obtain a copy of the License at
Pawel Zarembski 0:01f31e923fe2 9 #
Pawel Zarembski 0:01f31e923fe2 10 # http://www.apache.org/licenses/LICENSE-2.0
Pawel Zarembski 0:01f31e923fe2 11 #
Pawel Zarembski 0:01f31e923fe2 12 # Unless required by applicable law or agreed to in writing, software
Pawel Zarembski 0:01f31e923fe2 13 # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
Pawel Zarembski 0:01f31e923fe2 14 # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
Pawel Zarembski 0:01f31e923fe2 15 # See the License for the specific language governing permissions and
Pawel Zarembski 0:01f31e923fe2 16 # limitations under the License.
Pawel Zarembski 0:01f31e923fe2 17 #
Pawel Zarembski 0:01f31e923fe2 18
Pawel Zarembski 0:01f31e923fe2 19 import yaml
Pawel Zarembski 0:01f31e923fe2 20
Pawel Zarembski 0:01f31e923fe2 21 #classes needed to generate update.yml files
Pawel Zarembski 0:01f31e923fe2 22 class TargetList(list):
Pawel Zarembski 0:01f31e923fe2 23 def sort(self, *args, **kwargs):
Pawel Zarembski 0:01f31e923fe2 24 pass
Pawel Zarembski 0:01f31e923fe2 25
Pawel Zarembski 0:01f31e923fe2 26 class InstructionList(unicode):
Pawel Zarembski 0:01f31e923fe2 27 def sort(self, *args, **kwargs):
Pawel Zarembski 0:01f31e923fe2 28 pass
Pawel Zarembski 0:01f31e923fe2 29
Pawel Zarembski 0:01f31e923fe2 30 #Remove the sorting by default
Pawel Zarembski 0:01f31e923fe2 31 yaml.add_representer(TargetList, yaml.representer.SafeRepresenter.represent_dict)
Pawel Zarembski 0:01f31e923fe2 32 #needed block style for the instruction steps
Pawel Zarembski 0:01f31e923fe2 33 yaml.add_representer(InstructionList, lambda dumper, data: dumper.represent_scalar(u'tag:yaml.org,2002:str', data, style='|') )
Pawel Zarembski 0:01f31e923fe2 34
Pawel Zarembski 0:01f31e923fe2 35
Pawel Zarembski 0:01f31e923fe2 36 #instruction steps for firmware
Pawel Zarembski 0:01f31e923fe2 37 InstructionsText = {
Pawel Zarembski 0:01f31e923fe2 38 'default':TargetList([
Pawel Zarembski 0:01f31e923fe2 39 ('windows', InstructionList(
Pawel Zarembski 0:01f31e923fe2 40 '1. Download the firmware file.\n'
Pawel Zarembski 0:01f31e923fe2 41 '2. While holding down the boards reset button, connect the boards USB debug port to the computer. It should enumerate and mount as `BOOTLOADER` or `MAINTENANCE`. For boards that enumerate as `BOOTLOADER` [see our blog to determine if an update for the DAPLink bootloader is available.](https://os.mbed.com/blog/entry/DAPLink-bootloader-update/)\n'
Pawel Zarembski 0:01f31e923fe2 42 '3. Drag-and-drop the firmware file onto the mounted drive.\n'
Pawel Zarembski 0:01f31e923fe2 43 '4. Wait for the file copy operation to complete.\n'
Pawel Zarembski 0:01f31e923fe2 44 '5. Power cycle the board. It will now enumerate and mount as `DAPLINK` or the name of the board.\n'
Pawel Zarembski 0:01f31e923fe2 45 )),
Pawel Zarembski 0:01f31e923fe2 46 ('osx', InstructionList(
Pawel Zarembski 0:01f31e923fe2 47 '1. Download the firmware file.\n'
Pawel Zarembski 0:01f31e923fe2 48 '2. While holding down the boards reset button, connect the boards USB debug port to the computer. It should enumerate as `BOOTLOADER` or `MAINTENANCE`. For boards that enumerate as `BOOTLOADER` [see our blog to determine if an update for the DAPLink bootloader is available.](https://os.mbed.com/blog/entry/DAPLink-bootloader-update/)\n'
Pawel Zarembski 0:01f31e923fe2 49 '3. In a terminal execute\n'
Pawel Zarembski 0:01f31e923fe2 50 ' - `sudo mount -u -w -o sync /Volumes/MAINTENANCE ; cp -X <path to firmware file> /Volumes/MAINTENANCE/`\n'
Pawel Zarembski 0:01f31e923fe2 51 ' - Note: If your drive does not mount as `MAINTENANCE` make sure to change this to match the name of the mounted disk attached to your system.\n'
Pawel Zarembski 0:01f31e923fe2 52 '4. Wait for the file copy operation to complete.\n'
Pawel Zarembski 0:01f31e923fe2 53 '5. Power cycle the board. It will now enumerate and mount as `DAPLINK` or the name of the board.\n'
Pawel Zarembski 0:01f31e923fe2 54 )),
Pawel Zarembski 0:01f31e923fe2 55 ('linux', InstructionList(
Pawel Zarembski 0:01f31e923fe2 56 '1. Download the firmware file.\n'
Pawel Zarembski 0:01f31e923fe2 57 '2. While holding down the boards reset button, connect the boards USB debug port to the computer. It should enumerate as `BOOTLOADER` or `MAINTENANCE`. For boards that enumerate as `BOOTLOADER` [see our blog to determine if an update for the DAPLink bootloader is available.](https://os.mbed.com/blog/entry/DAPLink-bootloader-update/)\n'
Pawel Zarembski 0:01f31e923fe2 58 '3. In a terminal execute\n'
Pawel Zarembski 0:01f31e923fe2 59 ' - `cp <path to firmware file> <MAINTENANCE> && sync`\n'
Pawel Zarembski 0:01f31e923fe2 60 ' - Note: make sure to change `MAINTENANCE` to the name of the mount point of the drive on your system.\n'
Pawel Zarembski 0:01f31e923fe2 61 '4. Power cycle the board. It will now enumerate and mount as `DAPLINK` or the name of the board.\n'
Pawel Zarembski 0:01f31e923fe2 62 ))
Pawel Zarembski 0:01f31e923fe2 63 ]),
Pawel Zarembski 0:01f31e923fe2 64 'lpc11u35':TargetList([
Pawel Zarembski 0:01f31e923fe2 65 ('windows', InstructionList(
Pawel Zarembski 0:01f31e923fe2 66 '1. Download the firmware file.\n'
Pawel Zarembski 0:01f31e923fe2 67 '2. While holding down the boards reset button, connect the boards USB debug port to the computer. It should enumerate and mount as `CRP DISABLD`\n'
Pawel Zarembski 0:01f31e923fe2 68 '3. Delete the file named `firmware.bin`\n'
Pawel Zarembski 0:01f31e923fe2 69 '4. Wait for the file copy operation to complete.\n'
Pawel Zarembski 0:01f31e923fe2 70 '5. Power cycle the board. It will now enumerate and mount as `DAPLINK` or the name of the board.\n'
Pawel Zarembski 0:01f31e923fe2 71 )),
Pawel Zarembski 0:01f31e923fe2 72 ('osx', InstructionList(
Pawel Zarembski 0:01f31e923fe2 73 '1. Download the firmware file.\n'
Pawel Zarembski 0:01f31e923fe2 74 '2. While holding down the boards reset button, connect the boards USB debug port to the computer. It should enumerate and mount as `CRP DISABLD`\n'
Pawel Zarembski 0:01f31e923fe2 75 '3. Delete the file named `firmware.bin`'
Pawel Zarembski 0:01f31e923fe2 76 '4. In a terminal execute\n'
Pawel Zarembski 0:01f31e923fe2 77 ' - `sudo mount -u -w -o sync /Volumes/CRP\ DISABLD ; rm /Volumes/CRP\ DISABLD/firmware.bin && cp -X <path to firmware file> /Volumes/CRP\ DISABLD/`\n'
Pawel Zarembski 0:01f31e923fe2 78 '5. Wait for the file copy operation to complete.\n'
Pawel Zarembski 0:01f31e923fe2 79 '6. Power cycle the board. It will now enumerate and mount as `DAPLINK` or the name of the board.\n'
Pawel Zarembski 0:01f31e923fe2 80 )),
Pawel Zarembski 0:01f31e923fe2 81 ('linux', InstructionList(
Pawel Zarembski 0:01f31e923fe2 82 '1. Download the firmware file.\n'
Pawel Zarembski 0:01f31e923fe2 83 '2. While holding down the boards reset button, connect the boards USB debug port to the computer. It should enumerate and mount as `CRP DISABLD`\n'
Pawel Zarembski 0:01f31e923fe2 84 '3. Delete the file named `firmware.bin`\n'
Pawel Zarembski 0:01f31e923fe2 85 '4. In a terminal execute\n'
Pawel Zarembski 0:01f31e923fe2 86 ' - `cp <path to firmware file> <CRP DISABLD> && sync`\n'
Pawel Zarembski 0:01f31e923fe2 87 ' - Note: make sure to change `CRP DISABLD` to the name of the mount point on your system.\n'
Pawel Zarembski 0:01f31e923fe2 88 '5. Power cycle the board. It will now enumerate and mount as `DAPLINK` or the name of the board.\n'
Pawel Zarembski 0:01f31e923fe2 89 ))
Pawel Zarembski 0:01f31e923fe2 90 ])
Pawel Zarembski 0:01f31e923fe2 91
Pawel Zarembski 0:01f31e923fe2 92 }