Mistake on this page?
Report an issue in GitHub or email us

Adding a new target

Add a new target to FlashAlgo

DAPlink requires FlashAlgo to program a target. You need to either write FlashAlgo source code yourself, or use the one provided with your MCU.

This step requires a Windows PC.

Repo: https://github.com/mbedmicro/flashalgo

  1. To add the Flash programming source code to the FlashAlgo repository:

    • Add a record to projects.yaml.
    • Create a <target>.yaml file in the records/projects directory.
    • Create a FlashDev.c file describing the attributes of the new flash device.
    • Create a FlashPrg.c file containing all the necessary functions, including Init, UnInit, EraseChip, EraseSector and ProgramPage.

    You can use this PR as an example: https://github.com/mbedmicro/FlashAlgo/pull/46/files.

  2. To generate uVision project files, follow the instructions in Develop Setup and Develop in the FlashAlgo documentation.

  3. In Keil MDK, open the project file for your target in \projectfiles\uvision<target>, and build it. The build directory of a successful build will have the files c_blob.c and c_blob_mbed.c; save both files. You will use them in the next step (c_blob.c in flash_blob.c, and c_blob_mbed.c in Flash API).

This step requires a Windows PC.

The new target needs a unique board ID. To get one, please contact your technical account manager or email our support team.

Repo: https://github.com/armmbed/daplink.

  1. Port a target to DAPLink.
  2. Copy the content of c_blob.c into flash_blob.c.
  3. Verify your port by running DAPLink tests.
  4. When all DAPlink tests pass create two PRs:
    • One PR against the DAPLink repository.
    • One PR against the FlashAlgo repository.

Add your new target to pyOCD

To be able to debug your port:

  1. Set up a development environment.
  2. Add a new target to pyOCD.
  3. Test your new target.

Wait for your target support to be merged into pyOCD's master branch and released in PyPi. You can then use pip install pyOCD to enable debug.

Important Information for this Arm website

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies. If you are not happy with the use of these cookies, please review our Cookie Policy to learn how they can be disabled. By disabling cookies, some features of the site will not work.