Skip to content

Commit 03e76d3

Browse files
committed
Adding docs on adding new platforms and debugger types
1 parent 3c81a02 commit 03e76d3

File tree

1 file changed

+64
-0
lines changed

1 file changed

+64
-0
lines changed

README.md

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -366,3 +366,67 @@ $ mbedls
366366
```
367367

368368
Note how both platforms share the same platform ID (`0240`) but have a unique ending string.
369+
370+
# Adding platform support
371+
372+
If a platform meets the Mbed Enabled technical requirements (stated above), it can be added to Mbed LS.
373+
374+
## Adding a new platform with a supported debugger
375+
376+
Mbed LS currently supports the following types of debuggers:
377+
378+
- [DAPLink](https://github.com/ARMmbed/DAPLink)
379+
- As well as the related but legacy [CMSIS-DAP](https://github.com/mbedmicro/CMSIS-DAP) firmware
380+
- ST-LINK
381+
- J-Link
382+
383+
### Adding support for DAPLink-compatible platforms (DAPLink, ST-LINK, and CMSIS-DAP)
384+
385+
Add an entry to the `daplink` section of the [`DEFAULT_PLATFORM_DB`](https://github.com/ARMmbed/mbed-ls/blob/master/mbed_lstools/platform_database.py#L45).
386+
387+
If your platform's name is `NEW_PLATFORM` and it has platform ID of `9999`, the new entry should be:
388+
389+
```
390+
DEFAULT_PLATFORM_DB = {
391+
u'daplink': {
392+
...
393+
u'9999': u'NEW_PLATFORM',
394+
...
395+
}
396+
}
397+
```
398+
399+
Please order the entries by the platform ID when adding new platforms.
400+
401+
### Adding support for J-Link platforms
402+
403+
J-Link detection works a differently due to the information present on the platform's filesystem. All new entries should be added to the `jlink` section of the [`DEFAULT_PLATFORM_DB`](https://github.com/ARMmbed/mbed-ls/blob/master/mbed_lstools/platform_database.py#L45).
404+
405+
The following is an example `jlink` platform entry:
406+
407+
```
408+
DEFAULT_PLATFORM_DB = {
409+
...
410+
u'jlink': {
411+
u'X729475D28G': {
412+
u'platform_name': u'NRF51_DK',
413+
u'jlink_device_name': u'nRF51422_xxAC'
414+
},
415+
...
416+
}
417+
}
418+
```
419+
420+
Instead of a platform ID, there is a target-unique string (`X729475D28G` in this case). This should correspond with the unique part of the link present in the `Board.html` or `User Guide.html`. This seems to vary among the platforms. In general, try following the links in each file. You want to use the url that links to a product page that references the platform. The J-Link logic in Mbed LS assumes that the url has the target-unique string on the end (after the last `/` character). In the above example, the expected url structure would be `http://www.nordicsemi.com/X729475D28G`.
421+
422+
If your J-Link platform does not follow this convention, please raise an issue with the following information:
423+
424+
- The name of the platform
425+
- The file **names and contents** present on the platform's filesystem
426+
- A link to the J-Link firmware binary if possible
427+
428+
## Adding a new type of debugger
429+
430+
The type of debugger present on the platform affects how it is detected. The USB Vendor ID is used to detect which type of debugger is present on the platform.
431+
432+
If a new type of debugger is being introduced to Mbed LS with the platform, you will need to add the Vendor ID to the [identification map](https://github.com/ARMmbed/mbed-ls/blob/master/mbed_lstools/lstools_base.py#L72-L76). You will also need to assign the correct "update from the filesystem" logic [here](https://github.com/ARMmbed/mbed-ls/blob/master/mbed_lstools/lstools_base.py#L226-L230). If the debugger is compatible with the files presented by DAPLink, you may reuse that implementation when updating the device information from the filesystem. If it is not, you may need to write your own update logic. If you need guidance on this, please ask for it when you submit an issue or a pull request.

0 commit comments

Comments
 (0)