boards: beagle: add gpio support main mcu #88445
Unanswered
jiangfenghua123
asked this question in
General
Replies: 2 comments
-
Hi @jiangfenghua123! We appreciate you submitting your first issue for our open-source project. 🌟 Even though I'm a bot, I can assure you that the whole community is genuinely grateful for your time and effort. 🤖💙 |
Beta Was this translation helpful? Give feedback.
0 replies
-
Hi, #define GPIO_PORT_PIN_MASK_FROM_NGPIOS(ngpios) tda4: GPIO0_64 ngpios: 128 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
HI:
I want to light r5f0_0 use led;
The file gpio_davinci.c is exist,so zephyr support ti gpio.
The code:
beagle_j721e_main_r5f0_0.dts
leds{
compatible = "gpio-leds";
led0: led_0 {
gpios = <&gpio0 64 GPIO_ACTIVE_HIGH>;
label = "Used LED";
};
};
j721e_main_r5.dtsi
gpio0: gpio@600000 {
compatible = "ti,davinci-gpio";
reg = <0x600000 0x100>;
gpio-controller;
#gpio-cells = <2>;
ngpios = <128>;
status = "disabled";
};
reg,port,ngpios are checked,but compile fail
[0/1] Re-running CMake...
Loading Zephyr default modules (Zephyr base (cached)).
-- Application: /home/jiang/zephyrproject/zephyr/samples/hello_world
-- CMake version: 3.20.0
-- Cache files will be written to: /home/jiang/.cache/zephyr
-- Zephyr version: 4.1.99 (/home/jiang/zephyrproject/zephyr)
-- Found west (found suitable version "1.3.0", minimum required is "0.14.0")
-- Board: sk_tda4, qualifiers: j721e/main_r5f0_0
-- Found host-tools: zephyr 0.17.0 (/home/jiang/zephyr-sdk-0.17.0)
-- Found toolchain: zephyr 0.17.0 (/home/jiang/zephyr-sdk-0.17.0)
-- Found BOARD.dts: /home/jiang/zephyrproject/zephyr/boards/ti/sk_tda4/sk_tda4_j721e_main_r5f0_0.dts
-- Generated zephyr.dts: /home/jiang/zephyrproject/zephyr/build/zephyr/zephyr.dts
-- Generated pickled edt: /home/jiang/zephyrproject/zephyr/build/zephyr/edt.pickle
-- Generated devicetree_generated.h: /home/jiang/zephyrproject/zephyr/build/zephyr/include/generated/zephyr/devicetree_generated.h
-- Including generated dts.cmake file: /home/jiang/zephyrproject/zephyr/build/zephyr/dts.cmake
Parsing /home/jiang/zephyrproject/zephyr/Kconfig
Loaded configuration '/home/jiang/zephyrproject/zephyr/build/zephyr/.config'
No change to configuration in '/home/jiang/zephyrproject/zephyr/build/zephyr/.config'
No change to Kconfig header in '/home/jiang/zephyrproject/zephyr/build/zephyr/include/generated/zephyr/autoconf.h'
-- libmetal version: 1.7.0 (/home/jiang/zephyrproject/zephyr/samples/hello_world)
-- Build type:
-- Host: Linux/x86_64
-- Target: Generic/arm
-- Machine: arm
-- Vendor: none
-- open-amp version: 1.7.0 (/home/jiang/zephyrproject/modules/lib/open-amp/open-amp)
-- Host: Linux/x86_64
-- Target: Generic/arm
-- Machine: arm
-- C_FLAGS : -Wall -Wextra
-- Using ccache: /usr/bin/ccache
-- Configuring done
-- Generating done
-- Build files have been written to: /home/jiang/zephyrproject/zephyr/build
[87/129] Building C object zephyr/drivers/gpio/CMakeFiles/drivers__gpio.dir/gpio_davinci.c.obj
FAILED: zephyr/drivers/gpio/CMakeFiles/drivers__gpio.dir/gpio_davinci.c.obj
ccache /home/jiang/zephyr-sdk-0.17.0/arm-zephyr-eabi/bin/arm-zephyr-eabi-gcc -DKERNEL -DK_HEAP_MEM_POOL_SIZE=0 -DPICOLIBC_DOUBLE_PRINTF_SCANF -D__LINUX_ERRNO_EXTENSIONS__ -D__PROGRAM_START -D__ZEPHYR_SUPERVISOR__ -D__ZEPHYR__=1 -Izephyr/include/generated/zephyr -I../include -Izephyr/include/generated -I../soc/ti/k3 -I../lib/open-amp/. -I../soc/ti/k3/am6x/. -I../soc/ti/k3/am6x/r5 -I/home/jiang/zephyrproject/modules/hal/cmsis/CMSIS/Core_R/Include -I../modules/cmsis/. -Imodules/libmetal/libmetal/lib/include -I/home/jiang/zephyrproject/modules/lib/open-amp/open-amp/lib/include -isystem ../lib/libc/common/include -Wshadow -fno-strict-aliasing -Os -imacros /home/jiang/zephyrproject/zephyr/build/zephyr/include/generated/zephyr/autoconf.h -fno-common -g -gdwarf-4 -fdiagnostics-color=always -mcpu=cortex-r5+nofp.dp -mthumb -mabi=aapcs -mfpu=vfpv3xd -mfloat-abi=hard -mfp16-format=ieee -mtp=soft --sysroot=/home/jiang/zephyr-sdk-0.17.0/arm-zephyr-eabi/arm-zephyr-eabi -imacros /home/jiang/zephyrproject/zephyr/include/zephyr/toolchain/zephyr_stdint.h -Wall -Wformat -Wformat-security -Wno-format-zero-length -Wdouble-promotion -Wno-pointer-sign -Wpointer-arith -Wexpansion-to-defined -Wno-unused-but-set-variable -Werror=implicit-int -fno-pic -fno-pie -fno-asynchronous-unwind-tables -ftls-model=local-exec -fno-reorder-functions --param=min-pagesize=0 -fno-defer-pop -fmacro-prefix-map=/home/jiang/zephyrproject/zephyr/samples/hello_world=CMAKE_SOURCE_DIR -fmacro-prefix-map=/home/jiang/zephyrproject/zephyr=ZEPHYR_BASE -fmacro-prefix-map=/home/jiang/zephyrproject=WEST_TOPDIR -ffunction-sections -fdata-sections -specs=picolibc.specs -std=c99 -MD -MT zephyr/drivers/gpio/CMakeFiles/drivers__gpio.dir/gpio_davinci.c.obj -MF zephyr/drivers/gpio/CMakeFiles/drivers__gpio.dir/gpio_davinci.c.obj.d -o zephyr/drivers/gpio/CMakeFiles/drivers__gpio.dir/gpio_davinci.c.obj -c /home/jiang/zephyrproject/zephyr/drivers/gpio/gpio_davinci.c
In file included from ../include/zephyr/sys/util_macro.h:34,
from ../include/zephyr/irq_multilevel.h:16,
from ../include/zephyr/devicetree.h:20,
from ../include/zephyr/device.h:12,
from /home/jiang/zephyrproject/zephyr/drivers/gpio/gpio_davinci.c:14:
../include/zephyr/sys/util.h:87:49: warning: right shift count is negative [-Wshift-count-negative]
87 | (((
0ULL) - (1ULL << (l)) + 1) & (0ULL >> (BITS_PER_LONG_LONG - 1 - (h))))| ^
../include/zephyr/sys/util_internal.h:72:26: note: in definition of macro '__DEBRACKET'
72 | #define __DEBRACKET(...) VA_ARGS
| ^~~~~~~~~~~
../include/zephyr/sys/util_internal.h:64:9: note: in expansion of macro '__GET_ARG2_DEBRACKET'
64 | __GET_ARG2_DEBRACKET(one_or_two_args _if_code, _else_code)
| ^~~~~~~~~~~~~~~~~~~~
../include/zephyr/sys/util_internal.h:59:9: note: in expansion of macro '__COND_CODE'
59 | __COND_CODE(_XXXX##_flag, _if_1_code, _else_code)
| ^~~~~~~~~~~
../include/zephyr/sys/util_macro.h:204:9: note: in expansion of macro 'Z_COND_CODE_1'
204 | Z_COND_CODE_1(_flag, _if_1_code, _else_code)
| ^~~~~~~~~~~~~
../include/zephyr/devicetree.h:4986:9: note: in expansion of macro 'COND_CODE_1'
4986 | COND_CODE_1(DT_HAS_COMPAT_STATUS_OKAY(DT_DRV_COMPAT),
| ^~~~~~~~~~~
../include/zephyr/sys/util_internal.h:69:53: note: in expansion of macro '__DEBRACKET'
69 | #define __GET_ARG2_DEBRACKET(ignore_this, val, ...) __DEBRACKET val
| ^~~~~~~~~~~
../include/zephyr/sys/util_internal.h:64:9: note: in expansion of macro '__GET_ARG2_DEBRACKET'
64 | __GET_ARG2_DEBRACKET(one_or_two_args _if_code, _else_code)
| ^~~~~~~~~~~~~~~~~~~~
../include/zephyr/sys/util_internal.h:61:9: note: in expansion of macro '__COND_CODE'
61 | __COND_CODE(_ZZZZ##_flag, _if_0_code, _else_code)
| ^~~~~~~~~~~
../include/zephyr/sys/util_macro.h:220:9: note: in expansion of macro 'Z_COND_CODE_0'
220 | Z_COND_CODE_0(_flag, _if_0_code, _else_code)
| ^~~~~~~~~~~~~
../include/zephyr/drivers/gpio.h:625:9: note: in expansion of macro 'COND_CODE_0'
625 | COND_CODE_0(ngpios,
| ^~~~~~~~~~~
../include/zephyr/sys/util_internal.h:69:53: note: in expansion of macro '__DEBRACKET'
69 | #define __GET_ARG2_DEBRACKET(ignore_this, val, ...) __DEBRACKET val
| ^~~~~~~~~~~
../include/zephyr/sys/util_internal.h:64:9: note: in expansion of macro '__GET_ARG2_DEBRACKET'
64 | __GET_ARG2_DEBRACKET(one_or_two_args _if_code, _else_code)
| ^~~~~~~~~~~~~~~~~~~~
../include/zephyr/sys/util_internal.h:59:9: note: in expansion of macro '__COND_CODE'
59 | __COND_CODE(_XXXX##_flag, _if_1_code, _else_code)
| ^~~~~~~~~~~
../include/zephyr/sys/util_macro.h:204:9: note: in expansion of macro 'Z_COND_CODE_1'
204 | Z_COND_CODE_1(_flag, _if_1_code, _else_code)
| ^~~~~~~~~~~~~
../include/zephyr/drivers/gpio.h:627:18: note: in expansion of macro 'COND_CODE_1'
627 | (COND_CODE_1(DT_NODE_HAS_PROP(node_id, gpio_reserved_ranges),
| ^~~~~~~~~~~
../include/zephyr/drivers/gpio.h:630:26: note: in expansion of macro 'GENMASK64'
630 | (GENMASK64(ngpios - 1, 0)))
| ^~~~~~~~~
../include/zephyr/drivers/gpio/gpio_utils.h:37:9: note: in expansion of macro 'GPIO_DT_PORT_PIN_MASK_NGPIOS_EXC'
37 | GPIO_DT_PORT_PIN_MASK_NGPIOS_EXC(node_id, DT_PROP(node_id, ngpios))
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../include/zephyr/drivers/gpio/gpio_utils.h:48:9: note: in expansion of macro 'GPIO_PORT_PIN_MASK_FROM_DT_NODE'
48 | GPIO_PORT_PIN_MASK_FROM_DT_NODE(DT_DRV_INST(inst))
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/jiang/zephyrproject/zephyr/drivers/gpio/gpio_davinci.c:185:42: note: in expansion of macro 'GPIO_PORT_PIN_MASK_FROM_DT_INST'
185 | .port_pin_mask = GPIO_PORT_PIN_MASK_FROM_DT_INST(n),
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
zephyr/include/generated/zephyr/devicetree_generated.h:4122:50: note: in expansion of macro 'GPIO_DAVINCI_INIT'
4122 | #define DT_FOREACH_OKAY_INST_ti_davinci_gpio(fn) fn(0)
| ^
../include/zephyr/sys/util_internal.h:105:36: note: in expansion of macro 'DT_FOREACH_OKAY_INST_ti_davinci_gpio'
105 | #define UTIL_PRIMITIVE_CAT(a, ...) a##VA_ARGS
| ^
/home/jiang/zephyrproject/zephyr/drivers/gpio/gpio_davinci.c:203:1: note: in expansion of macro 'DT_INST_FOREACH_STATUS_OKAY'
203 | DT_INST_FOREACH_STATUS_OKAY(GPIO_DAVINCI_INIT)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
../include/zephyr/drivers/gpio.h:624:5: error: initializer element is not constant
624 | ((gpio_port_pins_t)
| ^
../include/zephyr/sys/util_internal.h:72:26: note: in definition of macro '__DEBRACKET'
72 | #define __DEBRACKET(...) VA_ARGS
| ^~~~~~~~~~~
../include/zephyr/sys/util_internal.h:64:9: note: in expansion of macro '__GET_ARG2_DEBRACKET'
64 | __GET_ARG2_DEBRACKET(one_or_two_args _if_code, _else_code)
| ^~~~~~~~~~~~~~~~~~~~
../include/zephyr/sys/util_internal.h:59:9: note: in expansion of macro '__COND_CODE'
59 | __COND_CODE(_XXXX##_flag, _if_1_code, _else_code)
| ^~~~~~~~~~~
../include/zephyr/sys/util_macro.h:204:9: note: in expansion of macro 'Z_COND_CODE_1'
204 | Z_COND_CODE_1(_flag, _if_1_code, _else_code)
| ^~~~~~~~~~~~~
../include/zephyr/devicetree.h:4986:9: note: in expansion of macro 'COND_CODE_1'
4986 | COND_CODE_1(DT_HAS_COMPAT_STATUS_OKAY(DT_DRV_COMPAT),
| ^~~~~~~~~~~
../include/zephyr/drivers/gpio/gpio_utils.h:37:9: note: in expansion of macro 'GPIO_DT_PORT_PIN_MASK_NGPIOS_EXC'
37 | GPIO_DT_PORT_PIN_MASK_NGPIOS_EXC(node_id, DT_PROP(node_id, ngpios))
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../include/zephyr/drivers/gpio/gpio_utils.h:48:9: note: in expansion of macro 'GPIO_PORT_PIN_MASK_FROM_DT_NODE'
48 | GPIO_PORT_PIN_MASK_FROM_DT_NODE(DT_DRV_INST(inst))
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/jiang/zephyrproject/zephyr/drivers/gpio/gpio_davinci.c:185:42: note: in expansion of macro 'GPIO_PORT_PIN_MASK_FROM_DT_INST'
185 | .port_pin_mask = GPIO_PORT_PIN_MASK_FROM_DT_INST(n),
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
zephyr/include/generated/zephyr/devicetree_generated.h:4122:50: note: in expansion of macro 'GPIO_DAVINCI_INIT'
4122 | #define DT_FOREACH_OKAY_INST_ti_davinci_gpio(fn) fn(0)
| ^~
../include/zephyr/sys/util_internal.h:105:36: note: in expansion of macro 'DT_FOREACH_OKAY_INST_ti_davinci_gpio'
105 | #define UTIL_PRIMITIVE_CAT(a, ...) a##VA_ARGS
| ^
/home/jiang/zephyrproject/zephyr/drivers/gpio/gpio_davinci.c:203:1: note: in expansion of macro 'DT_INST_FOREACH_STATUS_OKAY'
203 | DT_INST_FOREACH_STATUS_OKAY(GPIO_DAVINCI_INIT)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
../include/zephyr/drivers/gpio.h:624:5: note: (near initialization for 'gpio_davinci_0_config.common.port_pin_mask')
624 | ((gpio_port_pins_t)
| ^
../include/zephyr/sys/util_internal.h:72:26: note: in definition of macro '__DEBRACKET'
72 | #define __DEBRACKET(...) VA_ARGS
| ^~~~~~~~~~~
../include/zephyr/sys/util_internal.h:64:9: note: in expansion of macro '__GET_ARG2_DEBRACKET'
64 | __GET_ARG2_DEBRACKET(one_or_two_args _if_code, _else_code)
| ^~~~~~~~~~~~~~~~~~~~
../include/zephyr/sys/util_internal.h:59:9: note: in expansion of macro '__COND_CODE'
59 | __COND_CODE(_XXXX##_flag, _if_1_code, _else_code)
| ^~~~~~~~~~~
../include/zephyr/sys/util_macro.h:204:9: note: in expansion of macro 'Z_COND_CODE_1'
204 | Z_COND_CODE_1(_flag, _if_1_code, _else_code)
| ^~~~~~~~~~~~~
../include/zephyr/devicetree.h:4986:9: note: in expansion of macro 'COND_CODE_1'
4986 | COND_CODE_1(DT_HAS_COMPAT_STATUS_OKAY(DT_DRV_COMPAT),
| ^~~~~~~~~~~
../include/zephyr/drivers/gpio/gpio_utils.h:37:9: note: in expansion of macro 'GPIO_DT_PORT_PIN_MASK_NGPIOS_EXC'
37 | GPIO_DT_PORT_PIN_MASK_NGPIOS_EXC(node_id, DT_PROP(node_id, ngpios))
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../include/zephyr/drivers/gpio/gpio_utils.h:48:9: note: in expansion of macro 'GPIO_PORT_PIN_MASK_FROM_DT_NODE'
48 | GPIO_PORT_PIN_MASK_FROM_DT_NODE(DT_DRV_INST(inst))
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/jiang/zephyrproject/zephyr/drivers/gpio/gpio_davinci.c:185:42: note: in expansion of macro 'GPIO_PORT_PIN_MASK_FROM_DT_INST'
185 | .port_pin_mask = GPIO_PORT_PIN_MASK_FROM_DT_INST(n),
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
zephyr/include/generated/zephyr/devicetree_generated.h:4122:50: note: in expansion of macro 'GPIO_DAVINCI_INIT'
4122 | #define DT_FOREACH_OKAY_INST_ti_davinci_gpio(fn) fn(0)
| ^~
../include/zephyr/sys/util_internal.h:105:36: note: in expansion of macro 'DT_FOREACH_OKAY_INST_ti_davinci_gpio'
105 | #define UTIL_PRIMITIVE_CAT(a, ...) a##VA_ARGS
| ^
/home/jiang/zephyrproject/zephyr/drivers/gpio/gpio_davinci.c:203:1: note: in expansion of macro 'DT_INST_FOREACH_STATUS_OKAY'
203 | DT_INST_FOREACH_STATUS_OKAY(GPIO_DAVINCI_INIT)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
[104/129] Building C object zephyr/kernel/CMakeFiles/kernel.dir/fatal.c.obj
ninja: build stopped: subcommand failed.
FATAL ERROR: command exited with status 1: /usr/bin/cmake --build /home/jiang/zephyrproject/zephyr/build
compile error: port is error,but I have checked the port from technical documents!
Beta Was this translation helpful? Give feedback.
All reactions