Skip to content

Arduino Uno R4 WiFi: GPIO's which are not port 1 in overlay fail to build #90827

Closed
@Gerriko

Description

@Gerriko

Describe the bug

I am using the following:
CODE: samples/basic/blinky example.
BOARD: Arduino Uno R4 WiFi

I created the following working overlay to change the default LED (led0)

/*
 * SPDX-License-Identifier: Apache-2.0
 *
 * This overlay changes the default LED for the blinky sample
 * to Arduino D4 (P106).
 */

/ {
	aliases {
		led0 = &d4_led; /* Blinky sample uses led0 alias */
	};

	leds {
		compatible = "gpio-leds";
		d4_led: led_d4 {
			gpios = <&ioport1 6 GPIO_ACTIVE_HIGH>; /* D4 is P106, active high */
			// gpios = <&arduino_header ARDUINO_HEADER_R3_D4 GPIO_ACTIVE_HIGH>;
			label = "User LED D4";
			status = "okay";
		};
	};
};

If I then change the GPIO to Arduino D8. using gpios = <&arduino_header ARDUINO_HEADER_R3_D8 GPIO_ACTIVE_HIGH>; or gpios = <&ioport3 4 GPIO_ACTIVE_HIGH>;

I get a build error.

Upon experimentation, I discovered that only GPIO's using port1 work here.

Regression

  • This is a regression.

Steps to reproduce

Save overlay in boards folder.
run: west build -p always -b arduino_uno_r4@wifi

Observe that device tree compiler happy but fails on build.

Relevant log output

/media/files1/Zephyr_Dev/zephyr/include/zephyr/device.h:96:41: error: '__device_dts_ord_33' undeclared here (not in a function); did you mean '__device_dts_ord_36'?
   96 | #define DEVICE_NAME_GET(dev_id) _CONCAT(__device_, dev_id)
      |                                         ^~~~~~~~~
/media/files1/Zephyr_Dev/zephyr/include/zephyr/toolchain/common.h:168:26: note: in definition of macro '_DO_CONCAT'
  168 | #define _DO_CONCAT(x, y) x ## y
      |                          ^
/media/files1/Zephyr_Dev/zephyr/include/zephyr/device.h:96:33: note: in expansion of macro '_CONCAT'
   96 | #define DEVICE_NAME_GET(dev_id) _CONCAT(__device_, dev_id)
      |                                 ^~~~~~~
/media/files1/Zephyr_Dev/zephyr/include/zephyr/device.h:293:37: note: in expansion of macro 'DEVICE_NAME_GET'
  293 | #define DEVICE_DT_NAME_GET(node_id) DEVICE_NAME_GET(Z_DEVICE_DT_DEV_ID(node_id))
      |                                     ^~~~~~~~~~~~~~~
/media/files1/Zephyr_Dev/zephyr/include/zephyr/device.h:310:34: note: in expansion of macro 'DEVICE_DT_NAME_GET'
  310 | #define DEVICE_DT_GET(node_id) (&DEVICE_DT_NAME_GET(node_id))
      |                                  ^~~~~~~~~~~~~~~~~~
/media/files1/Zephyr_Dev/zephyr/include/zephyr/drivers/gpio.h:334:25: note: in expansion of macro 'DEVICE_DT_GET'
  334 |                 .port = DEVICE_DT_GET(DT_GPIO_CTLR_BY_IDX(node_id, prop, idx)),\
      |                         ^~~~~~~~~~~~~
/media/files1/Zephyr_Dev/zephyr/include/zephyr/drivers/gpio.h:370:9: note: in expansion of macro 'GPIO_DT_SPEC_GET_BY_IDX'
  370 |         GPIO_DT_SPEC_GET_BY_IDX(node_id, prop, 0)
      |         ^~~~~~~~~~~~~~~~~~~~~~~
/media/files1/Zephyr_Dev/apps/blinky/src/main.c:21:40: note: in expansion of macro 'GPIO_DT_SPEC_GET'
   21 | static const struct gpio_dt_spec led = GPIO_DT_SPEC_GET(LED0_NODE, gpios);
      |                                        ^~~~~~~~~~~~~~~~
[36/136] Building C object zephyr/CMakeFiles/zephyr.dir/subsys/logging/backends/log_backend_uart.c.obj
ninja: build stopped: subcommand failed.

Impact

Functional Limitation - Some features not working as expected, but system usable..

Environment

  • OS: Linux Ubuntu 22
  • Toolchain: should all be the latest...West version: v1.2.0, Zephyr 4.1, West version: v1.2.0

Additional Context

No response

Metadata

Metadata

Assignees

Labels

bugThe issue is a bug, or the PR is fixing a bugpriority: lowLow impact/importance bug

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions