Mbed: Failed to extract configuration for custom board

I did some poking around inside the mbed framework and I think I have found where this problem comes from.
In .platformio\packages\framework-mbed\tools\targets\__init__.py, function def get_resolution_order(json_data, target_name, order, level=0), the key FAMILY_STM32 cannot be found in the collection of target descriptions. It seems as if the .platformio\packages\framework-mbed\targets\targets.json file is not considered when constructing the target object.

I created an issue for this: custom targets: target {} has an incomplete target definition · Issue #19 · platformio/builder-framework-mbed · GitHub