Mbed-os: custom_targets.json and modular target board support packages

Created on 9 Apr 2018  路  9Comments  路  Source: ARMmbed/mbed-os

Description

  • Type: Question, possible enhancement
  • Priority: Minor

@theotherjimmy @0xc0170

Background

Assume I create a custom target and want to use that target in multiple applications.
The most elegant approach I can think of with my limited understanding of the config system, would be to create a git repository that contains the following:

  • PinNames.h
  • device.h
  • custom_targets.json
  • git submodules of any of the board's IC drivers not already included with mbedOS

This repository would then be imported as a git submodule of any applications I develop for the board.

(or, if the application is hardware agnostic enough, I might create a new repository that includes both the application and BSP as git submodules)

Known Issues to using this approach:

  • custom_targets.json needs to be in the root of the "project"
  • managing mbedOS version dependencies

Questions

  • What currently is the cleanest way to accomplish modular custom target support for an application?

  • What, if anything, could be done to 'enhance' custom target support?

CLOSED tools mirrored

Most helpful comment

@loverdeg-ep Yeah, It seems that custom target support is really needed for going to production, as you use it for the custom board you're making. I appreciate that you're pushing on it, as it frequently sees the least love.
[Mirrored to Jira]

All 9 comments

@loverdeg-ep The current limitation, that the "custom_targets.json" must be at the root, is primarily an implementation limitation. You could "trick" the build system into thinking that it's at the root by:

  • Place an .mbedignore file in the root ignoring the module directory
  • always run mbed compile/mbed export with --source pointing to that dir.

I take it that this is almost a blocker for going to production?
[Mirrored to Jira]

@theotherjimmy Not quite a blocker since we can work around it.
Just want to make sure custom targets get first class support and consideration moving forward.
[Mirrored to Jira]

@loverdeg-ep Yeah, It seems that custom target support is really needed for going to production, as you use it for the custom board you're making. I appreciate that you're pushing on it, as it frequently sees the least love.
[Mirrored to Jira]

Internal Jira reference: https://jira.arm.com/browse/IOTCORE-323

@theotherjimmy, @trowbridgec
Been trialing a number of multi-git-repo tools and dependency managers.
Forgot I posted this issue and ran into it again.

We will be using the recommended workaround, but it would be nice the next time I chase my tail to find a --custom-targets option in the documentation.

@theotherjimmy
Would this be as simple as adding the option to tools/options.py and passing custom_targets_directory instead of source_dir?

All that being said,
Can't put my finger on it, but using custom_targets.json to define custom targets feels _ick_ in the first place.

@loverdeg-ep The implementation that you outlined would work, and I would accept a PR that adds and implements a --custom-targets command line switch.

Can't put my finger on it, but using custom_targets.json to define custom targets feels ick in the first place.

Good to know that something feels off to you. If you can put your finger on what that is, I would like to know it.

TODO: Close once #9401 comes with 5.12.

--custom-targets command line switch was delivered in #9401 so closing this issue.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

hasnainvirk picture hasnainvirk  路  3Comments

ghost picture ghost  路  4Comments

davidantaki picture davidantaki  路  3Comments

drahnr picture drahnr  路  4Comments

neilt6 picture neilt6  路  4Comments