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

CMake - Custom hardware targets must start with "mbed-" prefix #15197

Open
ladislas opened this issue Dec 31, 2021 · 2 comments
Open

CMake - Custom hardware targets must start with "mbed-" prefix #15197

ladislas opened this issue Dec 31, 2021 · 2 comments

Comments

@ladislas
Copy link
Contributor

ladislas commented Dec 31, 2021

Description of defect

Custom targets must have an mbed- prefix with a name in lower case. We have multiple custom targets for different versions of our hardware.

Using the mbed- prefix is strange enough as those targets are not coming to mbed and it is not written in the documentation. It took me quite sometime to understand what was wrong.

In the end we are forced to change the name of our targets from target_LEKA_V1_2_DEV to mbed-leka-v1-2-dev.

We can live with the leka-v1-2-dev but forcing users to format the name of their targets it wrong, the prefix should not be required and if we really can't do without it, documentation should explain the what and why

Target(s) affected by this defect ?

n/a

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

arm-none-eabi-gcc (GNU Arm Embedded Toolchain 10.3-2021.10) 10.3.1 20210824 (release)

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

mbed-os-6.15.1

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

mbed-tools 7.49.1

How is this defect reproduced ?

Create a custom target and omit the mbed- prefix

@0xc0170
Copy link
Contributor

0xc0170 commented Jan 10, 2022

Using the mbed- prefix is strange enough as those targets are not coming to mbed and it is not written in the documentation. It took me quite sometime to understand what was wrong.

Is there an error or warning coming from the tools or our CMake? custom targets should have no requirement like that.

@multiplemonomials
Copy link
Contributor

I think this requirement is created by this part of the code:

string(PREPEND MBED_TARGET_CONVERTED "mbed-")

Mbed wants to derive the CMake target name from the target.json target name, so it converts it to lowercase and prepends mbed- (e.g. NUCLEO_F429ZI -> mbed-nucleo-f429zi). This means that the CMake target has to start with mbed.

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

4 participants