platformio / builder-framework-mbed

ARM mbed build script for PlatformIO Build System
http://platformio.org/frameworks/mbed
Apache License 2.0
4 stars 17 forks source link

custom targets: target {} has an incomplete target definition #19

Closed christandlg closed 4 years ago

christandlg commented 4 years ago

I have created a custom target definition for my project (can be found here: https://bitbucket.org/christandlg/platformio-clicker2-for-stm32 ), but when I try to build for it, mbed throws the error

target Clicker2_for_STM32 has an incomplete target definition
mbed build API internal error

The target inherits from FAMILY_STM32, which is defined in .platformio\packages\framework-mbed\targets\targets.json. 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.

Target(s) affected by this defect ?

custom targets

Toolchain(s) (name and version) displaying this defect ?

framework-mbed 6.60200.200722 (6.2.0)

What version of Mbed-os are you using (tag or sha) ?

mbed-os-6.2.0

What version(s) of tools are you using. List all that apply (E.g. mbed-cli)

PlatformIO 4.3.4

How is this defect reproduced ?

valeros commented 4 years ago

Hi @christandlg ! Thanks for reporting. It might be an internal error in the mbed build tools. Please try to compile your project using the native mbed-cli tool. Does it work there?

christandlg commented 4 years ago

Hi, I have discussed this issue over in the PlatformIO forums and was eventually able to fix it. One of the problems was that FAMILY_STM32 has been changed to MCU_STM32 which caused function def get_resolution_order(json_data, target_name, order, level=0) to throw the error.