Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
christandlg opened this issue Aug 14, 2020 · 5 comments
Closed

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

christandlg opened this issue Aug 14, 2020 · 5 comments

Comments

@christandlg
Copy link

christandlg commented Aug 14, 2020

Description of defect

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 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 ?

n/a

@jeromecoutant
Copy link
Collaborator

Hi
Yes, since 6.2 version, name has changed!

For your custom_targets.json, I propose:

{
    "Clicker2_for_STM32": {
        "inherits": ["MCU_STM32F4"],
        "extra_labels_add": [
            "STM32F407xG"
        ],
        "overrides": {
            "clock_source": "USE_PLL_HSE_XTAL"
        },
        "device_has_add": ["ANALOGOUT", "TRNG"],
        "device_name": "STM32F407VG"
    }
}

@christandlg
Copy link
Author

christandlg commented Aug 14, 2020

Hi,
using MCU_STM32F4 (or your proposed custom_targets.json) did not solve the issue, unfortunately. The error is thrown at the same line in init.py, because MCU_STM32F4 cannot be found. I also noticed that MCU_STM32F4 is not defined in targets/target.json.
A user in the PlatformIO forum suggested using MCU_STM32, this produced a different error message: Failed to extract configuration for CLICKER2_FOR_STM32. It might not be supported in the this Mbed release.

@jeromecoutant
Copy link
Collaborator

Oups, you're right
#13229
will be part of next week release...

So for the moment, just change FAMILY_STM32 into MCU_STM32

@ciarmcom
Copy link
Member

@christandlg thank you for raising this issue.Please take a look at the following comments:

How can we reproduce your issue?

NOTE: If there are fields which are not applicable then please just add 'n/a' or 'None'.This indicates to us that at least all the fields have been considered.
Please update the issue header with the missing information, the issue will not be mirroredto our internal defect tracking system or investigated until this has been fully resolved.

@christandlg
Copy link
Author

christandlg commented Aug 14, 2020

I discussed this issue over in the PlatformIO forums, where I found that these steps were necessary to fix this issue:
in platformio.ini:
"inherits": ["MCU_STM32"] (this was what allowed the python script to execute without errors)
"CLICKER2_FOR_STM32": { (all uppercase characters. fixed the error Failed to extract configuration for CLICKER2_FOR_STM32. It might not be supported in the this Mbed release.)

a few additional steps were necessary for the project to compile correctly, but this is somewhat outside the scope of this issue:
in platformio.ini:
"default_toolchain": "GCC_ARM",
removing the src\TARGET_STM32F407xG\device folder and everything contained within as this was just a duplicate of what was already included in mbed and caused compilation issues

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants