Repostiory containing DAPLink source code with Reset Pin workaround for HANI_IOT board.
Upstream: https://github.com/ARMmbed/DAPLink
docs/MSD_COMMANDS.md@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 | # MSD Commands |
Pawel Zarembski |
0:01f31e923fe2 | 2 | |
Pawel Zarembski |
0:01f31e923fe2 | 3 | DAPLink allows you to give it some simple commands via its MSD interface. By |
Pawel Zarembski |
0:01f31e923fe2 | 4 | copying a file with a certain name to the root of the DAPLink MSD drive, you |
Pawel Zarembski |
0:01f31e923fe2 | 5 | can get DAPLink to either perform an action or configure a flash-persisted |
Pawel Zarembski |
0:01f31e923fe2 | 6 | option. The contents of the file are ignored; you can pass it an empty file. |
Pawel Zarembski |
0:01f31e923fe2 | 7 | |
Pawel Zarembski |
0:01f31e923fe2 | 8 | MSD commands only work if you are either holding down the RESET button |
Pawel Zarembski |
0:01f31e923fe2 | 9 | when you add the file to the MSD drive, or if you've turned on DAPLink's |
Pawel Zarembski |
0:01f31e923fe2 | 10 | automation-allowed mode. Of course, the way you turn on automation-allowed |
Pawel Zarembski |
0:01f31e923fe2 | 11 | mode is via an MSD command (see below). So, you'll either hold the RESET |
Pawel Zarembski |
0:01f31e923fe2 | 12 | button each time you invoke an MSD command or you'll do so only once to turn |
Pawel Zarembski |
0:01f31e923fe2 | 13 | on automation-allowed mode. The automation-allowed mode is saved in flash and |
Pawel Zarembski |
0:01f31e923fe2 | 14 | so it persists across board reboots. |
Pawel Zarembski |
0:01f31e923fe2 | 15 | |
Pawel Zarembski |
0:01f31e923fe2 | 16 | By convention, files that end with ``.act`` trigger an action; files that end |
Pawel Zarembski |
0:01f31e923fe2 | 17 | with ``.cfg`` configure a behavior. The mechanism is case-insensitive. |
Pawel Zarembski |
0:01f31e923fe2 | 18 | |
Pawel Zarembski |
0:01f31e923fe2 | 19 | Every command completes by remounting the DAPLink MSD drive. Every command |
Pawel Zarembski |
0:01f31e923fe2 | 20 | is supported in both interface and bootloader mode. |
Pawel Zarembski |
0:01f31e923fe2 | 21 | |
Pawel Zarembski |
0:01f31e923fe2 | 22 | ### Action Commands |
Pawel Zarembski |
0:01f31e923fe2 | 23 | |
Pawel Zarembski |
0:01f31e923fe2 | 24 | ``start_bl.act`` This file will force DAPLink to remount in bootloader mode. |
Pawel Zarembski |
0:01f31e923fe2 | 25 | It is equivalent to unplugging the USB cable, and plugging it back in while |
Pawel Zarembski |
0:01f31e923fe2 | 26 | holding the RESET button. This command has no effect if DAPLink is already |
Pawel Zarembski |
0:01f31e923fe2 | 27 | in bootloader mode. |
Pawel Zarembski |
0:01f31e923fe2 | 28 | |
Pawel Zarembski |
0:01f31e923fe2 | 29 | ``start_if.act`` This file will force DAPLink to remount in interface mode. It |
Pawel Zarembski |
0:01f31e923fe2 | 30 | is equivalent to unplugging the USB cable and plugging it back in. This command |
Pawel Zarembski |
0:01f31e923fe2 | 31 | has no effect if DAPLink is already in interface mode. |
Pawel Zarembski |
0:01f31e923fe2 | 32 | |
Pawel Zarembski |
0:01f31e923fe2 | 33 | ``assert.act`` This file can be used to test DAPLink's assert utility. When you |
Pawel Zarembski |
0:01f31e923fe2 | 34 | copy this file to the DAPLink MSD drive, DAPLink generates a call to the |
Pawel Zarembski |
0:01f31e923fe2 | 35 | util_assert() method. An assert call causes the DAPLink MSD drive to remount |
Pawel Zarembski |
0:01f31e923fe2 | 36 | with an additional file, ``ASSERT.TXT``, appearing at the root of the drive. This file |
Pawel Zarembski |
0:01f31e923fe2 | 37 | details where the assertion failure occurred (source file, line number). An |
Pawel Zarembski |
0:01f31e923fe2 | 38 | assert call is a no-op if there is already an outstanding assert failure (there |
Pawel Zarembski |
0:01f31e923fe2 | 39 | can only be one). The outstanding assertion failure can be cleared by deleting |
Pawel Zarembski |
0:01f31e923fe2 | 40 | ``ASSERT.TXT``. The deletion causes a remount of the DAPLink MSD drive. In actuality, |
Pawel Zarembski |
0:01f31e923fe2 | 41 | any file operation (addition, deletion, content change) could be used to trigger |
Pawel Zarembski |
0:01f31e923fe2 | 42 | a DAPLink command. Deleting ``ASSERT.TXT`` is actually a DAPLink MSD command in its |
Pawel Zarembski |
0:01f31e923fe2 | 43 | own right. |
Pawel Zarembski |
0:01f31e923fe2 | 44 | |
Pawel Zarembski |
0:01f31e923fe2 | 45 | ``refresh.act`` This file forces a remount of the DAPLink MSD drive. |
Pawel Zarembski |
0:01f31e923fe2 | 46 | |
Pawel Zarembski |
0:01f31e923fe2 | 47 | ``erase.act`` This file triggers an erase of the target's flash. |
Pawel Zarembski |
0:01f31e923fe2 | 48 | |
Pawel Zarembski |
0:01f31e923fe2 | 49 | ``msd_off.act`` Mass storage device can be disabled by this file command regardless of presence of target flash algo for drag and drop. MSD will always be disabled without the target flash algo. |
Pawel Zarembski |
0:01f31e923fe2 | 50 | |
Pawel Zarembski |
0:01f31e923fe2 | 51 | ``msd_on.act`` Mass storage device can be enabled back by this file command on bootloader mode only if there is a target flash algo. |
Pawel Zarembski |
0:01f31e923fe2 | 52 | |
Pawel Zarembski |
0:01f31e923fe2 | 53 | ``page_off.act`` This file temporary enables page programming and chip erasing until the next restart occurred for drag and drop. |
Pawel Zarembski |
0:01f31e923fe2 | 54 | |
Pawel Zarembski |
0:01f31e923fe2 | 55 | ``page_on.act`` This file temporary enables page programming and sector erasing until the next restart occurred for drag and drop. |
Pawel Zarembski |
0:01f31e923fe2 | 56 | |
Pawel Zarembski |
0:01f31e923fe2 | 57 | ### Configuration Commands |
Pawel Zarembski |
0:01f31e923fe2 | 58 | |
Pawel Zarembski |
0:01f31e923fe2 | 59 | ``auto_rst.cfg`` This file will turn on Auto Reset mode. In this mode, |
Pawel Zarembski |
0:01f31e923fe2 | 60 | a reset is performed at the end of the programming sequence. From the |
Pawel Zarembski |
0:01f31e923fe2 | 61 | user's perspective, the program starts running as soon as programming |
Pawel Zarembski |
0:01f31e923fe2 | 62 | completes. The default behavior is for Auto Reset to be off. This means that |
Pawel Zarembski |
0:01f31e923fe2 | 63 | after programming, the application is left halted and does not run. Note that |
Pawel Zarembski |
0:01f31e923fe2 | 64 | this mode does not affect what happens when you update the Hardware |
Pawel Zarembski |
0:01f31e923fe2 | 65 | Interface Circuit firmware itself (DAPLink) via the DAPLink MSD drive in |
Pawel Zarembski |
0:01f31e923fe2 | 66 | bootloader mode. |
Pawel Zarembski |
0:01f31e923fe2 | 67 | |
Pawel Zarembski |
0:01f31e923fe2 | 68 | ``hard_rst.cfg`` This file turns off Auto Reset mode. Auto Reset mode is off by |
Pawel Zarembski |
0:01f31e923fe2 | 69 | default. |
Pawel Zarembski |
0:01f31e923fe2 | 70 | |
Pawel Zarembski |
0:01f31e923fe2 | 71 | |
Pawel Zarembski |
0:01f31e923fe2 | 72 | ``auto_on.cfg`` This file turns on automation-allowed mode. In this mode, DAPLink |
Pawel Zarembski |
0:01f31e923fe2 | 73 | MSD commands can be triggered without needing to hold down the RESET button. Also, |
Pawel Zarembski |
0:01f31e923fe2 | 74 | bootloader updates are allowed only in automation-allowed mode. |
Pawel Zarembski |
0:01f31e923fe2 | 75 | |
Pawel Zarembski |
0:01f31e923fe2 | 76 | ``auto_off.cfg`` This file turns off automation-allowed mode. This mode |
Pawel Zarembski |
0:01f31e923fe2 | 77 | is off by default |
Pawel Zarembski |
0:01f31e923fe2 | 78 | |
Pawel Zarembski |
0:01f31e923fe2 | 79 | |
Pawel Zarembski |
0:01f31e923fe2 | 80 | ``ovfl_on.cfg`` This file turns on serial overflow reporting. If the host PC is not reading |
Pawel Zarembski |
0:01f31e923fe2 | 81 | data fast enough from DAPLink and an overflow occurs the text ```<DAPLink:Overflow>``` |
Pawel Zarembski |
0:01f31e923fe2 | 82 | will show up in the serial data. Serial overflow reporting is turned off by default. |
Pawel Zarembski |
0:01f31e923fe2 | 83 | |
Pawel Zarembski |
0:01f31e923fe2 | 84 | ``ovfl_off.cfg`` This file turns off serial overflow reporting. |