When I tried mbed OS on ST STM32F4-Discovery board, because this board was not supported yet, so I created few new modules and used yotta link and yotta link-target commands to run mbed OS on this board. The module dependency tree is like this:
From above dependency tree, mbed-hal-st-stm32f4 depends on mbed-hal-st-stm32f407vg. In order to achieved that I needed to modify module.json of the official module mbed-hal-st-stm32f4 by adding mbed-hal-st-stm32f407vg to its targetDependencies.
Now comes the problem, if I have created required modules to support a new STM32F4xx board and publish them to yotta public registry, I still could not make it work without resorting yotta link and yotta target commands, because official version of mbed-hal-st-stm32f4 does not list the required module (mbed-hal-st-stm32f4xxx) to its target dependencies. Besides it is not practical for mbed-hal-st-stm32f4 to include all STM32F4 boards used by developers.
The intention is that you won’t need to add a code module to use mbed OS on a previously unused board in the future.
We’re working on moving the code that’s in the board-specific modules into chip-specific modules, using for example pin-definitions generated by config. You can find some documentation on the way pin names are defined here: mbed-hal/pins.md at master · ARMmbed/mbed-hal · GitHub
It’s likely that the presence/selection of external crystals will be configured in a similar way, and we’re considering the options for supporting different external RAM configurations.
Currently to use mbed OS with a chip (or chip family), the vendor needs to either support, or have accepted someone else’s port which supports that family (this is by design).
We think that in the future we can eliminate the need for the separate startup code for each chip, even, but for now both of those are required (along with the actual mbed-hal implementation