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

#27901 breaks mikroe_* shields overlay #29074

Closed
agansari opened this issue Oct 9, 2020 · 5 comments · Fixed by #29824
Closed

#27901 breaks mikroe_* shields overlay #29074

agansari opened this issue Oct 9, 2020 · 5 comments · Fixed by #29824
Assignees
Labels
area: Build System bug The issue is a bug, or the PR is fixing a bug priority: low Low impact/importance bug

Comments

@agansari
Copy link
Collaborator

agansari commented Oct 9, 2020

The change in order #27901 will put the cart before the horse when building with overlays.

To Reproduce

west build -b lpcxpresso55s69_cpu0 samples/net/sockets/echo_server --pristine -- -DSHIELD=mikroe_eth_click

Expected behavior
Should build.

Impact
Does not build.

Error: lpcxpresso55s69_cpu0.dts.pre.tmp:447.15-25 Label or path eth_click not found
FATAL ERROR: Syntax error parsing input tree
CMake Error at /mnt/c/1.Code/zephyrproject/zephyr/cmake/dts.cmake:211 (message):
command failed with return code: 1

Excerpt from temporary dts file (lpcxpresso55s69_cpu0.dts.pre.tmp):

/delete-node/ &eth_click; <---- board's overlay
&mikrobus_spi {
 status = "okay";
 eth_click: eth_click@1 {
  compatible = "microchip,enc28j60";
  reg = <0x1>;
  local-mac-address = [00 00 00 01 02 03];
  spi-max-frequency = <10000000>;
  int-gpios = <&mikrobus_header 7 (1 << 0)>;
  label = "ETH_CLICK";
 };
};
&mikrobus_spi { <---- shield's overlay
 status = "okay";
 eth_click: eth_click@0 {
  compatible = "microchip,enc28j60";
  reg = <0x0>;
  local-mac-address = [00 00 00 01 02 03];
  spi-max-frequency = <10000000>;
  int-gpios = <&mikrobus_header 7 (1 << 0)>;
  label = "ETH_CLICK";
 };
};

Possible resolution
Change the overlay include order or change the board overlay

@agansari agansari added bug The issue is a bug, or the PR is fixing a bug area: Build System labels Oct 9, 2020
@nashif nashif added the priority: low Low impact/importance bug label Oct 13, 2020
@tejlmand
Copy link
Collaborator

seems we need to define a rule on processing order, but let's first decide what the correct / expected behavior should be seen from the user perspective. And then from there determine the processing order in the build system.

When looking at:
https://github.com/zephyrproject-rtos/zephyr/blob/master/boards/shields/mikroe_eth_click/mikroe_eth_click.overlay
and
https://github.com/zephyrproject-rtos/zephyr/blob/master/boards/shields/mikroe_eth_click/boards/lpcxpresso55s69_cpu0.overlay

then I would actually expect that what is specified in boards/lpcxpresso55s69_cpu0.overlay takes precedence over mikroe_eth_click.overlay, so that a board overlay can overrule anything the shield default defines.

With this logic, the patch in: #27901 must be reverted, as change processing order seems to result in the definitions in the shield is taking precedence over the board.

@mbolivar-nordic wouldn't you agree ?

@mbolivar-nordic
Copy link
Contributor

@mbolivar-nordic wouldn't you agree ?

I don't use shields, so I think this is an @erwango question.

@erwango
Copy link
Member

erwango commented Oct 28, 2020

With this logic, the patch in: #27901 must be reverted, as change processing order seems to result in the definitions in the shield is taking precedence over the board.

Fully agree.
#27901 shouldn't have been merged as this breaks overlay logic.

@nashif
Copy link
Member

nashif commented Oct 29, 2020

#27901 shouldn't have been merged as this breaks overlay logic.

what is the course of action here? Should this be reverted or do we have a way to fix this? @erwango can you please propose a solution?

tejlmand added a commit to tejlmand/zephyr that referenced this issue Nov 5, 2020
Fixes: zephyrproject-rtos#29074

This reverts commit fc8f639.

The suggestion provided in zephyrproject-rtos#27901 is impacting processing order of
overlay files in a non-logical way, see zephyrproject-rtos#29074 discussion for details.

Signed-off-by: Torsten Rasmussen <[email protected]>
@tejlmand
Copy link
Collaborator

tejlmand commented Nov 5, 2020

Created: #29825 as followup to minimize the risk that this happens again.

nashif pushed a commit that referenced this issue Nov 10, 2020
Fixes: #29074

This reverts commit fc8f639.

The suggestion provided in #27901 is impacting processing order of
overlay files in a non-logical way, see #29074 discussion for details.

Signed-off-by: Torsten Rasmussen <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: Build System bug The issue is a bug, or the PR is fixing a bug priority: low Low impact/importance bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants