This project shows how to use Mbed OS Community Edition to create custom targets and also defines the standard structure of custom target project from Mbed CE perspective.
This repo includes three different custom targets you can use based on the NUCLEO_L452RE_P
target. (No real reason it's this target in particular, it's just a board I happen to use).
L452RE_SIMPLE
, which is simply a clone ofNUCLEO_L452RE_P
with a different name and some extra compile definitions applied. This would be an example of creating a custom target for your board by simply aliasing one of the built-in Mbed targets. This target is created only bycustom_targets.json
andcustom_targets/CMakeLists.txt
. It contains no source files.L452RE_CUSTOM_PINMAP
, which replaces the pinmap files included with Mbed with custom ones. This is a common task if you are e.g. using a different chip package and want to have correct pin names (for STM32 there is a generator).L452RE_CUSTOM_CLOCK
, which takes it one step further and replaces the system clock configuration code in Mbed with a new source file. This is a fairly common task if you create a custom board and want to regenerate the clocking code from another source, such as STM32Cube IDE or MCUXpresso.
- Clone it to your machine. Don't forget to use
--recursive
to clone the submodules:git clone --recursive https://github.com/mbed-ce/mbed-ce-custom-targets.git
and update MbedOS withgit submodule update --remote mbed-os
(run this command from the mbed-ce-custom-targets folder) - Set up the GNU ARM toolchain (and other programs) on your machine using the toolchain setup guide.
- Set up the CMake project for editing. We have three ways to do this:
- On the command line
- Using the CLion IDE
- Using the VS Code IDE
- Use one of the target names listed above and choose an upload method according to your requirements. Default settings is target L452RE_SIMPLE and upload method STM32CUBE.