Skip to content

Move changes in custom-target-porting.md #1223

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 7, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions docs/porting/custom-target-porting.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,16 @@ Follow these steps to create a custom port for Mbed OS:

### Customizing

1. Make changes to `custom_targets.json` for your board. For example, after making changes, the full contents look like this:
1. Make changes to `custom_targets.json` for your board.

In this example:

1. The board name changes from `DISCO_L475VG_IOT01A` to `IMAGINARYBOARD`, so the board can be uniquely identified.
1. The `detect_code` changes from `0764` to `1234`. The `detect_code` is a unique four-digit hexadecimal value, also called a `Platform ID`, that identifies the board to the Mbed OS test tools. For Mbed Enabled boards, this number is exposed through the debug interface with Mbed CLI by typing `mbedls`.
1. The `macros_add` section changes to remove `USBHOST_OTHER` because the new board does not use USB.
1. The `device_has_add` section changes to remove the `ANALOGOUT`, `CAN`, and `USBDEVICE` drivers because the new board doesn't use those features.

After making changes, the full contents look like this:

```
{
Expand Down Expand Up @@ -83,15 +92,6 @@ Follow these steps to create a custom port for Mbed OS:
}
```

Let's review the changes one by one.

#### Changes

1. The board name changed from `DISCO_L475VG_IOT01A` to `IMAGINARYBOARD`, so the board can be uniquely identified.
1. The `detect_code` changed from `0764` to `1234`. The `detect_code` is a unique four-digit hexadecimal value, also called a `Platform ID`, that identifies the board to the Mbed OS test tools. For Mbed Enabled boards, this number is exposed through the debug interface with Mbed CLI by typing `mbedls`.
1. The `macros_add` section changed to remove `USBHOST_OTHER` because the new board does not use USB.
1. The `device_has_add` section was changed to remove the `ANALOGOUT`, `CAN`, and `USBDEVICE` drivers because the new board doesn't use those features.

#### Additions

A new section, `device_has_remove`, was added. This removes the `ANALOGIN`, `I2CSLAVE` and `I2C_ASYNCH` drivers because these features are also not used. The reason why `device_has_remove` is used in this case is because the board is inheriting from the MCU Family configuration `FAMILY_STM32`, which has those drivers added by default.
Expand Down