Getting a working baseline
Create forks
Please fork or branch the following repositories:
- DAPLink.
- pyOCD.
- FlashAlgo.
- Mbed OS. Create a development branch, and name it using the format
https://github.com/ARMmbed/mbed-os-new-target
. - Mbed OS bootloader.
- Blinky.
- Device Management Cloud Client example.
Get the Mbed OS source code
The following Mbed CLI commands retrieve and fork the mbed-os-example-blinky
code, and redirect mbed-os
to point to the newly forked mbed-os
repository:
git clone mbed-os-example-blinky
cd mbed-os-example-blinky
Delete the file mbed-os.lib
(rm mbed-os.lib
on Linux/macOS, del mbed-os.lib
on Windows).
Next, add your fork of mbed-os
(change the URL to match your repository).
mbed add https://github.com/ARMmbed/mbed-os-new-target mbed-os
Next, set up the upstream remote, and create a branch for the new port.
cd mbed-os
git remote add upstream https://github.com/ARMmbed/mbed-os
git checkout -b <branch_name>
Build the Blinky program for an existing target
To verify that you have a working fork, please build Blinky to a supported target:
cd mbed-os-example-blinky
mbed compile --target K64F --toolchain GCC_ARM
mbed compile --target K64F --toolchain ARM
mbed compile --target K64F --toolchain IAR
Verify the build succeeds. Make sure the program runs correctly, if it fails, please see the debugging page.
You now have a working baseline and are ready to add a new target.